conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Update for ruby 3 compatibility\n\nSplit out kwargs per https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/#delegation-ruby-3 for ruby 3\n" }, { "from": "human", "value": "require \"rspec/default_http_header/versi...
ruby
chosen
[ { "from": "system", "value": "Use non overloaded static method info to perform logging as this approach does not cause problems with method resolution under jruby\n" }, { "from": "human", "value": "module SSRS\n AUTO_UPLOAD_PATH='/Auto'\n PREFIX_KEY='prefix'\n WSDL_KEY='wsdl_path'\n\n @@repo...
ruby
chosen
[ { "from": "system", "value": "Raise exceptions on missing translations\n" }, { "from": "human", "value": "module Stationed\n module Generators\n module Plugins\n module I18nSpec\n def self.prepended(base)\n base.class_option :i18n_spec,\n type: :boolean,\n ...
ruby
chosen
[ { "from": "system", "value": "Improve description. Drop pry from deps.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'closeable_queue/version'\n\nGem::Specification.new do |spec|\n...
ruby
chosen
[ { "from": "system", "value": "Move visit method to before block\n" }, { "from": "human", "value": "describe BlobsController do\n render_views\n let(:repository) { Factory.create(:repo_with_data) }\n \n # Test dependent on the fact that the default repo_with_data contains a Gemfile\n describ...
ruby
chosen
[ { "from": "human", "value": "Add booking value report spec\n" }, { "from": "gpt", "value": "require_relative \"../../lib/chargify/booking_value_report\"\n\ndescribe Reports::BookingValueReport do\n\n let(:transactions) do\n [\n double(\"Transaction\", type: 'Payment', product_id: \"456\...
ruby
chosen
[ { "from": "system", "value": "Fix Rails 6.0 deprecation warning\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe HomeController do\n describe \"GET 'index'\" do\n it 'returns http success' do\n get 'index'\n expect(response).to be_success\n end\n end\nend\n...
ruby
chosen
[ { "from": "system", "value": "Rewrite the course settings specification to use the new user story style.\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe 'Course: Administration: Administration', type: :feature do\n subject { page }\n\n let(:instance) { create(:insta...
ruby
chosen
[ { "from": "system", "value": "Add missing utf-8 encoding comment" }, { "from": "human", "value": "shared_examples_for 'all invocations' do\n it { should eql(response) }\n\n it 'indicates success via #success?' do\n expect(subject.success?).to be(success_status)\n end\n\n it 'provides the ...
ruby
chosen
[ { "from": "human", "value": "Add unit test for new Service class methods\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\nRSpec.describe Service do\n let!(:student) { FactoryGirl.create(:student) }\n let!(:educator) { FactoryGirl.create(:educator) }\n\n let!(:active_service) { Facto...
ruby
chosen
[ { "from": "system", "value": "Update Spira.add_repository to optionally allow sending an instantiated\nrepository instead of the options to create one\n" }, { "from": "human", "value": "require 'rdf'\n\nmodule Spira\n\n Thread.current[:spira] = {} \n Thread.current[:spira][:repositories] = {}\...
ruby
chosen
[ { "from": "system", "value": "Clone params for user auth to work around immutability\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n# this is tested in spec/controllers/v1/concerns/\nmodule UserAuth\n extend ActiveSupport::Concern\n\n included do |base|\n params = base....
ruby
chosen
[ { "from": "system", "value": "Remove deprecated has_key method. Replace for key?\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n # Prevent CSRF attacks by raising an exception.\n # For APIs, you may want to use :null_session instead.\n protect_from_fo...
ruby
chosen
[ { "from": "system", "value": "Add log to errar handle.\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n rescue_from StandardError do |e|\n @message = e.message\n case e\n when ImageableNotFound\n render :template => 'error/not_found.html.er...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary comment about current_user, now that we have it\nintegrated and working\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n # Prevent CSRF attacks by raising an exception.\n # For APIs, you may want to use :...
ruby
chosen
[ { "from": "system", "value": "Fix directory controller in glitch-soc\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass DirectoriesController < ApplicationController\n layout 'public'\n\n before_action :set_instance_presenter\n before_action :set_tag, only: :show\n bef...
ruby
chosen
[ { "from": "system", "value": "Update Grape dependency to avoid security vulnerabilities.\n" }, { "from": "human", "value": "# coding: utf-8\nGem::Specification.new do |spec|\n spec.name = 'like'\n spec.version = '0.2.1'\n spec.authors = ['Pat Allan']\n spec.email ...
ruby
chosen
[ { "from": "system", "value": "Use `_url` in tests instead of `_path`\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire \"test_helper\"\n\n# Test to make sure blog is publicly accessible.\nclass BlogControllerTest < ActionDispatch::IntegrationTest\n test \"should get bl...
ruby
chosen
[ { "from": "system", "value": "Add 'false' argument to report_build_html_table to unset `word-break`\n\nImprove VM Chargeback Preview Report table formatting by adding` false` value as an\noptional argument of `report_build_html_table` to unset `word-break` css attribute.\n" }, { "from": "human", ...
ruby
chosen
[ { "from": "system", "value": "Add deprecation warning when using the Runit init system\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "# include helper methods\nclass ::Chef::Recipe\n include ::Opscode::ChefClient::Helpers\nend\n...
ruby
chosen
[ { "from": "human", "value": "Add unique index on fingerprint field\n" }, { "from": "gpt", "value": "class AddUniqueIndexToFingerprint < ActiveRecord::Migration\n\n def self.up\n add_index :gitolite_public_keys, :fingerprint, unique: true\n end\n\n def self.down\n remove_index :gitolite_...
ruby
chosen
[ { "from": "system", "value": "Replace header with meta hash\n" }, { "from": "human", "value": "require \"grape/kaminari/version\"\nrequire \"grape/kaminari/max_value_validator\"\nrequire \"kaminari/grape\"\n\nmodule Grape\n module Kaminari\n def self.included(base)\n base.class_eval do\...
ruby
chosen
[ { "from": "system", "value": "Optimize Symbol to_msgpack_ext and from_msgpack_ext\n\n```ruby\nrequire 'benchmark/ips'\nrequire 'msgpack'\n\nsymbol = :foo\n\noriginal_factory = MessagePack::Factory.new\noriginal_factory.register_type(0x00, Symbol)\noriginal_payload = original_factory.dump(symbol)\n\noptimise...
ruby
chosen
[ { "from": "system", "value": "Revert \"Drop rake task for processing jobs.\"\n\nThis reverts commit 60057b02a6aa1672a622fb8f29fb8875b14f772f.\n" }, { "from": "human", "value": "namespace :que do\n desc \"Migrate Que's job table to the most recent version (creating it if it doesn't exist)\"\n t...
ruby
chosen
[ { "from": "system", "value": "Fix issue with sidekiq web\n\nhttps://github.com/mperham/sidekiq/wiki/Using-Redis#disabled-client-command\n" }, { "from": "human", "value": "module RedisResolver\n module_function\n\n def get_redis_config\n redis_url = begin\n # TODO: !Important\n # n...
ruby
chosen
[ { "from": "system", "value": "Address can be saved without owner.\n" }, { "from": "human", "value": "require File.join(File.dirname(__FILE__), '..', 'test_case')\nrequire 'caruby/util/uniquifier'\n\nclass AddressTest < Test::Unit::TestCase\n include CaTissue::TestCase\n\n def setup\n super\...
ruby
chosen
[ { "from": "system", "value": "Convert .search block call to more common yield idiom.\n" }, { "from": "human", "value": "module SearchWrapper\n def self.included(klass)\n klass.extend ClassMethods\n\n class << klass\n # provide a class-level attribute accessor for holding on to Ultras...
ruby
chosen
[ { "from": "system", "value": "Enable JavaParser by default on JRuby" }, { "from": "human", "value": "require \"stompede/stomp/error\"\nrequire \"stompede/stomp/message\"\nrequire \"stompede/stomp/ruby_parser\"\n\ncase RUBY_ENGINE\nwhen \"ruby\", \"rbx\"\n require \"stompede/stomp/c_parser\"\nwh...
ruby
chosen
[ { "from": "system", "value": "Use Rails TaggedLogging when available\n" }, { "from": "human", "value": "require \"tracer_bullets/version\"\n\nmodule TracerBullets\n\n module Methods\n def tracer_bullet\n if Rails.env.development?\n Rails.logger.debug( \"Elapsed: #{((Time.now - @t...
ruby
chosen
[ { "from": "system", "value": "Add test files to gemspec.\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\nrequire 'innertube/version'\n\nGem::Specification.new do |gem|\n gem.name = 'innertube'\n gem.version = Innertube::VERSION\n gem.summary = \"A thread-saf...
ruby
chosen
[ { "from": "human", "value": "Add spec test for encode_datastore_url\n" }, { "from": "gpt", "value": "require 'VMwareWebService/MiqVim'\n\ndescribe MiqVimDataStore do\n context \"#encode_datastore_url\" do\n before do\n @invObj = double\n allow(@invObj).to receive(:server).and_retur...
ruby
chosen
[ { "from": "system", "value": "Remove threading extension DSL from Xommelier::Atom, use Xommelier::Atom::Thread module instead\n" }, { "from": "human", "value": "require 'xommelier/xml'\n\nmodule Xommelier\n module Atom\n include Xommelier::Xml\n\n xmlns 'http://www.w3.org/2005/Atom', as: ...
ruby
chosen
[ { "from": "system", "value": "Refactor to canonical CLI construction\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nRSpec.shared_examples_for 'framework integration' do\n def system_with_gemfile(*command)\n Kernel.system({ 'BUNDLE_GEMFILE' => gemfile }, *command)\n end\...
ruby
chosen
[ { "from": "system", "value": "Use chef conditionals for tzdata package selection\n" }, { "from": "human", "value": "#\n# Cookbook Name:: timezone\n# Recipe:: default\n#\n# Copyright 2010, James Harton <james@sociable.co.nz>\n#\n# Apache 2.0 License.\n#\n\n\ncase node.platform\nwhen ['debian','ub...
ruby
chosen
[ { "from": "system", "value": "Add mocha as a dependency\n" }, { "from": "human", "value": "# encoding: utf-8\nrequire File.expand_path('../lib/route_translator/version', __FILE__)\n\nGem::Specification.new do |s|\n s.name = \"route_translator\"\n s.version = RouteTranslator::VERSION\n\n s.aut...
ruby
chosen
[ { "from": "system", "value": "Disable statement cache when adding shard conditions automatically\n" }, { "from": "human", "value": "require \"active_record/associations\"\n\nmodule ActiveRecord::Turntable\n module ActiveRecordExt\n module Association\n include ShardingCondition\n\n ...
ruby
chosen
[ { "from": "system", "value": "Correct order of google chrome APT repo components\n" }, { "from": "human", "value": "# Cookbook Name:: google-chrome\n# Recipe:: default\n# Copyright 2011-2015, Travis CI Development Team <contact@travis-ci.org>\n#\n# Permission is hereby granted, free of charge, t...
ruby
chosen
[ { "from": "system", "value": "Rename resource `php_pecl` => `travis_php_pecl`\n" }, { "from": "human", "value": "include_recipe 'travis_phpenv'\ninclude_recipe 'travis_phpbuild'\n\nnode['travis_php']['multi']['extensions'].each do |php_extension, options|\n php_pecl php_extension do\n channe...
ruby
chosen
[ { "from": "system", "value": "Update MacTex to 2014 release\n" }, { "from": "human", "value": "class Mactex < Cask\n url 'http://mirror.ctan.org/systems/mac/mactex/MacTeX.pkg'\n homepage 'http://www.tug.org/mactex/'\n version 'latest'\n sha256 :no_check\n install 'MacTeX.pkg'\n uninstall :...
ruby
chosen
[ { "from": "system", "value": "Fix actor check for potential users\n" }, { "from": "human", "value": "class Activity < ActiveRecord::Base\n belongs_to :actor, polymorphic: true\n belongs_to :subject, polymorphic: true\n belongs_to :target, polymorphic: true\n\n belongs_to :story\n\n has_m...
ruby
chosen
[ { "from": "system", "value": "Remove conditional conde for an impossible scenario\n\n- Person#from_token will always return a person\nobject." }, { "from": "human", "value": "class TokensController < ApplicationController\n skip_before_action :ensure_user\n before_action :set_desired_path, onl...
ruby
chosen
[ { "from": "system", "value": "Use implicit email in Notifications\n\nAs this is mixed into the Person class, email is available. (And, in\nfact, this is not appropriate as a Concern, but that will be addressed\nin due course.)\n" }, { "from": "human", "value": "module Concerns::Notifications\n ...
ruby
chosen
[ { "from": "system", "value": "Use range offsets instead of quote for substitution\n" }, { "from": "human", "value": "class Legislation::Annotation < ActiveRecord::Base\n COMMENTS_PAGE_SIZE = 5\n acts_as_paranoid column: :hidden_at\n include ActsAsParanoidAliases\n\n serialize :ranges, Array\...
ruby
chosen
[ { "from": "system", "value": "Fix deprecated Apartment::Database to Apartment::Tenant.\n" }, { "from": "human", "value": "# encoding: utf-8\n\nclass AttachmentUploader < CarrierWave::Uploader::Base\n # Choose what kind of storage to use for this uploader:\n storage :file\n\n # Override the di...
ruby
chosen
[ { "from": "system", "value": "Fix reversed logic in auth\n" }, { "from": "human", "value": "class ExercismApp < Sinatra::Base\n\n get '/' do\n if current_user.guest?\n erb :index\n else\n pending = Submission.pending.select do |submission|\n current_user.may_nitpick?(subm...
ruby
chosen
[ { "from": "system", "value": "Reduce connection pool size to 2\n" }, { "from": "human", "value": "module Relax\n class Base\n def self.redis\n if uri = ENV['REDISTOGO_URL']\n redis_uri = URI.parse(uri)\n elsif uri = ENV['REDIS_URL']\n redis_uri = URI.parse(uri)\n ...
ruby
chosen
[ { "from": "system", "value": "Add .pre for next release\n" }, { "from": "human", "value": "module EY\n require 'engineyard/ruby_ext'\n\n VERSION = \"0.5.1\"\n\n autoload :API, 'engineyard/api'\n autoload :Collection, 'engineyard/collection'\n autoload :Config, 'engineyard/config'...
ruby
chosen
[ { "from": "system", "value": "Add koi asset manifest to precompiled assets automatically\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire_relative \"middleware/url_redirect\"\n\nmodule Koi\n class Engine < ::Rails::Engine\n isolate_namespace Koi\n\n initializer ...
ruby
chosen
[ { "from": "system", "value": "Rename input file option for symmetry\n" }, { "from": "human", "value": "# encoding: utf-8\nrequire 'yaml'\nrequire 'langulator/loader'\nrequire 'langulator/munger'\nrequire 'langulator/aggregate'\n\nmodule Langulator\n class << self\n def munge(options = {})\n ...
ruby
chosen
[ { "from": "system", "value": "Remove 64-bit support from simulator builds, because the vendored libtesseract_all.a does not contain a x86_64 slice.\n" }, { "from": "human", "value": "unless defined?(Motion::Project::Config)\n raise \"The motion-ocr gem must be required within a RubyMotion proje...
ruby
chosen
[ { "from": "system", "value": "Change the name of method detecting the artist in title\n" }, { "from": "human", "value": "module Nehm\n class Track\n attr_reader :hash\n\n def initialize(hash)\n @hash = hash\n end\n\n def artist\n if @hash['title'].index(' - ')\n @ha...
ruby
chosen
[ { "from": "system", "value": "Fix `url` stanza comment for USB driver for Gigabit Ethernet Adapter D-3023.\n" }, { "from": "human", "value": "cask 'dn-3023-driver' do\n version '20140926'\n sha256 'baa5d20f17cd322b2c53e0bd82c444d1648eefabd5ec383d15f9a16f99810b10'\n\n url \"http://ftp.assmann....
ruby
chosen
[ { "from": "system", "value": "Fix `url` stanza comment for Ember.\n" }, { "from": "human", "value": "cask 'ember' do\n version '1.8.3'\n sha256 'cbd61a207b87a4668907b187198c62bc0b89dfdc31896cb5cbefcf95e2e8f1d1'\n\n url \"http://downloads.realmacmedia.com/ember/ember-#{version.no_dots}.zip\"\n...
ruby
chosen
[ { "from": "system", "value": "Upgrade Hydra to 1.0 beta 8.\n\nNew upstream release.\n" }, { "from": "human", "value": "class Hydra < Cask\n version '1.0 beta 7'\n sha256 '4cc3a9094125fbc94fc86b67b62f5d59ce0bb28937765f74a1813ac8554f0aba'\n\n url 'https://github.com/sdegutis/hydra/releases/down...
ruby
chosen
[ { "from": "system", "value": "Update Minco app to latest version: 2.0.23\n\n2.0.22 has expired and no longer works\n" }, { "from": "human", "value": "cask :v1 => 'minco' do\n version '2.0.22'\n sha256 'bf98d80e0273552559ae7b98ba411d62ccdca66ddd9f2f274bd2aa2cdcd44c58'\n\n # webpack.com is the ...
ruby
chosen
[ { "from": "system", "value": "Fix Github URL in gemspec.\n" }, { "from": "human", "value": "\nGem::Specification.new do |s|\n s.name = 'rabbitmq'\n s.version = '1.1.0'\n s.date = '2015-07-18'\n s.summary = \"rabbitmq\"\n s.description = \"A Ruby RabbitMQ clie...
ruby
chosen
[ { "from": "system", "value": "Use Time object in test\n" }, { "from": "human", "value": "# Copyright 2018 Google, Inc\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the Licens...
ruby
chosen
[ { "from": "system", "value": "Fix expected formula version in specs\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'emacs' do\n let(:version) { '24.3-boxen3' }\n let(:install_options) { [ '--cocoa' ] }\n let(:facts) { { :boxen_home => '/opt/boxen' } }\n\n it do\n sho...
ruby
chosen
[ { "from": "system", "value": "Validate presence of url again\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Source do\n it { is_expected.to belong_to(:team) }\n #it { is_expected.to validate_presence_of(:url) }\nend\n" }, { "from": "gpt", "value": "require 'sp...
ruby
chosen
[ { "from": "system", "value": "Change OS version for warmup spec\n" }, { "from": "human", "value": "require 'spec_helper'\n\nRSpec.describe SimCtl do\n describe '#warmup' do\n if SimCtl.device_set_path.nil?\n it 'warms up and returns a device for given strings' do\n expect(SimCtl....
ruby
chosen
[ { "from": "system", "value": "Fix type in the word California in solution file that was causing code not to pass rspec\n" }, { "from": "human", "value": "# Simple Substrings\n\n# I worked on this challenge by myself.\n\n\n# Your Solution Below\n\ndef welcome(address)\n if address.include?('CA')...
ruby
chosen
[ { "from": "system", "value": "Make sure podspec requires arc\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'ZWEmoji'\n s.version = '0.3.0'\n s.license = 'MIT'\n s.summary = 'Objective-C library for using unicode emoji based on emoji codes used in Campfire/GitHub'\...
ruby
chosen
[ { "from": "system", "value": "Add api_key argument and description to CLI\n" }, { "from": "human", "value": "require 'optparse'\n\nmodule Filepreviews\n # @author Jonah Ruiz <jonah@pixelhipsters.com>\n # A Simple class for the executable version of the gem\n class CLI\n BANNER = <<MSG\nUsa...
ruby
chosen
[ { "from": "system", "value": "Set content type to text to avoid rending HTML\n" }, { "from": "human", "value": "require \"sinatra\"\nrequire \"sqlite3\"\n\nset(:startup_hook) do\n database_file = \"#{environment}.db\"\n first_run = !File.exist?(database_file)\n set(:db, SQLite3::Database.new(...
ruby
chosen
[ { "from": "system", "value": "Change search implementation, in case an hash arrives it means that is looking for an specific repository\n" }, { "from": "human", "value": "module TicketMaster::Provider\n module Github\n # Project class for ticketmaster-github\n #\n #\n class Project ...
ruby
chosen
[ { "from": "system", "value": "Use file size as header's Content-Length\n" }, { "from": "human", "value": "require 'rack'\n\nclass Rack::Maintenance\n\n attr_reader :app, :options\n\n def initialize(app, options={})\n @app = app\n @options = options\n\n raise(ArgumentError, 'Must s...
ruby
chosen
[ { "from": "system", "value": "Remove the Authpds controller mixin from the ApplicationController; And add insitutions helper from nyulibraires-assets\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n protect_from_forgery\n include Authpds::Controllers::A...
ruby
chosen
[ { "from": "system", "value": "Use the header footer only template\n\nThis will mean that we don't have to get all the other styles and assets\nthat static contains. We currently have manual code in to overwite most of it\nanyway.\n" }, { "from": "human", "value": "require \"slimmer/headers\"\n\n...
ruby
chosen
[ { "from": "system", "value": "Use tags assocation in DuplicateElement\n\n`tag_list` generates a query for each element, even if they're already\nloaded.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Alchemy\n class DuplicateElement\n SKIPPED_ATTRIBUTES_ON_COPY = ...
ruby
chosen
[ { "from": "system", "value": "Use same logic with indexer\n\nUse unescaped text for snippet\n" }, { "from": "human", "value": "module PostDecorator\n def short_text_body\n truncate(plain_text_body, length: 140)\n end\n\n def to_meta_description\n short_text_body\n end\n\n def to_og_pa...
ruby
chosen
[ { "from": "system", "value": "Fix spec to verify user cannot vote twice\n" }, { "from": "human", "value": "require \"rails_helper\"\n\ndescribe \"Vote creating\" do\n before do\n # Sign in\n @user = create_and_sign_in_user\n @post = FactoryGirl.create(:post)\n\n # Go to account page...
ruby
chosen
[ { "from": "system", "value": "Update to latest rspec-support requires." }, { "from": "human", "value": "require 'rspec/support/spec/library_wide_checks'\n\nRSpec.describe \"RSpec::Expectations\" do\n it_behaves_like \"library wide checks\", \"rspec-expectations\",\n :preamble_for_lib => [\n ...
ruby
chosen
[ { "from": "system", "value": "Add dummy Braintree credentials in test env\n" }, { "from": "human", "value": "module SolidusPaypalBraintree::GatewayHelpers\n def new_gateway(opts = {})\n SolidusPaypalBraintree::Gateway.new({\n name: \"Braintree\",\n preferences: {\n environme...
ruby
chosen
[ { "from": "system", "value": "Add test to check that progress.fraction= doesn't set selection when real is disposed\n" }, { "from": "human", "value": "require 'swt_shoes/spec_helper'\n\ndescribe Shoes::Swt::Progress do\n let(:text) { \"TEXT\" }\n let(:dsl) { double('dsl').as_null_object }\n l...
ruby
chosen
[ { "from": "system", "value": "Revert \"temporarily disable having multiple reservations at the same time, because everyone is a donator now\"\n\nThis reverts commit 6feb3c977ff8bcde688d29b8af2dc9d74753dbed.\n" }, { "from": "human", "value": "module ReservationValidations\n def self.included(mod...
ruby
chosen
[ { "from": "system", "value": "Change syntax to prevent rufo from dying\n" }, { "from": "human", "value": "require 'sfn'\n\nmodule Sfn\n module Utils\n # Helper for scrubbing stack parameters\n module StackParameterScrubber\n\n # Validate attributes within Parameter blocks\n ALLO...
ruby
chosen
[ { "from": "system", "value": "Use single quotes instead of double quotes\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe \"<%= ns_table_name %>/show\", <%= type_metatag(:view) %> do\n <%= model.factory_girl_let_definitions %>\n before(:each) do\n @<%= ns_file_nam...
ruby
chosen
[ { "from": "system", "value": "Add food equivalents to search results\n" }, { "from": "human", "value": "class ActivitiesController < ApplicationController\n include ApplicationHelper\n respond_to :json\n\n def index\n # response = Mets::Calculate()\n end\n\n def search\n item = Item.a...
ruby
chosen
[ { "from": "system", "value": "Switch status controller to query postgres directly again\n" }, { "from": "human", "value": "class Api::StatusController < Api::ApplicationController\n before_action :require_api_key\n\n def check\n if params[:projects].any?\n @projects = params[:projects]...
ruby
chosen
[ { "from": "system", "value": "Move local variable to only branch where it's used\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire \"shellwords\"\n\nmodule Bundler\n class CLI::Open\n attr_reader :options, :name\n def initialize(options, name)\n @options = o...
ruby
chosen
[ { "from": "system", "value": "Fix Plain and Garageband in the script\n\n--HG--\nbranch : Future-2.1\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n# -*- encoding: utf-8 -*-\n\n# TestAllVisualDisplays.rb\n# \n#\n# Created by Daniel Siemer on 10/31/12.\n#\n\ndef main\n\tbaseURL = \"gro...
ruby
chosen
[ { "from": "system", "value": "Add assets folder to sprockets assets path\n" }, { "from": "human", "value": "require \"materialize-sass/version\"\n\nmodule Materialize\n module Sass\n class Engine < ::Rails::Engine\n end\n end\nend\n" }, { "from": "gpt", "value": "require \"ma...
ruby
chosen
[ { "from": "system", "value": "Change type of value to text\n" }, { "from": "human", "value": "class CreateVentanaEditableContents < ActiveRecord::Migration\n def change\n create_table :ventana_editable_contents do |t|\n t.string :key\n t.string :value\n t.string :content_type\...
ruby
chosen
[ { "from": "system", "value": "Fix IterativeProcess early exit (nil transformation).\n" }, { "from": "human", "value": "module Furnace\n module Transform\n class IterativeProcess\n def initialize(stages)\n @stages = stages\n end\n\n def transform(*sequence)\n loop...
ruby
chosen
[ { "from": "human", "value": "Add task to index smart answers.\n" }, { "from": "gpt", "value": "namespace :rummager do\n desc \"Reindex search engine\"\n task :index => :environment do\n documents = SmartAnswer::FlowRegistry.new.flows.map { |flow|\n presenter = TextPresenter.new(flow)\n...
ruby
chosen
[ { "from": "system", "value": "Set generator ORM to ActiveRecord.\n" }, { "from": "human", "value": "module Voluntary\n class Engine < ::Rails::Engine\n config.autoload_paths << File.expand_path(\"../../../app/models/concerns\", __FILE__)\n config.autoload_paths << File.expand_path(\"../.....
ruby
chosen
[ { "from": "system", "value": "Update factory_bot dependency to ~> 5.1.0" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"factory_bot_rails\"\n s.version = \"5.0.2\"\n s.authors = [\"Joe Ferris\"]\n s.email = \"jferris@thoughtbot.com\"\n s.home...
ruby
chosen
[ { "from": "system", "value": "Use deploy:create_symlink hook instead of deprecated.\n" }, { "from": "human", "value": "namespace :releaser do\n desc \"Write current revision to CURRENT_VERSION file.\"\n task :write_current do\n version = self[:current_revision]\n run \"echo \\\"#{version...
ruby
chosen
[ { "from": "system", "value": "Add node name to tested primitive\n\nAs primitive name changed, test changed accordingly.\n\nChange-Id: I5aad18f91f2e4da9d3f6bdc9dcf6aa1d247a660b\nCloses-Bug: #1523956\n" }, { "from": "human", "value": "require File.join File.dirname(__FILE__), '../test_common.rb'\n...
ruby
chosen
[ { "from": "system", "value": "Make request_store runtime instead of development 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 'thread/inheritable_attributes/version'\n\n...
ruby
chosen
[ { "from": "system", "value": "Use secure compare for signature verification\n" }, { "from": "human", "value": "module Ahoy\n class MessagesController < ActionController::Base\n before_filter :set_message\n\n def open\n if @message and !@message.opened_at\n @message.opened_at =...
ruby
chosen
[ { "from": "system", "value": "Add app to gemspec's files\n\nImages were moved to the app directory for Rails 4, but they weren't added to the packaged gem.\r\n\r\nShould also fix #20" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/fancybox2/rails/vers...
ruby
chosen
[ { "from": "system", "value": "Revert \"reverted conversations controller to bao's version\"\n\nThis reverts commit 61993eee16cdc102b0fd875ea81c2b2dd0506fce.\n" }, { "from": "human", "value": "class ConversationsController < ApplicationController\n def index\n if current_user\n @conversa...
ruby
chosen
[ { "from": "system", "value": "Add extra search params in search block\n" }, { "from": "human", "value": "module Kennedy\n class PostsController < Kennedy::ApplicationController\n\n include Georgia::Concerns::Pageable\n include Georgia::Concerns::Publishable\n\n load_and_authorize_resou...
ruby
chosen
[ { "from": "system", "value": "Change fetch method to return both artefact and publication" }, { "from": "human", "value": "class TravelAdviceController < ApplicationController\n\n before_filter :set_expiry\n\n def country\n @country = params[:slug].dup\n @publication = fetch_artefact_for...
ruby
chosen
[ { "from": "system", "value": "Add class comment to unlock controller class\n" }, { "from": "human", "value": "class Users::UnlocksController < Devise::UnlocksController\n # GET /resource/unlock/new\n # def new\n # super\n # end\n\n # POST /resource/unlock\n # def create\n # super\n #...
ruby
chosen
[ { "from": "system", "value": "Set a longer timeout for aruba" }, { "from": "human", "value": "require 'cucumber'\nrequire 'rspec'\nrequire 'aruba/cucumber'\n\nBefore do\n @aruba_timeout_seconds = 10\nend\n" }, { "from": "gpt", "value": "require 'cucumber'\nrequire 'rspec'\nrequire '...
ruby
chosen
[ { "from": "system", "value": "Add require relations building to update rake task" }, { "from": "human", "value": "class UpdateJob < JuliaJob\n queue_as :default\n\n def perform(*args)\n\n Batch.current_marker += 1\n set_batch_marker :current, Batch.current_marker\n\n system \"#{@sys_r...
ruby
chosen
[ { "from": "system", "value": "Adjust matches to Ruby gems that are currently indexed\n" }, { "from": "human", "value": "require \"rubygems/text\"\n\nclass GemTypo\n attr_reader :protected_gem\n\n def initialize(rubygem_name)\n @rubygem_name = rubygem_name\n end\n\n def protected_typo?\n ...
ruby
chosen
[ { "from": "system", "value": "Add new factory to create user with many images\n" }, { "from": "human", "value": "include ActionDispatch::TestProcess\n\nFactoryGirl.define do\n sequence :email do |n|\n \"user#{ n }@gmail.com\"\n end\n\n sequence :username do |n|\n \"test_user#{ n }\"\n ...
ruby
chosen