conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Update IntelliJ Idea CE to v15.0.2\n" }, { "from": "human", "value": "cask :v1 => 'intellij-idea-ce' do\n version '15.0.1'\n sha256 '70715153d78808493bd6f3da839b2f6872e4f94c423ca1f0d9fc848503a7e3ff'\n\n url \"https://download.jetbrains.com/idea/ideaIC-#{version}-...
ruby
chosen
[ { "from": "system", "value": "Fix falsy test in pip requirements hook\n" }, { "from": "human", "value": "DEBUG = false\n\n# Get the commits before the merge\n# ex. heads = [\"<latest commit of master>\", \"<previous commit of master>\", ...]\nheads = `git reflog -n 2 | awk '{ print $1 }'`.spli...
ruby
chosen
[ { "from": "system", "value": "Update the sha256 of 6.18.0\n\n[fixes #119335073]\n" }, { "from": "human", "value": "require 'formula'\n\nclass CfCli < Formula\n homepage 'https://github.com/cloudfoundry/cli'\n head 'https://cli.run.pivotal.io/edge?arch=macosx64&source=homebrew'\n url 'https://...
ruby
chosen
[ { "from": "system", "value": "Fix wrong association class bug in User PromotionRule\n\nWe have a custom User class in our app. It is unsurprisingly called \"User\".\nThe `Spree::Promotion::Rules::User` class has an association to `:users` set,\nwhere the class name is bound to be `::Spree.user_class`. In ou...
ruby
chosen
[ { "from": "system", "value": "Change spec to use a stronger matcher\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'spec_helper'\n\ndescribe Tuple, '.coerce' do\n subject { object.coerce(header, argument) }\n\n let(:header) { Relation::Header.new([ [ :id, Integer ] ]) }\n let...
ruby
chosen
[ { "from": "human", "value": "Make project_id nullable in database fpr transactions\n" }, { "from": "gpt", "value": "class AllowNullForProjectIdOnTransactions < ActiveRecord::Migration\n def up\n change_column_null(:giro_checkout_transactions, :project_id, true)\n end\n\n def down\n chan...
ruby
chosen
[ { "from": "system", "value": "Fix RuboCop for removing index\n" }, { "from": "human", "value": "# See http://doc.gitlab.com/ce/development/migration_style_guide.html\n# for more information on how to write migrations for GitLab.\n\nclass RemoveIndexForUsersCurrentSignInAt < ActiveRecord::Migrati...
ruby
chosen
[ { "from": "human", "value": "Add formula for GQview, a gtk-based image browser.\n\nSigned-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>\n" }, { "from": "gpt", "value": "require 'formula'\n\nclass Gqview <Formula\n url 'http://downloads.sourceforge.net/project/gqvi...
ruby
chosen
[ { "from": "system", "value": "Add active record queries to retrieve drops within radius\n" }, { "from": "human", "value": "class Api::DropsController < ApplicationController\n respond_to :json\n\n def index\n if params[:longitude] && params[:latitude]\n #give back drops within radius 1...
ruby
chosen
[ { "from": "system", "value": "Allow MYC to use scenarios from any region\n\nRef #3081\n" }, { "from": "human", "value": "# frozen_string_literal: true\nmodule MultiYearChartsHelper\n # Public: The full URL to the Multi-Year Charts application for an instance of\n # MultiYearCharts.\n #\n # R...
ruby
chosen
[ { "from": "system", "value": "Fix object id message on log\n" }, { "from": "human", "value": "module AfterDo\n module Logging\n class Aspect\n def initialize(target_class, logger = AfterDo::Logging.logger)\n @target_class = target_class\n @logger = logger\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Add updated_at field to service representer\n" }, { "from": "human", "value": "require 'roar/representer/json'\nrequire 'roar/representer/feature/hypermedia'\n\nmodule ServiceRepresenter\n include Roar::Representer::JSON\n include Roar::Representer::Feature::Hyper...
ruby
chosen
[ { "from": "system", "value": "Add a reassign route in the Group Controller.\n\nThis route gives the user the ability to re-set their group to a nil\nstatus. The user will then be redirected to a form in which they can\ninput their new neighborhood.\n" }, { "from": "human", "value": "class Groups...
ruby
chosen
[ { "from": "human", "value": "Add methods to create, update, and view summary of issues pertaining to a congressional office.\n" }, { "from": "gpt", "value": "class IssuesController < ApplicationController\n\n def index\n @issues_report = Issue.aggregate_issues\n @unresolved_issues = Issue...
ruby
chosen
[ { "from": "system", "value": "Update topics controller to return the proper JSON response depending on topic\n" }, { "from": "human", "value": "class TopicsController < ApplicationController\n\n def index\n @topics = Topic.all\n render json: @topics\n end\n\n def show\n @topic = Topi...
ruby
chosen
[ { "from": "system", "value": "Enable httpd in the API pod\n\n- Add volume mounts for httpd configuration\n- Change the Rails port to 3001\n" }, { "from": "human", "value": "class MiqWebServiceWorker < MiqWorker\n require_nested :Runner\n\n self.required_roles = ['web_services']\n\n STARTING_P...
ruby
chosen
[ { "from": "system", "value": "Reset RSpec world and configuration.\n" }, { "from": "human", "value": "# coding: utf-8\n\nrequire 'rspec/core/runner'\n\nmodule Guard\n class RSpectacle\n\n autoload :Formatter, 'guard/rspectacle/formatter'\n\n # The RSpectacle runner handles the execution o...
ruby
chosen
[ { "from": "system", "value": "Add evaluation code example for run in place" }, { "from": "human", "value": "@code = %w(R R B B)\n\n@guess = 'BGRB'\n\ndef color_and_postion?(color, position)\n color == @code[position]\nend\n\ndef color_only?(color)\n @code.include?(color)\nend\n\ndef evaluate_t...
ruby
chosen
[ { "from": "system", "value": "Use consistent style for ifs\n" }, { "from": "human", "value": "require \"uri\"\nrequire \"nokogiri\"\nmodule Lita\n module Handlers\n class WebTitle < Handler\n config :ignore_patterns, types: [String, Array]\n \n URI_PROTOCOLS = %w( http https )...
ruby
chosen
[ { "from": "system", "value": "Fix error during db:migrate on a new database\n" }, { "from": "human", "value": "RailsMultisite::ConnectionManagement.each_connection do\n SiteSetting.refresh!\nend\n" }, { "from": "gpt", "value": "RailsMultisite::ConnectionManagement.each_connection do...
ruby
chosen
[ { "from": "system", "value": "Allow for pushing to RubyGems in 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 'duckduckgo/version'\n\nGem::Specification.new do |spec|\n spec...
ruby
chosen
[ { "from": "system", "value": "Return gracefully if no user.\n\nWe know this is going to happen when comment looks are serlialized\nin the event stream.\n" }, { "from": "human", "value": "class CommentLookManager\n def self.comment_look(user, comment)\n participation = user.participations.fin...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary order statement, the relation will only be used for counting products\n" }, { "from": "human", "value": "require 'open_food_network/enterprise_issue_validator'\n\nclass Api::Admin::ForOrderCycle::EnterpriseSerializer < ActiveModel::Serializer\n a...
ruby
chosen
[ { "from": "system", "value": "Windows: Use the new chef-built gem\n" }, { "from": "human", "value": "# Make the path Windows-style if we're on Windows\npackage_name = node[:vagrant][:gem_name]\npackage_name = package_name.gsub(\"/\", \"\\\\\")\n\n# Make the environment paths windows style as wel...
ruby
chosen
[ { "from": "system", "value": "Switch these to autoloads to avoid loading net-ssh unless you actually use the Fetcher system." }, { "from": "human", "value": "module Fauxhai\n require 'fauxhai/exception'\n require 'fauxhai/fetcher'\n require 'fauxhai/mocker'\n require 'fauxhai/version'\n\n d...
ruby
chosen
[ { "from": "system", "value": "Clarify the need to run command twice.\n\nWe had 2 pull requests erronously trying to remove the first command.\nAdd some comments for clarity.\n" }, { "from": "human", "value": "require_relative '../isolation/abstract_unit'\n\nmodule CommandsTests\n class DevCache...
ruby
chosen
[ { "from": "system", "value": "Revert \"check that canceling still working\"\n\nThis reverts commit cae99cbb58a1befb8729e8fd54d31c0593964f1d.\n" }, { "from": "human", "value": "# Compass configuration, used by cartodb UI grunt task.\n# Require any additional compass plugins here.\n\n\n# Set this ...
ruby
chosen
[ { "from": "system", "value": "Set tv as default route.\n" }, { "from": "human", "value": "require 'dashing'\n\nconfigure do\n set :auth_token, 'YOUR_AUTH_TOKEN'\n\n helpers do\n def protected!\n # Put any authentication code you want in here.\n # This method is run before accessing ...
ruby
chosen
[ { "from": "system", "value": "Use UUIDs for request identifiers\n" }, { "from": "human", "value": "$stdout.sync = $stderr.sync = true\n\nrequire \"bundler/setup\"\nBundler.require\n\nrequire \"./lib/identity\"\n\nAirbrake.configure do |config|\n config.api_key = Identity::Config.airbrake_api_ke...
ruby
chosen
[ { "from": "system", "value": "Enable Out of band GC\n" }, { "from": "human", "value": "# This file is used by Rack-based servers to start the application.\n\nrequire ::File.expand_path('../config/environment', __FILE__)\nrun Prometheus20::Application\n\n#require 'unicorn/oob_gc'\n#\n#use Unicor...
ruby
chosen
[ { "from": "system", "value": "Add the verbose and offline CLI options for later\n\nAt some point I'll need to expose these down into the guts\n" }, { "from": "human", "value": "require 'paint'\nrequire 'thor'\n\nrequire 'jpm'\nrequire 'jpm/catalog'\n\nmodule JPM\n class CLI < Thor\n desc 'li...
ruby
chosen
[ { "from": "system", "value": "Add private scope to Task\n" }, { "from": "human", "value": "class Task < Sequel::Model\n one_to_many :time_records\n one_to_many :tags\n\n def self.create(params, &block)\n tags = params.delete 'tags'\n super(params).tap do |task|\n task.update_tags(t...
ruby
chosen
[ { "from": "system", "value": "Fix branch_id pass for srpms controller\n" }, { "from": "human", "value": "module Api\n class SrpmsController < BaseController\n include Swagger::Blocks\n\n swagger_path '/srpms/{name}.json' do\n operation :get do\n key :description, 'Returns srpm...
ruby
chosen
[ { "from": "system", "value": "Fix Redirects And Names In Controller\n" }, { "from": "human", "value": "class QuestionsController < ApplicationController\n before_action :set_question, only: [:show, :edit, :update, :destroy]\n\n def index\n @questions = Question.all\n end\n\n def show\n e...
ruby
chosen
[ { "from": "human", "value": "Add field for remote url that profile image was sourced from\n" }, { "from": "gpt", "value": "class AddProfilePhotoRemoteUrlToUsers < ActiveRecord::Migration\n def self.up\n add_column :users, :profile_photo_remote_url, :string\n end\n\n def self.down\n remo...
ruby
chosen
[ { "from": "human", "value": "Include migration for renaming Issues version column to flag_version\n" }, { "from": "gpt", "value": "class RenameIssuesVersionToFlagVersion < ActiveRecord::Migration\n def up\n rename_column :issues, :version, :flag_version\n end\n\n def down\n rename_colum...
ruby
chosen
[ { "from": "human", "value": "Add projects budget and equipments to journal_entry_items\n" }, { "from": "gpt", "value": "class AddAnalyticalFieldsJournalEntries < ActiveRecord::Migration\n def up\n add_reference :journal_entry_items, :project_budget, index: true, foreign_key: true\n add_co...
ruby
chosen
[ { "from": "system", "value": "Fix blacklight helper error (cucumber not passing)\n" }, { "from": "human", "value": "module BlacklightHelper\n # Make our application helper functions available to core blacklight views\n include ApplicationHelper\n include Blacklight::BlacklightHelperBehavior\n...
ruby
chosen
[ { "from": "system", "value": "Mark as abstract method with NotImplementedError\n" }, { "from": "human", "value": "module FromGTFS\n extend ActiveSupport::Concern\n included do\n def self.from_gtfs(entity)\n end\n end\nend\n" }, { "from": "gpt", "value": "module FromGTFS\n e...
ruby
chosen
[ { "from": "system", "value": "Remove CSRF check and comments\n" }, { "from": "human", "value": "module Shopping\n class ApiController < ApplicationController\n include JSONAPI::ActsAsResourceController\n protect_from_forgery with: :null_session\n rescue_from Shopping::NotAuthorizedErro...
ruby
chosen
[ { "from": "human", "value": "Add unit test for validator\n\ntaken from the whitehall app\n" }, { "from": "gpt", "value": "# encoding: utf-8\nrequire 'test_helper'\nrequire 'rails_translation_manager/validator'\nrequire 'tmpdir'\nrequire 'fileutils'\n\nmodule RailsTranslationManager\n class Vali...
ruby
chosen
[ { "from": "system", "value": "Use proper titles in review lines\n" }, { "from": "human", "value": "class ReviewLine < Eventable\n\n belongs_to :review\n\n serialize :teachers\n\n after_create :notify_teachers\n\n def notify_teachers\n teachers.each do |t|\n events.create!(:person_id ...
ruby
chosen
[ { "from": "system", "value": "Add more vote information to user json\n" }, { "from": "human", "value": "module UserInfoHelper\n\n def inject_extra_user_props(user)\n user_as_json = JSON.parse(user.to_json)\n\n\n user_as_json[\"full_name\"] = user[\"first_name\"] + \" \" + user[\"last_name...
ruby
chosen
[ { "from": "system", "value": "Make sure country is present [skip ci]\n" }, { "from": "human", "value": "module Ahoy\n class GeocodeV2Job < ActiveJob::Base\n queue_as { Ahoy.job_queue }\n\n def perform(visit_token, ip)\n location =\n begin\n Geocoder.search(ip).first\n...
ruby
chosen
[ { "from": "system", "value": "Allow wildcard hashes with `strip: false`\n" }, { "from": "human", "value": "module ActiveInteraction\n class HashFilter < Filter\n include MethodMissing\n\n # @param value [Object]\n #\n # @return [Hash{Symbol => Object}]\n #\n # @raise (see Filt...
ruby
chosen
[ { "from": "system", "value": "Use rake migration generator in Rails > 3.0\n" }, { "from": "human", "value": "class Mailboxer::InstallGenerator < Rails::Generators::Base #:nodoc:\n include Rails::Generators::Migration\n source_root File.expand_path('../templates', __FILE__)\n require 'rails/ge...
ruby
chosen
[ { "from": "system", "value": "Use another local variable inside block\n" }, { "from": "human", "value": "module Hamlit\n module Block\n # Suppress block's internal rendering result and pass it to [:capture, ...].\n module ScriptCompilerExtension\n def compile_script_assign(var, node,...
ruby
chosen
[ { "from": "system", "value": "Allow `expect_deprecation_with_call_site` to take a snippet as well." }, { "from": "human", "value": "module RSpecHelpers\n def expect_deprecation_with_call_site(file, line)\n expect(RSpec.configuration.reporter).to receive(:deprecation) do |options|\n expe...
ruby
chosen
[ { "from": "system", "value": "Create instead attachment in essence file spec\n\nOnly stubbing it does not work because in the shared example we access the database.\n\nFactory Girl 4.8.0 complained about and was totally right.\n" }, { "from": "human", "value": "require 'spec_helper'\n\nmodule Al...
ruby
chosen
[ { "from": "system", "value": "Add development dependency in order to make specs pass\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/rack/canonical_host', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Fabrizio Regini\"]\n g...
ruby
chosen
[ { "from": "system", "value": "Handle when asset compilation is off in rails.\n" }, { "from": "human", "value": "module HandlebarsAssets\n # NOTE: must be an engine because we are including assets in the gem\n class Engine < ::Rails::Engine\n initializer \"handlebars_assets.assets.register\"...
ruby
chosen
[ { "from": "system", "value": "Add ridiculous(ly cute) unicode checkboxes\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n# vim: et ts=2 sw=2\n\nrequire \"thor\"\n\nmodule ICloud\n module Reminders\n class App < Thor\n\n desc \"list\", \"List reminders\"\n method_option :all...
ruby
chosen
[ { "from": "system", "value": "Use session key from config\n" }, { "from": "human", "value": "# Your secret key for verifying cookie session data integrity.\n# If you change this key, all old sessions will become invalid!\n# Make sure the secret is at least 30 characters and all random, \n# no re...
ruby
chosen
[ { "from": "system", "value": "Update chef client to 12.19.36\n" }, { "from": "human", "value": "# Add the opscode APT source for chef\ndefault[:apt][:sources] = node[:apt][:sources] | [\"opscode\"]\n\n# Set the default server version\ndefault[:chef][:server][:version] = \"12.13.0-1\"\n\n# Set th...
ruby
chosen
[ { "from": "system", "value": "Fix ordering issue with groups.\n" }, { "from": "human", "value": "#\n# Cookbook Name:: nelhage\n# Recipe:: default\n#\n# Copyright 2014, Nelson Elhage\n#\n# All rights reserved - Do Not Redistribute\n#\n\ninclude_recipe \"nelhage::nginx\"\ninclude_recipe \"nelhage:...
ruby
chosen
[ { "from": "system", "value": "Drop version specificity in bundler dep in gemspec" }, { "from": "human", "value": "# frozen_string_literal: true\n\nlib = File.expand_path(\"../lib\", __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire \"socketry/version\"\n\nGem::Specifica...
ruby
chosen
[ { "from": "system", "value": "Add a missing space to setting warng message.\n" }, { "from": "human", "value": "%w(app_id key secret).each do |setting|\n next unless Pusher.public_send(setting).nil?\n\n warn(\"Warning: Pusher.#{setting} is not set.\" \\\n \"Should be set before including ...
ruby
chosen
[ { "from": "system", "value": "Add development version of GPSBabel\n\nSigned-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>\n" }, { "from": "human", "value": "require 'formula'\n\nclass Gpsbabel <Formula\n url 'http://www.mirrorservice.org/sites/www.ibiblio.org/gent...
ruby
chosen
[ { "from": "system", "value": "fix: Return artifact url instead of instance\n" }, { "from": "human", "value": "require 'uri'\nmodule MinaCircle\n module Helpers\n def artifact_url\n project = CircleCI::Project.new(\n organization: settings[:circleci_user],\n name: settings[...
ruby
chosen
[ { "from": "system", "value": "Set Statsd.logger to STDOUT for taxonomy metric rake tasks\n" }, { "from": "human", "value": "namespace :metrics do\n namespace :taxonomy do\n desc \"Count all content tagged to each level in the taxonomy\"\n task count_content_per_level: :environment do\n ...
ruby
chosen
[ { "from": "system", "value": "Switch back to attributes for BlockInit\n\nas the kwargs version would cause issues with Ruby 3\n" }, { "from": "human", "value": "# Implements the conventional constructor with \"hash of attributes\" and block support\nmodule Tracksperanto::BlockInit\n def initial...
ruby
chosen
[ { "from": "system", "value": "Fix the expected call API\n" }, { "from": "human", "value": "require 'json'\nrequire 'http'\nmodule WebSync\n module Passenger\n #\n # Client-side agent for Passenger-oriented deployment.\n #\n class Client\n\n # Host to contact\n attr_accesso...
ruby
chosen
[ { "from": "system", "value": "Update version constraint and version bump to 0.1.2\n" }, { "from": "human", "value": "name 'krb5_utils'\nmaintainer 'Cask Data, Inc.'\nmaintainer_email 'ops@cask.co'\nlicense 'Apache License, Version 2.0'\ndescription 'Set of utility...
ruby
chosen
[ { "from": "system", "value": "Fix to redefine reader method\n\nThis commit removes below interpreter warning.\n\n* warning: method redefined\n" }, { "from": "human", "value": "module RestClient\n\n # A Response from RestClient, you can access the response body, the code or the headers.\n #\n ...
ruby
chosen
[ { "from": "system", "value": "Add gitlab-attributes-with-secrets dependency, bump the version of this cookbook.\n" }, { "from": "human", "value": "name 'omnibus-gitlab'\nmaintainer 'GitLab B.V.'\nmaintainer_email 'marin@gitlab.com'\nlicense 'All rights reserved'\ndescr...
ruby
chosen
[ { "from": "system", "value": "Fix the Docker cookbook dependency.\n\nThe Docker cookbook loads a specific version of the docker-api gem, which is\nincompatible with ChefSpec. This is a continuation of 4f08c93.\n\nSee: https://github.com/sethvargo/chefspec/issues/676\n" }, { "from": "human", "val...
ruby
chosen
[ { "from": "system", "value": "Fix issues_url and source_url urls\n" }, { "from": "human", "value": "name 'docker'\nmaintainer 'Sean OMeara'\nmaintainer_email 'sean@chef.io'\nlicense 'Apache 2.0'\ndescription 'Provides docker_service, docker_image, and docker_container resources'\nversion '2.4.9'...
ruby
chosen
[ { "from": "human", "value": "Disable XML and JSON parameter parsers\n\nThey're really not necessary for static\n" }, { "from": "gpt", "value": "# Turn off XML parsing:\n# https://groups.google.com/forum/#!topic/rubyonrails-security/61bkgvnSGTQ/discussion\n# ActionDispatch::ParamsParser::DEFAULT_...
ruby
chosen
[ { "from": "system", "value": "Prepare for next development iteration\n" }, { "from": "human", "value": "module Asciidoctor\n module DocTest\n VERSION = '1.5.1'\n end\nend\n" }, { "from": "gpt", "value": "module Asciidoctor\n module DocTest\n VERSION = '1.5.2.dev'\n end\nend...
ruby
chosen
[ { "from": "system", "value": "Support blocking I/O outside Celluloid::IO actors\n" }, { "from": "human", "value": "module Celluloid\n module IO\n # Common implementations of methods originall from the IO class\n module CommonMethods\n def __get_actor\n actor = Celluloid.curren...
ruby
chosen
[ { "from": "system", "value": "Add error_message, created_at, and external_id attrs to ClaimError\n" }, { "from": "human", "value": "module Comptroller\n class ClaimError\n include Her::Model\n use_api BILLING_API\n collection_path '/duxware_errors'\n include_root_in_json true\n\n ...
ruby
chosen
[ { "from": "system", "value": "Add a bugfix for the CactEye package.\n" }, { "from": "human", "value": "class Cacteye < Kosmos::Package\n title 'CactEye Telescope'\n aliases 'cacteye'\n url 'https://app.box.com/s/89skim2e3simjwmuof4c'\n\n def install\n merge_directory 'GameData'\n merge...
ruby
chosen
[ { "from": "system", "value": "Read messages from MBox by offset\n" }, { "from": "human", "value": "module Imap::Backup\n class Serializer::Mbox\n attr_reader :folder_path\n\n def initialize(folder_path)\n @folder_path = folder_path\n end\n\n def valid?\n exist?\n end\n\...
ruby
chosen
[ { "from": "system", "value": "Update quantal64 package task to exclude files from new rootfs path\n" }, { "from": "human", "value": "namespace :boxes do\n namespace :quantal64 do\n desc 'Build Ubuntu Quantal 64 bits Vagrant LXC box'\n task :build do\n if File.exists?('./boxes/output/...
ruby
chosen
[ { "from": "system", "value": "Use user uid instead of id.\n" }, { "from": "human", "value": "require 'omniauth-oauth2'\n\nmodule OmniAuth\n module Strategies\n class Ufc < OmniAuth::Strategies::OAuth2\n option :name, \"ufc\"\n\n option :client_options, {\n site: 'https://lau...
ruby
chosen
[ { "from": "system", "value": "Clean up indentation in IdentityMap\n" }, { "from": "human", "value": "module Perpetuity\n class IdentityMap\n def initialize objects, attribute, mapper_registry\n @map = Hash[\n objects.map(&attribute)\n .flatten\n .group_by(&:klas...
ruby
chosen
[ { "from": "system", "value": "Fix gem breaking when multisite config is not present.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule RailsMultisite\n class Railtie < Rails::Railtie\n rake_tasks do\n Dir[File.join(File.dirname(__FILE__), '../tasks/*.rake')].eac...
ruby
chosen
[ { "from": "system", "value": "Add some default classes to the table\n" }, { "from": "human", "value": "require 'rack/utils'\nrequire 'cgi'\n\nmodule Sequel::Reporter\n module Helpers\n\n include Rack::Utils\n\n def partial(template, locals = {})\n render_engine = locals.delete(:rende...
ruby
chosen
[ { "from": "system", "value": "Use Math.log10 instead of Math.log for sake of Ruby 1.8 users." }, { "from": "human", "value": "class StuffClassifier::TfIdf < StuffClassifier::Base\n def tf_idf(word, cat)\n word_cat_nr = word_count(word, cat)\n cat_nr = cat_count(cat)\n tf = 1.0 * word_c...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary code from WebrickAdapter\n" }, { "from": "human", "value": "require 'webrick'\n\nmodule YARD\n module Server\n class WebrickAdapter < Adapter\n def mount_command(path, command, options)\n mount_servlet(path, WebrickServlet, command...
ruby
chosen
[ { "from": "system", "value": "Update spec for new charge rate title.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe ChargeRate do\n it { should belong_to :person }\n\n context \"when new\" do\n it \"should return an empty string\" do\n @charge_rate = ChargeRate.ne...
ruby
chosen
[ { "from": "system", "value": "Use safer || initializer vs singleton-class overwrites.\n" }, { "from": "human", "value": "module DataMapper\n \n class PropertySet < Array\n def initialize\n super\n @cache_by_names = Hash.new do |h,k|\n detect do |property|\n if prop...
ruby
chosen
[ { "from": "system", "value": "Move not! to the end of the file\n" }, { "from": "human", "value": "def not!(object)\n Negated.new(object)\nend\n\nmodule Discordrb::Events\n class Negated\n attr_reader :object\n def initialize(object); @object = object; end\n end\n\n def matches_all(attr...
ruby
chosen
[ { "from": "system", "value": "Load ActiveRecord instrumentation _after_ Rails initializes\n" }, { "from": "human", "value": "require \"instana/rack\"\n\nif defined?(::Rails)\n # In Rails, let's use the Rails logger\n ::Instana.logger = ::Rails.logger if ::Rails.logger\n\n if ::Rails::VERSION:...
ruby
chosen
[ { "from": "system", "value": "Update rake requirement from ~> 12.3.3 to ~> 13.0.1\n\nUpdates the requirements on [rake](https://github.com/ruby/rake) to permit the latest version.\n- [Release notes](https://github.com/ruby/rake/releases)\n- [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc)\...
ruby
chosen
[ { "from": "system", "value": "Add more tests for deleting" }, { "from": "human", "value": "# ~*~ encoding: utf-8 ~*~\nrequire File.expand_path(File.join(File.dirname(__FILE__), \"helper\"))\n\ncontext \"Frontend\" do\n include Rack::Test::Methods\n\n setup do\n @path = cloned_testpath(\"exa...
ruby
chosen
[ { "from": "system", "value": "Fix rspec dummy app config path\n" }, { "from": "human", "value": "require 'spec_helper'\n\nENV['RAILS_ENV'] ||= 'test'\n\nrequire File.expand_path('../../config/environment', __FILE__)\n\nabort('The Rails environment is running in production mode!') if Rails.env.pr...
ruby
chosen
[ { "from": "system", "value": "Remove Paper Trail test helpers\n\nRemove Paper Trail test helpers as they are broken, and manually tested\nin spec/support/models/default.rb\n" }, { "from": "human", "value": "if ENV['COVERAGE']\n require 'simplecov'\n\n SimpleCov.minimum_coverage 100\n\n Simple...
ruby
chosen
[ { "from": "system", "value": "Check if there's an existing job\n" }, { "from": "human", "value": "require 'forwardable'\n\nmodule Travis::API::V3::Models\n class Log\n extend Forwardable\n\n def_delegators :remote_log, :id, :attributes, :archived?\n\n attr_accessor :remote_log, :archiv...
ruby
chosen
[ { "from": "human", "value": "Create profile factory and annotate\n" }, { "from": "gpt", "value": "# == Schema Information\n#\n# Table name: profiles\n#\n# id :integer not null, primary key\n# name :string\n# bio :text\n# work_company :strin...
ruby
chosen
[ { "from": "system", "value": "Fix typo in FrameOptions example description\n" }, { "from": "human", "value": "require File.expand_path('../spec_helper.rb', __FILE__)\n\ndescribe Rack::Protection::FrameOptions do\n it_behaves_like \"any rack application\"\n\n it 'should set the X-XSS-Protection...
ruby
chosen
[ { "from": "system", "value": "Revert \"Make sure CI fails when it's supposed to\"\n\nCI does fail when it should (i.e. when a test fails).\n\nThis reverts commit 3c0712fb2465e14f91d16eaeae0ba6b4e76dfa93.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Player do\n before(:ea...
ruby
chosen
[ { "from": "system", "value": "Allow password and password confirmation parameters\n" }, { "from": "human", "value": "class Users::RegistrationsController < Devise::RegistrationsController\n before_filter :configure_permitted_parameters, if: :devise_controller?\n\n def new\n redirect_to new_...
ruby
chosen
[ { "from": "system", "value": "Add test for Category get_tree method\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass CategoryTest < ActiveSupport::TestCase\n setup do\n @category = categories(:arduino)\n end\n\n test \"Category should be valid\" do\n assert @category.va...
ruby
chosen
[ { "from": "system", "value": "Add Seo Robots to deliver indexing info\n" }, { "from": "human", "value": "module Cortex\n module Snippets\n module Client\n module Helper\n def snippet(options = {}, &block)\n snippets = webpage[:snippets] || []\n snippet = snippet...
ruby
chosen
[ { "from": "system", "value": "Test case for proper use of ActiveModel::Naming\n" }, { "from": "human", "value": "require 'test_helper'\n# For testing against edge rails also.\n# $:.unshift '/Users/jnunemaker/dev/ruby/rails/activemodel/lib'\nrequire 'active_model'\nrequire 'models'\n\nclass Activ...
ruby
chosen
[ { "from": "human", "value": "Add spec for adapter registry\n" }, { "from": "gpt", "value": "require 'spec_helper'\nrequire 'pry'\n\nRSpec.describe Stateoscope::AdapterRegistry do\n describe '#register' do\n let(:adapter) { class_double(Stateoscope::Adapter::Base) }\n\n it 'registers an ad...
ruby
chosen
[ { "from": "system", "value": "Bring initializers up-to-date with the latest version of rdoc\n" }, { "from": "human", "value": "require 'rubygems/format'\nrequire 'rubygems/indexer'\nrequire 'rdoc/markup/simple_markup'\nrequire 'rdoc/markup/simple_markup/to_html'\nrequire 'simple_ssl_requirement'...
ruby
chosen
[ { "from": "system", "value": "Fix bug in passing authorization options from class-level permission check\n" }, { "from": "human", "value": "module Authorize\n module Base\n def self.included(recipient)\n if recipient.respond_to?(:rescue_responses)\n recipient.rescue_responses['Au...
ruby
chosen
[ { "from": "system", "value": "Hide _initial_underscore methods from tab completion\n" }, { "from": "human", "value": "module Bombshell\n class Completor\n def initialize(shell)\n @shell = shell\n end\n \n attr_reader :shell\n \n def complete(fragment)\n self.class.fi...
ruby
chosen