conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Use longest update time instead of average for queue sorting\n\nAfter the recent changes to the update process — where courses in the 'long' queue skip the time-consuming step of checking for deletions and page moves among all the edited articles — we now have very few courses ...
ruby
chosen
[ { "from": "system", "value": "Allow a proc as an alternative table cell value.\n" }, { "from": "human", "value": "module CollectionHelper\n def table_cell column, resource, alternative_value = nil\n value = '-'\n \n if column == 'name'\n value = resource.send(column)\n \n ...
ruby
chosen
[ { "from": "system", "value": "Fix to storm cookbook with new runit.\n" }, { "from": "human", "value": "#\n# Cookbook Name:: storm\n# Recipe:: undeploy\n#\n# Copyright 2012, Webtrends, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except...
ruby
chosen
[ { "from": "system", "value": "Rename exercise_name argument for consistency.\n" }, { "from": "human", "value": "module Generator\n module Files\n module GeneratorCases\n class << self\n def available(track_path)\n cases_filepaths(track_path).map { |filepath| exercise_nam...
ruby
chosen
[ { "from": "human", "value": "Add basic test case for TOC parser\n\ntests:\n - injecting anchor tags\n - injecting toc container\n\nSigned-off-by: Torbjörn Klatt <279a4cf6d7f8da1ddc113bb946b9273d9d938683@torbjoern-klatt.de>\n" }, { "from": "gpt", "value": "require 'test_helper'\nrequire_relativ...
ruby
chosen
[ { "from": "system", "value": "Remove paperclip and replace with active storage\n" }, { "from": "human", "value": "require 'acts_as_list'\nrequire 'uuidtools'\nrequire 'trusty_cms_clipped_extension/cloud'\nrequire 'paperclip'\nrequire 'will_paginate/array'\nmodule Clipped\n class Engine < Rails:...
ruby
chosen
[ { "from": "system", "value": "Add model tests for a removed initiative funder.\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass RemovedInitiativeFundingTest < ActiveSupport::TestCase\n # test \"the truth\" do\n # assert true\n # end\nend\n" }, { "from": "gpt", "...
ruby
chosen
[ { "from": "system", "value": "Add Rake as dev dependency.\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"middleman-breadcrumbs/version\"\n\nGem::Specification.new do |s|\n s.name = \"middleman-breadcrumbs\"\n s.version = Breadcrumbs::VER...
ruby
chosen
[ { "from": "system", "value": "Revert \"(maint) make install_puppetdb and install_puppetdb_terminus versions nil\"\n" }, { "from": "human", "value": "# We skip this step entirely unless we are running in :upgrade mode.\nif (test_config[:install_mode] == :upgrade)\n step \"Install most recent rel...
ruby
chosen
[ { "from": "system", "value": "Split Ruby and Proto namespaces.\n\nIn Proto events we cannot use :: for namespace delimiters. Dot is used\ninstead.\n" }, { "from": "human", "value": "module AggregateRoot\n MissingHandler = Class.new(StandardError)\n\n class DefaultApplyStrategy\n def initial...
ruby
chosen
[ { "from": "system", "value": "Add quick fix for columns hash missing columns on picture update.\n" }, { "from": "human", "value": "class Ecm::Pictures::Backend::PicturesController < Itsf::Backend::Resource::BaseController\n def self.resource_class\n Ecm::Pictures::Picture\n end\n\n private...
ruby
chosen
[ { "from": "system", "value": "Simplify statement in cucumber test steps\n\nUse click_button instead of find_button().trigger('click')\n" }, { "from": "human", "value": "Given(/^I have filled out the address information$/) do\n visit \"/\"\n click_link \"Submit a New Restroom\"\n fill_in \"res...
ruby
chosen
[ { "from": "system", "value": "MatchNumber: Swap around ordering of attr_readers.\n\nThis isn't very important, but it's alphabetical now! :D\n" }, { "from": "human", "value": "# Should probably be moved.\nclass MatchNumber\n\t# MongoDB compatibility methods.\n\tdef self.demongoize(object)\n\tend...
ruby
chosen
[ { "from": "human", "value": "Set photos_id_seq properly for PostgreSQL (re: recent \"MovePhotosToTheirOwnTable\" migration, which neglected to do this).\n" }, { "from": "gpt", "value": "class PostgresqlPhotosIdSeqInit < ActiveRecord::Migration\n def self.up\n if postgres?\n execute \"SE...
ruby
chosen
[ { "from": "system", "value": "Add filter to ensure \"running\" instances\n\nQuery only for \"running\" instances, make sure we're not targeting terminated instances." }, { "from": "human", "value": "require 'fog/aws'\n\nmodule Capistrano\n class Configuration\n def for_each_ec2_server(ec2_en...
ruby
chosen
[ { "from": "system", "value": "Use single-quoted strings without interpolation.\n" }, { "from": "human", "value": "module FilterFactory\n module ActiveRecord\n class Condition < FilterFactory::Condition\n def eq(obj)\n obj.where(field_name => value)\n end\n\n def ne(obj)...
ruby
chosen
[ { "from": "system", "value": "Send to maildrop in test or based on env\n\nThis was being selected for everything but production, but preprod, of\ncourse, runs in production mode, so it wasn't working. This fixes that.\n" }, { "from": "human", "value": "Rails.configuration.prisons = []\n\nDir[\"c...
ruby
chosen
[ { "from": "system", "value": "Stop sending update_type on publish\n\nSending it on publish has been deprecated in favour of including\nit when sending a put content.\n" }, { "from": "human", "value": "module HomepagePublisher\n CONTENT_ID = \"f3bbdec2-0e62-4520-a7fd-6ffd5d36e03a\".freeze\n\n d...
ruby
chosen
[ { "from": "system", "value": "Add autoload path for controller mixins.\n" }, { "from": "human", "value": "module Manageiq\n module Ui\n class Engine < ::Rails::Engine\n end\n end\nend\n" }, { "from": "gpt", "value": "module Manageiq\n module Ui\n class Engine < ::Rails::E...
ruby
chosen
[ { "from": "system", "value": "Fix command output not being logged.\n" }, { "from": "human", "value": "require 'logger'\n\nrequire 'mongo_oplog_backup/version'\nrequire 'mongo_oplog_backup/ext/enumerable'\nrequire 'mongo_oplog_backup/ext/timestamp'\n\nrequire 'mongo_oplog_backup/command'\nrequire...
ruby
chosen
[ { "from": "system", "value": "Add tvOS deployment target in podspec\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"XCDLumberjackNSLogger\"\n s.version = \"1.0.2\"\n s.summary = \"A CocoaLumberjack logger which sends logs to NS...
ruby
chosen
[ { "from": "system", "value": "Remove require that is obviated by autoload" }, { "from": "human", "value": "require \"logger\"\nrequire \"pg_search/scope\"\n\nmodule PgSearch\n class Document < ActiveRecord::Base\n include PgSearch\n self.table_name = 'pg_search_documents'\n belongs_to ...
ruby
chosen
[ { "from": "system", "value": "Clone payload just once in StringsStrategy.\n" }, { "from": "human", "value": "require 'rollbar/util'\nrequire 'rollbar/truncation/mixin'\n\nmodule Rollbar\n module Truncation\n class StringsStrategy\n include ::Rollbar::Truncation::Mixin\n\n STRING_TH...
ruby
chosen
[ { "from": "system", "value": "Disable email notifications for reindexing.\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + '/support/setup'\n\nclass ReindexEverything < CloudCrowd::Action\n \n def process\n docs = Document.where({:id => input}).includes(:pages, :docdata)\...
ruby
chosen
[ { "from": "system", "value": "Remove unused methods in ApplicationHelper\n\nThis was moved to the StateHelper\n" }, { "from": "human", "value": "module ApplicationHelper\n def facet_options(form, facet)\n form.object.facet_options(facet)\n end\n\n def state(document)\n state = document....
ruby
chosen
[ { "from": "system", "value": "Fix CarnivalEnumInput default nil parameter value in input method\n" }, { "from": "human", "value": "class CarnivalEnumInput < SimpleForm::Inputs::CollectionSelectInput\n\n def input(wrapper_options)\n options[:collection] ||= get_collection\n super\n end\n\...
ruby
chosen
[ { "from": "system", "value": "Add logging for class list snapshot\n" }, { "from": "human", "value": "class ClassListSnapshot < ActiveRecord::Base\n belongs_to :class_list\n\n validates :class_list, presence: true\n\n # Across all workspaces, creates new ClassListSnapshots for any student data...
ruby
chosen
[ { "from": "system", "value": "Save only user's name and email to genrated csv files\n" }, { "from": "human", "value": "class CsvGenerator\n def to_csv(submissions)\n column_names = Submission.column_names\n CSV.generate do |csv|\n csv << column_names\n submissions.each do |submi...
ruby
chosen
[ { "from": "system", "value": "Validate repository clones as well\n" }, { "from": "human", "value": "# encoding: utf-8\n#--\n# Copyright (C) 2013 Gitorious AS\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public Li...
ruby
chosen
[ { "from": "system", "value": "Make Permissions an outpost model\n" }, { "from": "human", "value": "class Permission < ActiveRecord::Base\n #-------------------\n # Association\n has_many :user_permissions\n has_many :users, class_name: Outpost.user_class, through: :user_permissions, dependen...
ruby
chosen
[ { "from": "system", "value": "Add an extra completion to better exercise choosing first\n" }, { "from": "human", "value": "describe 'the `completion` suggestion strategy' do\n let(:options) { ['ZSH_AUTOSUGGEST_STRATEGY=completion'] }\n let(:before_sourcing) do\n -> do\n session.\n ...
ruby
chosen
[ { "from": "system", "value": "Add authorization to enrollment semesters\n\nChange-Id: I36077e28b1a55fa0b4b3105477aa9977d0f271a5\n" }, { "from": "human", "value": "class EnrollmentSemestersController < ApplicationController\n\n def edit\n @semester = EnrollmentSemester.find(params[:id])\n en...
ruby
chosen
[ { "from": "system", "value": "Set the atom and email URLs for the statistics filter\n" }, { "from": "human", "value": "class StatisticsFilterJsonPresenter < DocumentFilterPresenter\n def result_type\n \"statistic\"\n end\nend\n" }, { "from": "gpt", "value": "class StatisticsFilt...
ruby
chosen
[ { "from": "system", "value": "Move members to dedicated field\n" }, { "from": "human", "value": "xml.instruct!\nxml.EventResult do\n xml.UniqueCode \"skyderby-ws-performance-#{@event.id}-teams\"\n @team_ranking.ranking.each_with_index do |row, index|\n xml.Entrant do\n xml.CompetitionN...
ruby
chosen
[ { "from": "system", "value": "Remove inherited resources from regions controller\n" }, { "from": "human", "value": "class RegionsController < ApplicationController\n # Include Inherited Resources behaviour\n inherit_resources\n\n layout 'home'\n\n has_scope :depth, :default => 1, :only => :i...
ruby
chosen
[ { "from": "system", "value": "Fix override positioning and bootstrap classes" }, { "from": "human", "value": "Deface::Override.new(:virtual_path => \"spree/shared/_main_nav_bar\",\n :name => \"contact_us_in_header\",\n :insert_bottom => \"#main-nav-bar\",\...
ruby
chosen
[ { "from": "system", "value": "Reorganize specs for conversion protocol\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'Conversion protocol' do\n it \"converts a string to a BigDecimal\" do\n '42'.to_bd.should == BigDecimal('42')\n end\n\n it \"converts a float to a Bi...
ruby
chosen
[ { "from": "system", "value": "Fix up tests after adding foreign key constraints\n" }, { "from": "human", "value": "# Read about factories at https://github.com/thoughtbot/factory_girl\n\nFactoryGirl.define do\n factory :delivery_link do\n delivery_id 1\n link_id 1\n end\nend\n" }, { ...
ruby
chosen
[ { "from": "system", "value": "Remove more verbose use of all\n" }, { "from": "human", "value": "class NoteCreationService\n def self.create(*args)\n new(*args).create\n end\n\n delegate :user, :story, to: :note\n\n def initialize(note)\n @note = note\n end\n\n def create\n ActiveR...
ruby
chosen
[ { "from": "system", "value": "Add `robots.txt` to the list of reserved namespaces\n" }, { "from": "human", "value": "# NamespaceValidator\n#\n# Custom validator for GitLab namespace values.\n#\n# Values are checked for formatting and exclusion from a list of reserved path\n# names.\nclass Namesp...
ruby
chosen
[ { "from": "system", "value": "Fix issues with install template being out of date\n" }, { "from": "human", "value": "Keeper.configure do |config|\n # The time to expire for the tokens\n # config.expiry = 24.hours\n\n # The hashing method to for the tokens\n # Options:\n # HS256 -...
ruby
chosen
[ { "from": "system", "value": "Allow unstructured facts in YAML (e.g. facter output)\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire_relative '../facts'\nrequire 'yaml'\n\nmodule OctocatalogDiff\n class Facts\n # Deal with facts in YAML files\n class Yaml\n ...
ruby
chosen
[ { "from": "system", "value": "Use library date with downcase d\n" }, { "from": "human", "value": "require 'Date'\nmodule Similarweb\n module EstimatedVisits\n def estimated_visits(domain)\n date = Date.today.prev_month.strftime(\"%m-%Y\")\n response = self.http_client.get \"#{domai...
ruby
chosen
[ { "from": "system", "value": "Fix to set the right tag.\n" }, { "from": "human", "value": "module SUNAT\n\n class PaymentAmount\n include Model\n\n # Money amounts always in lowest common denominator, so integer only!\n property :value, Integer\n property :currency, String, defau...
ruby
chosen
[ { "from": "human", "value": "Add a DubyCommand class to be the main class for Duby's executable jar.\n" }, { "from": "gpt", "value": "require 'java'\nrequire 'duby'\n\njava_package \"org.jruby.duby\"\nclass DubyCommand\n java_signature \"void main(String[])\"\n def self.main(args)\n rb_args...
ruby
chosen
[ { "from": "system", "value": "Update the gemspec to use zip_tricks version with uniquify duplicate\nfilenames\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/zipline/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Ra...
ruby
chosen
[ { "from": "system", "value": "Tests: Fix ruby version check on JRuby\n" }, { "from": "human", "value": "require 'rspectacular'\nrequire 'ruby-progressbar/calculators/running_average'\n\nclass ProgressBar\nmodule Calculators\nRSpec.describe Length do\n if Gem::Version.new(RUB...
ruby
chosen
[ { "from": "system", "value": "Fix gem name to match readme\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'pt_online_migration/version'\n\nGem::Specification.new do |spec|\n spec.na...
ruby
chosen
[ { "from": "human", "value": "Add test for EPUB module\n" }, { "from": "gpt", "value": "require_relative 'helper'\nrequire 'epub/book'\n\nclass TestEUPB < Test::Unit::TestCase\n def setup\n @file = 'test/fixtures/book.epub'\n end\n\n def test_parse\n book = EPUB::Book.new\n assert_not...
ruby
chosen
[ { "from": "human", "value": "Migrate retires_on and retirement_last_warn to datetime\n\nhttps://bugzilla.redhat.com/show_bug.cgi?id=1316632\n" }, { "from": "gpt", "value": "class ChangeRetiresOnToDatetime < ActiveRecord::Migration[5.0]\n def up\n change_column :vms, :retires_on, :datetime\n ...
ruby
chosen
[ { "from": "human", "value": "Add `knife zone list` subcommand\n\nRefs #10\n" }, { "from": "gpt", "value": "#\n# Author:: Seth Chisamore (<schisamo@opscode.com>)\n# Copyright:: Copyright (c) 2011 Opscode, Inc.\n# License:: Apache License, Version 2.0\n#\n# Licensed under the Apache License, Versi...
ruby
chosen
[ { "from": "system", "value": "Reset matte channel for better rendering\n" }, { "from": "human", "value": "#! /usr/local/bin/ruby -w\nrequire 'RMagick'\n\ncanvas = Magick::Image.new(260, 125)\ngc = Magick::Draw.new\ngc.fill('black')\ngc.rectangle(10,20, 250,90)\n\ngc.stroke('blue')\ngc.fill('yell...
ruby
chosen
[ { "from": "system", "value": "Fix homepage to use SSL in Biicode Cask\n\nThe HTTP URL is already getting redirected to HTTPS. Using the HTTPS URL directly\nmakes it more secure and saves a HTTP round-trip.\n" }, { "from": "human", "value": "cask :v1 => 'biicode' do\n version '3.2'\n sha256 'b6...
ruby
chosen
[ { "from": "system", "value": "Update Charles to version 3.9.1\n" }, { "from": "human", "value": "class Charles < Cask\n url 'http://www.charlesproxy.com/assets/release/3.9/charles-proxy-3.9-applejava.dmg'\n homepage 'http://www.charlesproxy.com/'\n version '3.9'\n sha256 'a5d8c557fc97ed87dbf...
ruby
chosen
[ { "from": "system", "value": "Fix DEVEX-973: Match prompts to the labels used in the console.\n" }, { "from": "human", "value": "module HP\n module Cloud\n class CLI < Thor\n \n desc 'account:setup', \"set up or modify your credentials\"\n long_desc <<-DESC\n Setup or modify yo...
ruby
chosen
[ { "from": "system", "value": "Use symbol or string in resource\n" }, { "from": "human", "value": "\nactions :run\ndefault_action :run\n\nattribute :message, :kind_of => String, :name_attribute => true\nattribute :level, :kind_of => String, :default => 'INFO'\nattribute :annotated_by, :kind_of =>...
ruby
chosen
[ { "from": "system", "value": "Add explicit call to status on sinatra return values\n" }, { "from": "human", "value": "require 'bundler/setup'\nrequire 'sinatra/base'\nrequire 'nokogiri'\nrequire 'json'\n\nrequire 'pinch_hitter/service/response_queues'\nrequire 'pinch_hitter/message/content_type'...
ruby
chosen
[ { "from": "system", "value": "Remove wrong comment lines for MentionPattern\n" }, { "from": "human", "value": "module Qiita\n module Markdown\n module Filters\n # 1. Adds :mentioned_usernames into result Hash as Array of String.\n # 2. Replaces @mention with link.\n #\n #...
ruby
chosen
[ { "from": "system", "value": "Fix issue with loading DSL configs by relative path\n" }, { "from": "human", "value": "require 'amazing/config/dsl/awesome'\nrequire 'amazing/numeric'\n\nmodule Amazing\n class Config < Hash\n class Dsl\n attr_reader :awesome_statusbars\n\n def initial...
ruby
chosen
[ { "from": "system", "value": "Remove spec of non-existing method\n" }, { "from": "human", "value": "require File.expand_path('../../../spec_helper', __FILE__)\nrequire File.expand_path('../fixtures/classes', __FILE__)\nrequire File.expand_path('../shared/exit', __FILE__)\n\ndescribe \"Thread#ter...
ruby
chosen
[ { "from": "system", "value": "Add more methods to the list we delegate\n\nSpecifically all those helpful methods like .blank? etc that we get from rails. Maybe we should just delegate everything we haven't specifically overridden ourselves. That might be better?\n" }, { "from": "human", "value...
ruby
chosen
[ { "from": "system", "value": "Fix require of toml-rb gem\n" }, { "from": "human", "value": "# resources/config.rb\n#\n# Author: Simple Finance <ops@simple.com>\n# License: Apache License, Version 2.0\n#\n# Copyright 2013 Simple Finance Technology Corporation\n#\n# Licensed under the Apache Licen...
ruby
chosen
[ { "from": "system", "value": "Extend HSTS header (preload and cover subdomains)\n\nSigned-off-by: David A. Wheeler <9ae72d22d8b894b865a7a496af4fab6320e6abb2@dwheeler.com>\n" }, { "from": "human", "value": "# frozen_string_literal: true\nSecureHeaders::Configuration.default do |config|\n normal_...
ruby
chosen
[ { "from": "system", "value": "Write last iteration timestamp on each attempt\n" }, { "from": "human", "value": "module Hack\n class UpdatesUserExercise\n attr_reader :user_id, :language, :slug\n\n def initialize(user_id, language, slug)\n @user_id = user_id\n @language = languag...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary dependency on DefaultCustomQuery plugin\n" }, { "from": "human", "value": "# Edit Custom Fields plugin for Redmine\n# \n# Copyright (c) 2015 Frederick Thomssen\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# ...
ruby
chosen
[ { "from": "system", "value": "Add bundler as dep to gemspec.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'forklift/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Convert old orbital periods to relative earth periods\n" }, { "from": "human", "value": "class SpaceAge\n\n SECONDS_IN_YEAR = 31557600.0\n ORBITAL_PERIODS = {\n 'mercury' => 0.2408467,\n 'venus' => 0.61519726,\n 'earth' => 1,\n 'mars' => 1.8808158,\n ...
ruby
chosen
[ { "from": "system", "value": "Remove no_prisoner_packs method - now obsolete\n" }, { "from": "human", "value": "module SmartAnswer::Calculators\n class ArrestedAbroad\n # created for the help-if-you-are-arrested-abroad calculator\n attr_reader :data\n\n def initialize\n @data = se...
ruby
chosen
[ { "from": "human", "value": "Correct revision so that it works when a user is impersonated\n\ngit-svn-id: f67d969b640da65cb7bc1d229e09fd6d2db44ae1@755 392d7b7b-3f31-0410-9dc3-c95a9635ea79\n" }, { "from": "gpt", "value": "class UpdateMenuImpersonateRevert < ActiveRecord::Migration\n def self.up\...
ruby
chosen
[ { "from": "human", "value": "Add submission views feature spec\n" }, { "from": "gpt", "value": "include Warden::Test::Helpers\nWarden.test_mode!\n\ndescribe \"testing submissions views:\" do\n\n let!(:user) { FactoryGirl.create(:user) }\n let!(:submission_to_rate) { FactoryGirl.create(:submiss...
ruby
chosen
[ { "from": "system", "value": "Use America/New_York instead of America/Montreal for TZ info.\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n include SslRequirement\n include AuthenticatedSystem\n include ExceptionNotifiable\n\n helper :all\n helper_m...
ruby
chosen
[ { "from": "system", "value": "Send repository comments from known account\n" }, { "from": "human", "value": "# Copyright 2011-2017, The Trustees of Indiana University and Northwestern\n# University. Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this fi...
ruby
chosen
[ { "from": "system", "value": "Add github repo as homepage.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'ar_transaction_changes/version'\n\nGem::Specification.new do |gem...
ruby
chosen
[ { "from": "system", "value": "Fix logo in open graph tags\n" }, { "from": "human", "value": "# frozen_string_literal: true\nmodule MetadataHelper\n def logo_image_url\n image_url 'logo.jpg'\n end\n\n def meta_keywords\n config.keywords.join(', ')\n end\n\n def meta_title\n page_tit...
ruby
chosen
[ { "from": "system", "value": "Destroy sessions when signing out\n" }, { "from": "human", "value": "module SessionsHelper\n \n def sign_in(user)\n remember_token = Session.new_remember_token\n cookies.permanent[:remember_token] = remember_token\n Session.create(remember_token: Session....
ruby
chosen
[ { "from": "human", "value": "Add rake task to get sample of notes for coding\n" }, { "from": "gpt", "value": "# This is intended for use in a one-off analysis task.\nclass ExportNotesSample\n # This doesn't do any authorization checks.\n def unsafe_csv_without_authorization_checks(options = {}...
ruby
chosen
[ { "from": "system", "value": "Fix incorrect send call for wp post\n" }, { "from": "human", "value": "module WpPost\n extend ActiveSupport::Concern\n\n included do\n serialize :acf_fields\n end\n\n def update_post(json)\n self.class.mappable_wordpress_attributes.each do |wp_attribute|\n...
ruby
chosen
[ { "from": "system", "value": "Move default store to \"dugway\"\n" }, { "from": "human", "value": "module Dugway\n class Application\n def initialize(options={})\n @source_dir = File.join(Dir.pwd, options[:source_dir] || 'source')\n @theme = Theme.new(@source_dir, options[:user_sett...
ruby
chosen
[ { "from": "system", "value": "Use require active_record, not require activerecord\n" }, { "from": "human", "value": "require \"rubygems\"\nrequire \"activerecord\"\nrequire File.expand_path(File.dirname(__FILE__) + \"/../lib/url_normalization\")\nrequire File.expand_path(File.dirname(__FILE__) +...
ruby
chosen
[ { "from": "system", "value": "Allow codeclimate to post coverage\n" }, { "from": "human", "value": "require 'rspec'\nrequire 'webmock/rspec'\n\nif ENV[\"CODECLIMATE_REPO_TOKEN\"]\n require \"codeclimate-test-reporter\"\n CodeClimate::TestReporter.start\nend\n\nrequire 'healthy'\n\nHealthy.a19_...
ruby
chosen
[ { "from": "system", "value": "Fix documentation for Reporter class\n\nChange-Id: I324caa5900491528ae26cd38b3f382e0ca9b0c28\nReviewed-on: http://gerrit.causes.com/45311\nReviewed-by: Shane da Silva <67fb7bfe39f841b16a1f86d3928acc568d12c716@brigade.com>\nTested-by: jenkins <d95b56ce41a2e1ac4cecdd398defd741440...
ruby
chosen
[ { "from": "system", "value": "Use CQL 2.0.0 for specs if using cassandra 1.2 or above.\n" }, { "from": "human", "value": "if RUBY_VERSION >= \"1.9\"\n require 'simplecov'\n SimpleCov.start\nend\n\nrequire 'rubygems'\nrequire 'bundler'\nBundler.setup(:default, :test)\n\nrequire 'yaml'\nrequire ...
ruby
chosen
[ { "from": "system", "value": "Fix code coverage report sending\n" }, { "from": "human", "value": "VCR.configure do |c|\n c.cassette_library_dir = Rails.root.join(\"spec\", \"vcr\")\n c.hook_into :webmock\n c.configure_rspec_metadata!\nend\n" }, { "from": "gpt", "value": "VCR.confi...
ruby
chosen
[ { "from": "system", "value": "Allow implicit conversion of HTTP::ResponseBody into String\n" }, { "from": "human", "value": "module HTTP\n # A streamable response body, also easily converted into a string\n class ResponseBody\n include Enumerable\n\n def initialize(client)\n @client...
ruby
chosen
[ { "from": "system", "value": "Change gem name to bs_form_builder\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'bootstrap_form_builder/version'\n\nGem::Specification.new do |spec|\n...
ruby
chosen
[ { "from": "system", "value": "Make sure the state file only contains unique fields\n" }, { "from": "human", "value": "require \"json\"\n\nmodule VagrantPlugins\n module CommandPlugin\n # This is a helper to deal with the plugin state file that Vagrant\n # uses to track what plugins are in...
ruby
chosen
[ { "from": "system", "value": "Update features for changes in latest cucumber\n" }, { "from": "human", "value": "module NavigationHelpers\n def path_to(page_name)\n case page_name\n \n when /the homepage/i\n root_path\n \n # Add more page name => path mappings here\n \n ...
ruby
chosen
[ { "from": "system", "value": "Add assertions for API pagination\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'Bathrooms API' do\n it 'sends a list of bathrooms' do\n FactoryGirl.create_list(:bathroom, 15)\n end\n it 'filters a list of bathrooms by unisex type'\n i...
ruby
chosen
[ { "from": "system", "value": "Enable spec for sending valid place form data.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe \"/api/v1/send_message\" do\n\n let(:url) { \"/api/v1\" }\n\n it \"sends valid place form data\" do\n pending \"Fix recipient address.\"\n pla...
ruby
chosen
[ { "from": "system", "value": "9690: Fix user group name uniqueness error\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :user_group do\n name { Faker::Team.name }\n mission { get_mission }\n end\nend\n" }, { "from": "gpt", "value": "# frozen_string_literal...
ruby
chosen
[ { "from": "system", "value": "Test resets expiry after changing it\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe EphemeralResponse::Configuration do\n subject { EphemeralResponse::Configuration }\n describe \"#fixture_directory\" do\n it \"has a default\" do\n su...
ruby
chosen
[ { "from": "human", "value": "Add tests for Port class\n" }, { "from": "gpt", "value": "require \"spec_helper\"\n\nmodule Chartroom\n describe Port do\n let(:private_port) { 80 }\n let(:public_port) { 80 }\n let(:type) { \"tcp\" }\n\n let(:params) do\n { \"IP\" => \"0.0...
ruby
chosen
[ { "from": "human", "value": "Write feature test for invalid login to show error message.\n" }, { "from": "gpt", "value": "feature 'Login' do\n scenario 'invalid login displays an error' do\n visit '/login'\n fill_in 'user_name', with: ''\n fill_in 'user_password', with: ''\n click_b...
ruby
chosen
[ { "from": "human", "value": "Add tests for /songs api\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\nRSpec.describe 'Songs', type: :request do\n let(:live) { create(:live) }\n let!(:song) { create(:song, status: :open, live: live) }\n\n describe 'GET /songs.json' do\n let(:expe...
ruby
chosen
[ { "from": "system", "value": "Fix api:dir rake task so it works on my machine :)\n" }, { "from": "human", "value": "require 'yard'\nrequire 'yard/rake/yardoc_task'\nrequire File.expand_path(File.dirname(__FILE__) + '/../lib/cucumber/platform')\n\nSITE_DIR = File.expand_path(File.dirname(__FILE__...
ruby
chosen
[ { "from": "system", "value": "Update dev and runtime dependencies\n" }, { "from": "human", "value": "require File.expand_path('../lib/git_handler/version', __FILE__)\n\nGem::Specification.new do |s|\n s.name = \"git_handler\"\n s.version = GitHandler::VERSION\n s.summary = \"Li...
ruby
chosen
[ { "from": "system", "value": "[JLT-173344] Prepare dynasprint environment for Sprint 8\n* Fixed cause of exceptions in server logs (\"Failed to access preferences node for path\") by creating dynatrace user with home directory\n" }, { "from": "human", "value": "#\n# Cookbook Name:: dynatrace\n# ...
ruby
chosen
[ { "from": "system", "value": "Tidy use of url in MenuItem component.\n" }, { "from": "human", "value": "module ActiveAdmin\n module Views\n\n # Arbre component used to render ActiveAdmin::MenuItem\n class MenuItem < Component\n builder_method :menu_item\n attr_reader :label\n ...
ruby
chosen
[ { "from": "system", "value": "Fix a bug with debug flag and nil session\n" }, { "from": "human", "value": "module AmazonAuth\n module CommonExtension\n\n def log(message)\n return unless (@options[:debug] || @options[:verbose])\n puts \"[#{Time.current.strftime('%Y-%m-%d %H:%M:%S')...
ruby
chosen
[ { "from": "human", "value": "Add extra parameters for recent activity of attachments\n\nConflicts:\n\tdb/schema.rb\n" }, { "from": "gpt", "value": "class AddFilenameAndUsernameToAttachmentRecentActivityParameters < ActiveRecord::Migration\n\n def up\n RecentActivity.where(trackable_type: 'At...
ruby
chosen