conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Include ext and bin in the gemspec.\n" }, { "from": "human", "value": "$:.unshift File.expand_path('../lib', __FILE__)\nrequire 'tidings/version'\n\nGem::Specification.new do |spec|\n spec.name = \"tidings\"\n spec.version = Tidings::VERSION\n spec.date ...
ruby
chosen
[ { "from": "human", "value": "Use memcache for Abingo caching.\n" }, { "from": "gpt", "value": "require 'abingo'\nAbingo.cache = ActiveSupport::Cache::MemCacheStore.new('localhost', { :namespace => \"wheelmap/#{Rails.env}/\",\n :c_threshold => ...
ruby
chosen
[ { "from": "system", "value": "Fix AR error in Resque workers.\n" }, { "from": "human", "value": "Resque.redis.namespace = \"resque:Cyclescape\"\nResque.inline = true if Rails.env.test?\n" }, { "from": "gpt", "value": "Resque.redis.namespace = \"resque:Cyclescape\"\nResque.inline = tr...
ruby
chosen
[ { "from": "system", "value": "Replace bash resource with execute resource\n" }, { "from": "human", "value": "action :install do\n # Update the code.\n git new_resource.path do\n action :sync\n repository new_resource.repository\n checkout_branch new_resource.revision\n destination ...
ruby
chosen
[ { "from": "system", "value": "Make keyboard navigation in the result view work again.\n" }, { "from": "human", "value": "class ResultsTableView < NSTableView\n def _highlightColorForCell(cell)\n NSColor.secondarySelectedControlColor\n end\n \n def acceptsFirstResponder\n false\n end...
ruby
chosen
[ { "from": "system", "value": "Revert \"Start step at 1800\"\n\nThis reverts commit acfecb6380864fc3df2c96409ee9ccd82e4a3765.\n\nConflicts:\n\ttrends.rb\n" }, { "from": "human", "value": "require 'json'\nrequire 'csv'\n\n######### Define arguments #########\n\nINPUT = \"data/cleaned.json\"\nTARGE...
ruby
chosen
[ { "from": "system", "value": "Make max wait time a constant\n\nSo it can be used elsewhere in the code\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule QA\n module Support\n module Waiter\n module_function\n\n def wait(max: 60, interval: 0.1)\n QA::...
ruby
chosen
[ { "from": "system", "value": "Update to use the latest version of Skala Color.\n" }, { "from": "human", "value": "class ColorpickerSkalacolor < Cask\n url 'http://s3.amazonaws.com/bjango/files/skalacolor/skalacolor1.0.zip'\n homepage 'http://bjango.com/mac/skalacolor/'\n version '1.0'\n sha2...
ruby
chosen
[ { "from": "system", "value": "Update required version of the CDA SDK\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"ContentfulManagementAPI\"\n s.version = \"0.5.1\"\n s.summary = \"Objective-C SDK for Contentful's Content Management API.\"\...
ruby
chosen
[ { "from": "system", "value": "Increment gem version to 0.3.1\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'crudecumber'\n s.version = '0.3.0'\n s.date = Date.today.to_s\n s.summary = 'Crudecumber 0.3.0'\n s.description = \"Manually run th...
ruby
chosen
[ { "from": "human", "value": "Add migration for foreign key constraint\n" }, { "from": "gpt", "value": "class EducatorLabelsForeignKey < ActiveRecord::Migration[5.1]\n def change\n add_foreign_key \"educator_labels\", \"educators\", name: \"educator_labels_educator_id_fk\"\n end\nend\n" } ...
ruby
chosen
[ { "from": "system", "value": "Add test coverage for complex criteria in groups as well as the default behavior\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Bastet::Base do\n before do\n @bastet = Bastet.setup(@redis)\n end\n\n describe \"activate\" do\n it \"shou...
ruby
chosen
[ { "from": "system", "value": "Add more specs for Tasks\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe Task do\n let(:task) { build(:task) }\n\n it \"must be valid\" do\n expect(task).to be_valid\n end\nend\n" }, { "from": "gpt", "value": "require 'r...
ruby
chosen
[ { "from": "system", "value": "Test to ensure 5 second grub timout. IMAGE-543\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe file('/etc/grub.conf') do\n\tit { should be_file }\n\tit { should contain \"tsc=reliable\" }\n it { should contain \"divider=10\" }\nend\n\n\n" }, ...
ruby
chosen
[ { "from": "system", "value": "Add post model rspec tests\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe Post do\n\n\n#METHOD TESTS WILL LIVE HERE!\n\n\n\n describe \"validations\" do\n\n it \"is NOT valid without a title\" do\n post = Post.new(author_id: 1, body:...
ruby
chosen
[ { "from": "system", "value": "Improve reasoning in brew bottle for using gzip.\n" }, { "from": "human", "value": "# Builds binary brew package\nbrew_install\n\ndestination = HOMEBREW_PREFIX + \"Bottles\"\nif not File.directory?(destination)\n Dir.mkdir destination\nend\n\nARGV.each do|formula|\...
ruby
chosen
[ { "from": "system", "value": "Use const_get instead of constantize\n" }, { "from": "human", "value": "module ActiveInteraction\n module Attr\n def self.factory(attr_type)\n klass = \"#{attr_type.to_s.capitalize}Attr\"\n\n raise NoMethodError unless ActiveInteraction.const_defined?(...
ruby
chosen
[ { "from": "human", "value": "Add helper for displaying timestamps and durations\n" }, { "from": "gpt", "value": "\nclass Batch\n\n module Helpers\n\n # Methods for displaying times/durations\n module DateTime\n\n # Converts the elapsed time in seconds to a string show...
ruby
chosen
[ { "from": "system", "value": "Update status check to use new Ionic header\n\nFixes \"Authorization header is malformed; JWT could not be extracted.\"" }, { "from": "human", "value": "module IonicNotification\n class StatusService\n include HTTParty\n base_uri IonicNotification.ionic_api_u...
ruby
chosen
[ { "from": "system", "value": "Raise an exception when Server.pubsub class method is not defined\n" }, { "from": "human", "value": "module ActionCable\n module Channel\n\n module Redis\n extend ActiveSupport::Concern\n\n included do\n on_unsubscribe :unsubscribe_from_redis_ch...
ruby
chosen
[ { "from": "system", "value": "Disable session store and reenable api_only now that Omniauth is gone\n" }, { "from": "human", "value": "require File.expand_path('../boot', __FILE__)\n\nrequire \"rails\"\n# Pick the frameworks you want:\nrequire \"active_model/railtie\"\nrequire \"active_job/railt...
ruby
chosen
[ { "from": "system", "value": "Fix position of activating coveralls\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\nrequire 'rubic'\n\nrequire 'minitest/autorun'\nrequire 'coveralls'\n\nCoveralls.wear!\n" }, { "from": "gpt", "value": "req...
ruby
chosen
[ { "from": "system", "value": "Allow to embed this app in an iframe\n" }, { "from": "human", "value": "require \"sinatra\"\nrequire \"twilio-ruby\"\n\nget \"/\" do\n capability = Twilio::Util::Capability.new ENV[\"ACCOUNT_SID\"], ENV[\"ACCOUNT_TOKEN\"]\n capability.allow_client_outgoing ENV[\"A...
ruby
chosen
[ { "from": "system", "value": "Add dependency on gdk_pixbuff2 ~> 3.4.0\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'morandi/version'\n\nGem::Specification.new do |spec|\n spec.nam...
ruby
chosen
[ { "from": "system", "value": "Update Capistrano dependency to v3.1.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\n# Author:: Sunggun Yu\n\n$:.push File.expand_path('lib', __FILE__)\n\nrequire_relative 'lib/capitomcat/version'\n\nGem::Specification.new do |s|\n s.name =...
ruby
chosen
[ { "from": "system", "value": "Fix tests for Rails 4.2\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass AngularRailsCsrfTest < ActionController::TestCase\n tests ApplicationController\n\n setup do\n @controller.allow_forgery_protection = true\n @correct_token = @controlle...
ruby
chosen
[ { "from": "system", "value": "Update rubocop v0.51.0 and rubocop-rspec v1.19.0\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path(\"../lib\", __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire \"onkcop/version\"\n\nGem::Specification.new do |spec|...
ruby
chosen
[ { "from": "system", "value": "Fix assets precompile with config.assets.initialize_on_precompile = true\n" }, { "from": "human", "value": "require 'activeadmin'\n\nmodule ActiveAdmin\n module Sortable\n class Engine < ::Rails::Engine\n engine_name 'activeadmin_sortable_tree'\n\n ini...
ruby
chosen
[ { "from": "system", "value": "Use fully qualified name when rescuing Sequel::Error\n" }, { "from": "human", "value": "require \"sequel/model\"\nmodule Delayed\n module Serialization\n module Sequel\n def self.configure(klass)\n klass.class_eval do\n if YAML.parser.class....
ruby
chosen
[ { "from": "system", "value": "Use .should_not.equal? instead of comparing object_id\n" }, { "from": "human", "value": "require_relative '../../spec_helper'\n\ndescribe \"Range#clone\" do\n it \"duplicates the range\" do\n original = (1..3)\n copy = original.clone\n copy.begin.should ==...
ruby
chosen
[ { "from": "system", "value": "Use more general specification of primary key rather than model's primary key.\n" }, { "from": "human", "value": "class ThinkingSphinx::ActiveRecord::SQLSource::Template\n attr_reader :source\n\n def initialize(source)\n @source = source\n end\n\n def apply\n...
ruby
chosen
[ { "from": "system", "value": "Add Georgia.roles with default roles\n" }, { "from": "human", "value": "require \"georgia/version\"\nrequire \"georgia/paths\"\nrequire \"georgia/engine\"\nrequire \"georgia/uploader/adapter\"\nrequire \"georgia/permissions\"\n\nmodule Georgia\n\n mattr_accessor :t...
ruby
chosen
[ { "from": "system", "value": "Store employee_pid as an Integer" }, { "from": "human", "value": "class CreateJobs < ActiveRecord::Migration\n def self.up\n create_table :jobs do |t|\n t.string :path\n t.text :args\n t.text :result\n t.datetime :started_at\n t.datetime...
ruby
chosen
[ { "from": "system", "value": "Fix stupid bug setting json as default params encoding method\n" }, { "from": "human", "value": "module ApiRecipes\n module Settings\n GLOBAL_TIMEOUT = 1\n FAIL_OPTIONS = [:return, :raise, :return_false]\n\n DEFAULT = {\n protocol: 'http',\n ...
ruby
chosen
[ { "from": "system", "value": "Revert \"try forcing omniauth return url\"\n\nThis reverts commit 7590e0481b65ab4acb4a588315627fe272016098.\n" }, { "from": "human", "value": "Rails.application.config.middleware.use OmniAuth::Builder do\n provider :steam, STEAM_WEB_API_KEY\nend\n\nrequire \"openid...
ruby
chosen
[ { "from": "human", "value": "Add server-side reCAPTCHA hostname validation based on known convention domains + default host\n" }, { "from": "gpt", "value": "Recaptcha.configuration.hostname = ->(hostname) do\n (\n Rails.application.config.action_mailer.default_url_options[:host].gsub(/:\\d+\...
ruby
chosen
[ { "from": "system", "value": "Add descriptive console messages for join events\n" }, { "from": "human", "value": "require 'slack'\n\nSlack.configure do |config|\n config.token = ENV['slack_api_token']\nend\n\nclient = Slack.realtime\n\nclient.on :team_join do |data|\n puts 'New User Joined'\n ...
ruby
chosen
[ { "from": "system", "value": "Reduce number of opening database\n" }, { "from": "human", "value": "require File.expand_path(\"../../env\", __FILE__)\nrequire \"yaml\"\nrequire \"feedcellar\"\n\nresources = YAML.load_file(\"resources.yaml\")\n\ncommand = Feedcellar::Command.new\n\nresources.each ...
ruby
chosen
[ { "from": "system", "value": "Write logs to stderr if used in non-Rails application\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nrequire 'net/http'\nrequire 'uri'\nrequire 'pathname'\nrequire 'active_support/all'\n\nmodule Takosan\n mattr_accessor :url, :channel, :name, :icon\n\n...
ruby
chosen
[ { "from": "system", "value": "Set default value for pavlov_options\n" }, { "from": "human", "value": "require 'pavlov'\n\nmodule Pavlov\n def self.command command_name, *args\n class_name = \"Commands::\"+string_to_classname(command_name)\n klass = get_class_by_string(class_name)\n att...
ruby
chosen
[ { "from": "system", "value": "Add deals method to Organization\n" }, { "from": "human", "value": "module PipedriveAPI\n class Organization < Base\n\n class << self\n\n\n\n end\n\n end\nend\n" }, { "from": "gpt", "value": "module PipedriveAPI\n class Organization < Base\n\n ...
ruby
chosen
[ { "from": "system", "value": "Change /eubusiness to an exact route\n\n[We're getting errors](https://sentry.io/organizations/govuk/issues/1884114207/?environment=production&project=202213&referrer=slack)\nbecause router is sending sub paths of /eubusiness to collections. We only have\nthe /eubusiness page r...
ruby
chosen
[ { "from": "system", "value": "Check both errors at once using begin/end\n\nThis is a bit smelly because this code really belongs in a test\ninstead of at the bottom of the file. However, I want to focus\nmore on the main class itself right now and not so much creating\na test. How dare that be typed from my...
ruby
chosen
[ { "from": "system", "value": "Add AtomicDoc to the controller" }, { "from": "human", "value": "class Api::AtomicDocsController < ApplicationController\n respond_to :json\n\n skip_before_action :verify_authenticity_token\n before_action :validate_api_key, only: %i[documents sessions]\n\n def ...
ruby
chosen
[ { "from": "system", "value": "Switch the Faraday specs to use the faraday test app directly.\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'rack/client/adapter/faraday'\n\ndescribe Faraday::Adapter::RackClient do\n\n let(:url) { URI.join(@base_url, '/faraday') }\n\n let(:co...
ruby
chosen
[ { "from": "system", "value": "Remove Repository reference in spec\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe ROM do\n describe '.setup' do\n it 'allows passing in repository instances' do\n klass = Class.new(ROM::Repository)\n repo = klass.new\n\n set...
ruby
chosen
[ { "from": "system", "value": "Remove 'Today's' in the action\n" }, { "from": "human", "value": "module Ruboty\n module DMM\n module Actions\n class Messenger < Ruboty::Actions::Base\n def call\n attachments = Ruboty::DMM::Ranking.new(submedia: message.match_data[:submedi...
ruby
chosen
[ { "from": "system", "value": "AirVideoServer: Update license, add name stanza" }, { "from": "human", "value": "cask :v1 => 'air-video-server' do\n version '2.4.6-beta3u2'\n sha256 '479af913987a4cc8414969a8d4a4c164a4bd0a22d156829a983b4c58e9dd3f6e'\n\n url \"https://s3.amazonaws.com/AirVideo/Ai...
ruby
chosen
[ { "from": "system", "value": "Add author and contact for this gem\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'typeahead/rails/version'\n\nGem::Specification.new do |spec|\n spec...
ruby
chosen
[ { "from": "system", "value": "Update Thunderbird Beta to 33.0b1" }, { "from": "human", "value": "class ThunderbirdBeta < Cask\n version '32.0b1'\n sha256 '0f66e9cb452293e248d92c9a156c0b81c50e81ba1107922ab6f8b555934e83d3'\n\n url 'https://download-installer.cdn.mozilla.net/pub/thunderbird/rele...
ruby
chosen
[ { "from": "system", "value": "Fix article category edit redirect.\n" }, { "from": "human", "value": "# Edit categories for articles for homepage. Unrelated to Event Categories.\nclass Admin::ArticleCategoriesController < Admin::AdminController\n layout \"admin/application\"\n before_filter :re...
ruby
chosen
[ { "from": "system", "value": "Reduce content store requests for 2nd level browse\n\nThis reduces the number of content store requests made to render an HTML page\nin second level browse from 3 to 1, and for a json response from 4 to 1.\n\nExample URL: https://www.gov.uk/browse/births-deaths-marriages/death\...
ruby
chosen
[ { "from": "system", "value": "Use Ruby keyword args in OrganisationalManualServiceRegistry\n\nI think that using language features instead of custom code makes this\neasier to understand.\n" }, { "from": "human", "value": "class OrganisationalManualServiceRegistry < AbstractManualServiceRegistry...
ruby
chosen
[ { "from": "system", "value": "Define Pwwka::ErrorHandlers module to make it requirable\n" }, { "from": "human", "value": "require_relative \"error_handlers/chain\"\nrequire_relative \"error_handlers/base_error_handler\"\nrequire_relative \"error_handlers/crash\"\nrequire_relative \"error_handler...
ruby
chosen
[ { "from": "system", "value": "Add option sanitize to link_to_locale\n" }, { "from": "human", "value": "# encoding: UTF-8\nmodule Georgia\n module InternationalizationHelper\n \n LOCALES_HASH = {en: \"English\", fr: \"Français\"}\n\n def locale_name(locale)\n return \"\" unless loc...
ruby
chosen
[ { "from": "system", "value": "Remove unused method (URL doesnt exist in QT)\n\n Was used by CC-CMS a while ago\n" }, { "from": "human", "value": "require 'quick_travel/adapter'\nrequire 'quick_travel/credit_card'\n\nmodule QuickTravel\n class Payment < Adapter\n def payment_type\n Quick...
ruby
chosen
[ { "from": "system", "value": "Add in puts for groupme text\n" }, { "from": "human", "value": "require 'sinatra'\n\nget '/' do\n \"Hello, world\"\nend\n\npost '/' do\n puts request.body\nend\n" }, { "from": "gpt", "value": "require 'sinatra'\n\nget '/' do\n \"Hello, world\"\nend\n\...
ruby
chosen
[ { "from": "system", "value": "Use the :format option to specify the format" }, { "from": "human", "value": "module SignalApi\n class ShortUrl < SignalHttpApi\n attr_reader :short_url, :target_url, :id, :domain\n\n def initialize(id, target_url, short_url, domain)\n @id = id\n @t...
ruby
chosen
[ { "from": "system", "value": "Add common modules and allow view rendering\n" }, { "from": "human", "value": "module SmartApi\n module Controller\n extend ActiveSupport::Concern\n\n include ActionController::ConditionalGet\n include ActionController::Head\n include ActionController::...
ruby
chosen
[ { "from": "system", "value": "Remove bad homepage ref in gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/hideable/version', __FILE__)\n\nGem::Specification.new do |s|\n s.name = 'hideable'\n s.version = Hideable::VERSION\n s.pl...
ruby
chosen
[ { "from": "system", "value": "Set each key value as property and value\n" }, { "from": "human", "value": "require 'intrinsic/version'\nrequire 'intrinsic/intrinsicism'\nrequire 'intrinsic/extrinsicism'\n\nmodule Intrinsic\n def self.included(subject)\n super\n subject.extend Intrinsicism\...
ruby
chosen
[ { "from": "system", "value": "Fix nil logic to exit method\n" }, { "from": "human", "value": "# require \"pig_latin/version\"\n\nmodule PigLatin\n \n def PigLatin.translate(text)\n pig_arr = text.split(\" \")\n pig_trans_arr = []\n if text.nil? then return \"Please enter a stream.\" e...
ruby
chosen
[ { "from": "system", "value": "Use module_function in Transproc module\n" }, { "from": "human", "value": "require 'transproc/version'\nrequire 'transproc/function'\nrequire 'transproc/composer'\n\nmodule Transproc\n def self.register(*args, &block)\n name, fn = *args\n functions[name] = fn...
ruby
chosen
[ { "from": "system", "value": "Replace optimistic locking or legacy taxon with specific patch.\n\nThe patch API for links allows you to specify the specific link set\nto patch. As the legacy_taxon links are new, there's no possibility\nof overwriting previous versions.\n" }, { "from": "human", "v...
ruby
chosen
[ { "from": "system", "value": "Use the service force, Luke!\n" }, { "from": "human", "value": "require 'sidekiq/worker'\nrequire 'multi_json'\n\nmodule Travis\n module Sidekiq\n class BuildRequest\n include ::Sidekiq::Worker\n\n attr_accessor :service, :payload\n\n def perform(...
ruby
chosen
[ { "from": "system", "value": "Use add_runtime_dependency instead of add_dependency\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'rspec/image/version'\n\nGem::Specification.new do |...
ruby
chosen
[ { "from": "system", "value": "Remove the writeable require statement.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n$LOAD_PATH.unshift(__dir__)\n\nrequire 'benchmark'\nrequire 'fileutils'\nrequire 'logger'\nrequire 'tilt'\nrequire 'yaml'\n\nrequire 'dimples/errors'\nrequire...
ruby
chosen
[ { "from": "system", "value": "Configure simple_form to use error class for inputs with error\n" }, { "from": "human", "value": "# Use this setup block to configure all options available in SimpleForm.\nSimpleForm.setup do |config|\n config.wrappers :foundation, class: :input, hint_class: :field...
ruby
chosen
[ { "from": "system", "value": "Clean up generate_handle implementation and attempt to transliterate.\n" }, { "from": "human", "value": "module Handler\n\t\n ##\n # Included hook: extend including class.\n #\n def self.included(base)\n base.extend ClassMethods\n end\n \n \n module Class...
ruby
chosen
[ { "from": "system", "value": "Make yajl-ruby just a development_dependency\n" }, { "from": "human", "value": "lib = File.expand_path('../lib/', __FILE__)\n$:.unshift lib unless $:.include?(lib)\n\nrequire 'rummageable/version'\n\nGem::Specification.new do |s|\n s.name = \"rummageable\"\n s.ver...
ruby
chosen
[ { "from": "system", "value": "Use most recent HTMLUtils for all contents in migration\n\nThe older HTMLUtils versions were proving to be problematic in the way\nthey handled HTML, which is why we iterated on and replaced them, but\nutilizing them here in order to preserve quirks on which annotations\nmight ...
ruby
chosen
[ { "from": "system", "value": "Remove `url` key from Sidekiq configuration\n\nThis way, Sidekiq uses its own conventions to work it out." }, { "from": "human", "value": "Sidekiq.configure_server do |config|\n config.redis = {\n url: ENV['REDIS_PROVIDER'],\n namespace: \"tahi_#{Rails.env}\"...
ruby
chosen
[ { "from": "human", "value": "Add new check for ssh\n" }, { "from": "gpt", "value": "#! /usr/bin/env ruby\n#\n# check-ssh\n#\n# DESCRIPTION:\n# Check the status and version of SSH\n#\n# OUTPUT:\n# plain-text\n#\n# PLATFORMS:\n# all\n#\n# DEPENDENCIES:\n# gem: socket\n# gem: sensu-plugin...
ruby
chosen
[ { "from": "system", "value": "Add Damian's scheduling_email back into api timeslots controller\n" }, { "from": "human", "value": "class Api::TimeslotsController < SecuredController\n def index\n @timeslots = Timeslot.all\n end\n\n def create\n timeslot = Timeslot.new(timeslot_params)\n ...
ruby
chosen
[ { "from": "system", "value": "Update Devise Registrations Update Redirect\n\nUpdate the Devise Registrations controller 'update' action to redirect\nto the User registration edit path on successful update so that the User\nis not redirected away from the current page they are viewing.\n" }, { "from"...
ruby
chosen
[ { "from": "system", "value": "Fix bug with sign_up on registration controller\n" }, { "from": "human", "value": "class RegistrationsController < Devise::RegistrationsController\n before_filter :save_referrer, :only => :edit\n\n def new\n # Building the resource with information that MAY BE...
ruby
chosen
[ { "from": "system", "value": "Use strong parameters. Required for Authlogic.\n" }, { "from": "human", "value": "class UserSessionsController < ApplicationController\n\n def new\n @user_session = UserSession.new\n end\n\n def create\n @user_session = UserSession.new(params[:user_session]...
ruby
chosen
[ { "from": "system", "value": "Fix bug with account page\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Billing\n class AccountDecorator < ApplicationDecorator\n delegate_all\n\n def household_name\n household.decorate.name_with_prefix\n end\n\n def p...
ruby
chosen
[ { "from": "system", "value": "Fix warning: circular require considered harmful\n\nRunning the riemann-tools test suite emit this warning:\nlib/riemann.rb:15: warning: lib/riemann.rb:15: warning: loading in progress, circular require considered harmful - lib/riemann/client.rb\n\nThe README.md says one should...
ruby
chosen
[ { "from": "system", "value": "Add correct paramters so test will pass\n" }, { "from": "human", "value": "$: << File.dirname(__FILE__)\n\nclass Ui\n attr_reader :io\n\n def initialize(io)\n @io = io\n end\n\n def display_intro_msg(game_being_played)\n io.display_intro_msg(game_being_pla...
ruby
chosen
[ { "from": "system", "value": "Correct naming of generated files\n\nIn order to make titles nicer in the summaries a space was added. This wasn't fixed in the file names that needed to be parameterized.\n" }, { "from": "human", "value": "require 'pry'\nrequire 'json'\nrequire 'differ'\nrequire 'l...
ruby
chosen
[ { "from": "system", "value": "Make whenever rake tasks run under govuk_setenv\n\nThis will fix the local_transactions import\n" }, { "from": "human", "value": "# This file is overwritten on deploy\nset :output, {:error => 'log/cron.error.log', :standard => 'log/cron.log'}\njob_type :run_script, ...
ruby
chosen
[ { "from": "system", "value": "Add parslet, rspec, guard-rspec, simplecov and pry gems.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'obtuse/version'\n\nGem::Specification...
ruby
chosen
[ { "from": "system", "value": "Update the gemspec to load version correctly\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"activo-rails/version\"\n\nGem::Specification.new do |s|\n s.name = \"activo-rails\"\n s.vers...
ruby
chosen
[ { "from": "system", "value": "Textexpander3: Add zap, name and update license" }, { "from": "human", "value": "cask :v1 => 'textexpander3' do\n version '3.4.2'\n sha256 '87859d7efcbfe479e7b78686d4d3f9be9983b2c7d68a6122acea10d4efbb1bfa'\n\n url \"http://cdn.smilesoftware.com/TextExpander_#{ver...
ruby
chosen
[ { "from": "system", "value": "Replace odd numbers in the array with 'odd'\n" }, { "from": "human", "value": "class OddEven\n def initialize (user_number)\n @user_number = user_number\n\n end\n\n def makearray\n numbers = 1.upto(@user_number).to_a\n i = 0\n\n while (i < numbers.len...
ruby
chosen
[ { "from": "system", "value": "Make it pass. I'll stop committing tests + code separately now\n" }, { "from": "human", "value": "module TTT\n class Game\n SPACES = %w{a1 a2 a3 b1 b2 b3 c1 c2 c3}\n\n def initialize(dir)\n Dir.mkdir(dir)\n end\n end\nend\n" }, { "from": "gp...
ruby
chosen
[ { "from": "human", "value": "Add a spec for ArraySink.\n" }, { "from": "gpt", "value": "require File.expand_path(File.dirname(__FILE__) + '/spec_helper')\n\ndescribe ArraySink do\n it \"stores rows in #data\" do\n subject << {:a => 1}\n subject.data.should == [{:a => 1}]\n end\nend\n" ...
ruby
chosen
[ { "from": "system", "value": "Use let over instance variable\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe Host do\n describe \".create\" do\n let(:attributes) { double \"attributes\" }\n let(:host) { double \"host\", save: true }\n\n before do\n allow(des...
ruby
chosen
[ { "from": "system", "value": "Create separate `valid?` method for `SubscriptionVerification`\n\nInstead of checking that the `receipt` key is available, use the\n`latest_receipt_info` key.\n" }, { "from": "human", "value": "module CandyCheck\n module AppStore\n # Verifies a latest_receipt_in...
ruby
chosen
[ { "from": "system", "value": "Improve stages index migration code readability\n" }, { "from": "human", "value": "# frozen_string_literal: true\n# rubocop:disable Style/Documentation\n\nmodule Gitlab\n module BackgroundMigration\n class MigrateStageIndex\n module Migratable\n clas...
ruby
chosen
[ { "from": "system", "value": "Fix formatting issue in list command\n" }, { "from": "human", "value": "require 'map'\nrequire 'ruyml'\n\nmodule Arc42Pandoc\n class MarkdownBuilder\n\n def initialize\n\n end\n\n def create(output, options = {})\n options = sanatize_options(options)\...
ruby
chosen
[ { "from": "system", "value": "Include the ssl certificate in the output" }, { "from": "human", "value": "module DNSimple\n module Commands\n class DescribeCertificate\n def execute(args, options={})\n domain_name = args.shift\n certificate_id = args.shift\n domain =...
ruby
chosen
[ { "from": "system", "value": "Add missing include block in FundingFundingSource extension\n" }, { "from": "human", "value": "module FundingFundingSource\n extend ActiveSupport::Concern\n\n has_many :funding_templates, :dependent => :destroy\n has_many :funding_buckets, :through => :fund...
ruby
chosen
[ { "from": "system", "value": "Fix tests on Ruby 2.0\n" }, { "from": "human", "value": "require 'dimensions'\nrequire 'test/unit'\n\nmodule Dimensions\n FIXTURE_ROOT = File.expand_path('../../fixtures', __FILE__)\n\n class TestCase < Test::Unit::TestCase\n undef_method(:default_test) if meth...
ruby
chosen
[ { "from": "system", "value": "Add GitHub as homepage in gemspec\n" }, { "from": "human", "value": "Gem::Specification.new do |spec|\n spec.name = 'prefnerd'\n spec.version = '0.2'\n spec.authors = ['Greg Hurrell']\n spec.email = ['greg@hurrell.net']\n spec.summa...
ruby
chosen
[ { "from": "system", "value": "Fix IO.sysopen specs to clean afther themselves and make them pass on Windows\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + '/../../spec_helper'\n\ndescribe \"IO.sysopen\" do\n\n before :all do\n @filename = tmp(\"rubinius-spec-io-sysopen-#...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.1.10 to 0.1.11\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'telemetry-logger'\n s.version = '0.1.10'\n s.summary = 'Logging to STDERR with coloring and levels of severi...
ruby
chosen
[ { "from": "system", "value": "Remove phone relation from benchmark\n" }, { "from": "human", "value": "class Person\n include Mongoid::Document\n\n field :birth_date, :type => Date\n field :title, :type => String\n\n embeds_one :name, :validate => false\n embeds_many :addresses, :validate =>...
ruby
chosen
[ { "from": "system", "value": "Use nil for empty end_action in spec\n" }, { "from": "human", "value": "require_relative 'spec_helper'\n\nRSpec.describe Launchboard::Action do\n let(:receiver) do\n double('Launchboard::Receiver', :do => 'nothing')\n end\n let(:start_action) { 'music' }\n le...
ruby
chosen