conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Add errant protobuf-generated Ruby file\n" }, { "from": "gpt", "value": "# Generated by the protocol buffer compiler. DO NOT EDIT!\n# source: soapbox.proto\n\nrequire 'google/protobuf'\n\nGoogle::Protobuf::DescriptorPool.generated_pool.build do\n add_message \"soap...
ruby
chosen
[ { "from": "system", "value": "Use proper namespacing for constant access\n" }, { "from": "human", "value": "require 'sparkle_formation'\n\nclass SparkleFormation\n # SparkleFormation customized AttributeStruct\n class SparkleStruct < AttributeStruct\n include ::SparkleFormation::SparkleAttr...
ruby
chosen
[ { "from": "system", "value": "Fix to accept 0 args\n" }, { "from": "human", "value": "module StrokeCounter::Typist::Assessment\n def path_to_file(filename)\n filename ||= 'constitution_of_japan.txt'\n File.join 'lib', 'stroke_counter', 'texts', filename\n end\n\n def text_file(filename:...
ruby
chosen
[ { "from": "system", "value": "Boost the number of blocks in the profile test to get better results\n" }, { "from": "human", "value": "#!/usr/bin/env ruby -rprofile\nrequire ARGV[0]||\"./core\"\nrequire \"./rijndael\"\nrequire \"crypt/cbc\"\n\nputs \"Encrypting a fairly big block of text...\\n\";...
ruby
chosen
[ { "from": "system", "value": "Use query param for requests\n" }, { "from": "human", "value": "module AdRoll\n module Api\n class Service\n def self.service_url\n File.join(AdRoll::Api.base_url, to_s.demodulize.downcase)\n end\n\n def self.basic_auth\n { username:...
ruby
chosen
[ { "from": "system", "value": "Correct module name for RSpec, prevent deprecation warnings" }, { "from": "human", "value": "require 'capybara'\nrequire 'capybara/dsl'\n\nRspec.configure do |config|\n config.include Capybara\n config.after do\n Capybara.reset_sessions!\n Capybara.use_defau...
ruby
chosen
[ { "from": "system", "value": "erlang: Fix check for whether erlang is installed or not\n" }, { "from": "human", "value": "module VagrantPlugins\n module Ventriloquist\n module Cap\n module Debian\n module ErlangInstall\n ERLANG_SOLUTIONS_PKG = \"https://packages.erlang-s...
ruby
chosen
[ { "from": "human", "value": "Add a generator for draper decoration gem\n" }, { "from": "gpt", "value": "require \"rails/generators\"\n\nmodule Suspenders\n class DraperGenerator < Rails::Generators::Base\n source_root File.expand_path(\n File.join(\"..\", \"..\", \"..\", \"templates\"),...
ruby
chosen
[ { "from": "human", "value": "Add some specs for masking secrets\n" }, { "from": "gpt", "value": "require \"spec_helper\"\nrequire \"breach_mitigation/masking_secrets\"\n\ndescribe BreachMitigation::MaskingSecrets do\n let(:masking_secrets) { BreachMitigation::MaskingSecrets }\n\n describe \".m...
ruby
chosen
[ { "from": "system", "value": "Change location validation specs to pending\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe Location, type: :model do\n\n let(:location) { Location.new(name: \"Playa Badalona\", address: \"08918 Badalona\", city: \"Barcelona\")}\n\n it ...
ruby
chosen
[ { "from": "system", "value": "Replace deprecated URI.escape / unescape methods\n" }, { "from": "human", "value": "require 'set'\nrequire 'uri'\nrequire 'yaml'\n\nmodule Einhorn\n class Client\n # Keep this in this file so client can be loaded entirely\n # standalone by user code.\n mod...
ruby
chosen
[ { "from": "system", "value": "Add support for .asc and .adoc\r\nAdd support for .asciidoc.txt, .asc.txt and .adoc.txt (similar to ReSt support)" }, { "from": "human", "value": "markup(:markdown, /md|mkdn?|mdown|markdown/) do |content|\n Markdown.new(content).to_html\nend\n\nmarkup(:redcloth, /t...
ruby
chosen
[ { "from": "system", "value": "Fix the colors sample problem by circling throught the colors\n" }, { "from": "human", "value": "# frozen_string_literal: true\nmodule Noted\n class Renderer\n def initialize(notes)\n @measurements = Measurements.new\n @notes = notes\n end\n\n de...
ruby
chosen
[ { "from": "system", "value": "Remove unneeded class methods from Runtime\n" }, { "from": "human", "value": "require 'pathname'\n\nmodule Rohbau\n class Runtime\n class << self\n attr_reader :instance\n\n def start\n raise \"Don't use Runtime.start, you should use a RuntimeLo...
ruby
chosen
[ { "from": "system", "value": "Refactor UnitOfWork::Insert for making use of the best key.\n" }, { "from": "human", "value": "module Alf\n module Sequel\n module UnitOfWork\n class Insert\n include UnitOfWork::Atomic\n\n def initialize(connection, relvar_name, inserted)\n ...
ruby
chosen
[ { "from": "system", "value": "Allow timeline events to be createable\n" }, { "from": "human", "value": "module ClioClient\n module Api\n class TimelineEvent < Base\n\n include ClioClient::Api::Listable\n\n private\n\n def data_klass(*args)\n ClioClient::TimelineEvent\n ...
ruby
chosen
[ { "from": "system", "value": "Add delete and create endpoint params\n" }, { "from": "human", "value": "class Apps\n\tdef initialize(client)\n\t\t@client = client\n\t\t@ENDPOINT = client.ENDPOINT + \"/\" + \"apps\"\n\tend\n\n\tdef list()\n\t\tmethod = \"GET\"\n\t\treturn self.client.request(metho...
ruby
chosen
[ { "from": "system", "value": "Move blockquote prefix into constant\n" }, { "from": "human", "value": "class Deba::Document\n attr_reader :content\n\n def initialize(extractor)\n @extractor = extractor\n @content = \"\"\n\n start\n end\n\n def <<(segment)\n @segments << segment\n ...
ruby
chosen
[ { "from": "system", "value": "Allow VERSION to be reloaded\n" }, { "from": "human", "value": "module Pacer\n unless const_defined? :VERSION\n VERSION = \"2.0.1\"\n\n START_TIME = Time.now\n end\nend\n" }, { "from": "gpt", "value": "module Pacer\n VERSION = \"2.0.1\"\n unles...
ruby
chosen
[ { "from": "system", "value": "Fix um topics subcommand, which wasn't using the expanded pages directory path.\n" }, { "from": "human", "value": "require_relative '../lib/um.rb'\n\nOptions.parse! do |available_opts|\n available_opts.banner = 'usage: um topics [OPTIONS...]'\n\n available_opts.on...
ruby
chosen
[ { "from": "system", "value": "Fix Directly inheriting from ActiveRecord::Migration is not supported\n" }, { "from": "human", "value": "class AddUserIdAndDeletedAtToAddresses < ActiveRecord::Migration\n def self.up\n change_table addresses_table_name do |t|\n t.integer :user_id\n t....
ruby
chosen
[ { "from": "system", "value": "Fix routes without custom controller\n" }, { "from": "human", "value": "module Vitrage\n module Router\n\n def routes(rails_router, options = {})\n if options[:controller]\n cs = options[:controller].to_s\n rails_router.post '/vitrage/pieces...
ruby
chosen
[ { "from": "system", "value": "Add github page as homepage\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'acts_as_likeable/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Add create route flash message\n" }, { "from": "human", "value": "require 'pry'\nclass ProjectsController < ApplicationController\n load_and_authorize_resource\n\n def index\n @projects = Project.all\n end\n\n def show\n @project = Project.find(params[:id]...
ruby
chosen
[ { "from": "system", "value": "Update email information on signup\n" }, { "from": "human", "value": "require 'fb_service'\n\nclass SessionsController < ApplicationController\n def create\n auth = request.env[\"omniauth.auth\"]\n token = auth[\"credentials\"][\"token\"]\n user = User.f...
ruby
chosen
[ { "from": "human", "value": "Add suites of empty serverspec tests.\n" }, { "from": "gpt", "value": "# Tests for a Racktable install\nrequire 'serverspec'\n\ninclude Serverspec::Helper::Exec\ninclude Serverspec::Helper::DetectOS\n\n# Setup something with root user paths?\n# Not sure what is going...
ruby
chosen
[ { "from": "system", "value": "Remove obsolete taxon_concept and geo_entity ids from export\n" }, { "from": "human", "value": "class Species::DocumentsExport < Species::CsvCopyExport\n\n def query\n rel = Document.from(\"#{table_name} documents\").\n order('event_type, date_raw, title')\...
ruby
chosen
[ { "from": "system", "value": "Add pulled_by attribute to LiveTimeParameters.permitted.\n" }, { "from": "human", "value": "class LiveTimeParameters < BaseParameters\n\n def self.permitted\n [:id, :event_id, :lap, :split_id, :sub_split_kind, :bitkey, :wave, :bib_number, :absolute_time, :milita...
ruby
chosen
[ { "from": "human", "value": "Add definition for pg gem\n" }, { "from": "gpt", "value": "#\n# Copyright 2014 Chef Software, 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 ...
ruby
chosen
[ { "from": "system", "value": "Delete load test data in batches, optimise sql query\n" }, { "from": "human", "value": "class LoadTestDataRemover\n # Warning! Do not run on production.\n # ENV['REMOVE_LOAD_TEST_DATA'] should be set to 'true' on Staging env only.\n def self.run\n delete_load_...
ruby
chosen
[ { "from": "system", "value": "Fix a method in test\n\n- Change #send to #__send__\n - ::BasicObject, which is the superclass of PseudoObject::BasicObject, does not have #send\n" }, { "from": "human", "value": "RSpec.shared_examples 'instance methods not being' do\n subject { described_class.ne...
ruby
chosen
[ { "from": "human", "value": "Revert \"use a symlink instead of copy of the file\"\n\nThis reverts commit a9325a3180eea20cf2a9148cab84e3e9c5fcb540.\n\nTest kitchen complains the file doesn't exist:\n\nERROR: Errno::ENOENT: No such file or directory - /tmp/apache2/../apache2/test/kitchen/cookbooks/apache2_tes...
ruby
chosen
[ { "from": "system", "value": "Add code to check access level\n" }, { "from": "human", "value": "module ACL\n module Control\n \n def self.put(variable)\n controller.put(variable)\n return self\n end\n\n def self.get(value)\n controller.variables[value]\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Update code for wiring auth0jwt into devise.\n" }, { "from": "human", "value": "module DeviseAuth0JwtStrategy\n class Railtie < Rails::Railtie\n #initializer \"devise_auth0_jwt_strategy.configure_rails_initialization\" do\n config.after_initialize do\n p...
ruby
chosen
[ { "from": "system", "value": "Remove interface used to expose migration code\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'yaml'\n\nrequire 'feature_flagger/version'\nrequire 'feature_flagger/storage/redis'\nrequire 'feature_flagger/control'\nrequire 'feature_flagg...
ruby
chosen
[ { "from": "system", "value": "Correct processing of auth token\n" }, { "from": "human", "value": "#\n# helpers for validating inbound authorization tokens\n#\nmodule TokenHelper\n\n #\n # our shared secret for JWT validation\n #\n @@secret = nil\n\n #\n # validate the supplied token\n #\n...
ruby
chosen
[ { "from": "system", "value": "Remove deprecated replacefields directive from repair solr\n" }, { "from": "human", "value": "module DatastaxRails\n module SolrRepair\n def repair_solr\n encoded = {}\n attributes.keys.each do |column_name|\n value = read_attribute(column_name)...
ruby
chosen
[ { "from": "human", "value": "Fix delivered_on and first_published_at of DfT Speeches\n\nIn the original DfT speech uploads\n(20121012135700_upload_dft_speeches.rb) we were parsing the date from\nthe CSV file as a timestamp. Any date during BST would be converted to\na timestamp at midnight (BST) on the sam...
ruby
chosen
[ { "from": "human", "value": "Remove deprecated column from agreements table\n" }, { "from": "gpt", "value": "class RemoveIrbEvidenceTypeFromAgreements < ActiveRecord::Migration[5.2]\n def change\n remove_column :agreements, :irb_evidence_type, :string, null: false, default: \"has_evidence\"\...
ruby
chosen
[ { "from": "system", "value": "Fix timestamp to include %M instead of %I for post-deploy migrations.\n\nCloses #44121.\n" }, { "from": "human", "value": "require 'rails/generators'\n\nmodule Rails\n class PostDeploymentMigrationGenerator < Rails::Generators::NamedBase\n def create_migration_f...
ruby
chosen
[ { "from": "system", "value": "Make contests controller an admin controller\n" }, { "from": "human", "value": "module Admin\n class ContestsController < ApplicationController\n def show\n @contest = Contest.instance\n end\n end\nend\n" }, { "from": "gpt", "value": "module...
ruby
chosen
[ { "from": "system", "value": "Comment for method_missing for koi routes.\n" }, { "from": "human", "value": "module Koi\n class AdminCrudController < Koi::ApplicationController\n helper :all\n has_crud :admin => true\n defaults :route_prefix => 'admin'\n\n protected\n\n def method_m...
ruby
chosen
[ { "from": "system", "value": "Change the sessions controller to use omniauth authentication.\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n before_filter :check_session, except: :destroy\n\n def create\n submitted_username = params[:session][:username]...
ruby
chosen
[ { "from": "system", "value": "Add ghetto synchronous mail notifications\n\nShould use queues for this tomorrow.\n" }, { "from": "human", "value": "class ParticipationsController < ApplicationController\n\n def create\n @challenge = Challenge.find(params[:challenge_id])\n\n participation =...
ruby
chosen
[ { "from": "system", "value": "Use a larger input string for the digest benchmark\n" }, { "from": "human", "value": "require 'digest/sha1'\nrequire 'openssl'\nrequire 'openssl/digest'\nrequire 'benchmark'\nrequire 'benchmark/ips'\n\ninput = 'hello, world!'\n\nBenchmark.ips do |bench|\n bench.rep...
ruby
chosen
[ { "from": "system", "value": "Check email settings before firing email\n\nSigned-off-by: Shen Yichen <be3bb257ef8d73236feaba36cd3e5ee9095e6819@gmail.com>\n" }, { "from": "human", "value": "class Course::VideoNotifier < Notifier::Base\n def video_attempted(user, video)\n create_activity(actor...
ruby
chosen
[ { "from": "system", "value": "Handle the presence of sti_name on class or base class\n" }, { "from": "human", "value": "module PolymorphicIntegerType\n module AssociationQueryHandlerExtension\n def call(attribute, value)\n queries = {}\n table = value.associated_table\n\n if v...
ruby
chosen
[ { "from": "system", "value": "Check if inherited class is `descends_from_active_record?`\n" }, { "from": "human", "value": "require 'active_support/concern'\n\nmodule ActiveMultipleDb\n module TableNamePrefixer\n extend ActiveSupport::Concern\n\n module ClassMethods\n def inherited(k...
ruby
chosen
[ { "from": "system", "value": "Patch to fix deprecation of load_once_paths in rails 2.3.9.\n" }, { "from": "human", "value": "module Simply\n#\tpredefined namespace\nend\nrequire 'simply_taggable/simply_taggable'\n\n# From http://guides.rubyonrails.org/plugins.html#controllers\n# Fix for:\n# Argu...
ruby
chosen
[ { "from": "system", "value": "Add additional deploy tasks to mask rake attrs handling\n" }, { "from": "human", "value": "namespace :release do\n task :bump, [:type] do |_, arguments|\n system \"bin/semver increment #{arguments[:type]}\"\n end\n\n task commit: :environment do\n system \"...
ruby
chosen
[ { "from": "system", "value": "Access relative_url_root via ActionController::Base.config (for Rails 3.1 compatibility)\n" }, { "from": "human", "value": "module TinyMCE\n def self.base\n [Rails.application.config.action_controller.asset_host,\n Rails.application.config.relative_url_root,...
ruby
chosen
[ { "from": "system", "value": "Use other source for usd to cop convertion\n" }, { "from": "human", "value": "require 'open-uri'\n\nclass UsdToCopPlugin\n include NinjaPlugin\n\n match /usd2cop (\\d+)/, method: :convert\n match /usd2cop$/, method: :trm\n\n def usage\n \"!usd2cop [n] -- Conv...
ruby
chosen
[ { "from": "system", "value": "Make createrepo skip if packages were not updated to speed up runs where packages are not updated at all.\n" }, { "from": "human", "value": "property :name, [String, Symbol], required: true, name_property: true\nproperty :local_path, String, required: false\npropert...
ruby
chosen
[ { "from": "system", "value": "Change to clean up syntax\n" }, { "from": "human", "value": "lib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'benchmark/perf/version'\n\nGem::Specification.new do |spec|\n spec.name = \"benchmark...
ruby
chosen
[ { "from": "system", "value": "Fix failed spec on Serverkit::ResourceBuilder\n\nThe implementation had been changed in the previous commit.\nIn that change, Serverkit::Resources::Missing were added,\nwhich is used on missing type attribute.\n" }, { "from": "human", "value": "require \"active_supp...
ruby
chosen
[ { "from": "human", "value": "Add index to help improve transfer lookups\n" }, { "from": "gpt", "value": "Sequel.migration do\n\n no_transaction\n\n change do\n alter_table(:transfers) do\n add_index :group_id, name: 'active_group_transfers_idx', where: { deleted_at: nil }, concurrently...
ruby
chosen
[ { "from": "system", "value": "Fix first-time test on fresh workstation\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'certmeister/test/memory_store_interface'\n\nrequire 'certmeister/pg/store'\n\ndescribe Certmeister::Pg::Store do\n\n class << self\n include Certmeister::...
ruby
chosen
[ { "from": "system", "value": "Simplify if statement by removing ! negative (refactor only)\n" }, { "from": "human", "value": "class Contractor < ActiveRecord::Base\n has_paper_trail\n\n has_many :contracts, inverse_of: :contractor\n\n validates :name, :abn, presence: true\n validates :abn, u...
ruby
chosen
[ { "from": "system", "value": "Enable arc to accept minus value\n" }, { "from": "human", "value": "module Nyaplot\n module Diagrams\n module Arc\n include Jsonizable\n define_group_properties(:options, [:range, :width, :color, :fill_by, :x, :y, :layer, :axis])\n\n def process_d...
ruby
chosen
[ { "from": "system", "value": "Add length validations for :full_name, :email, :codecademy_username, :description, :goals, :problems\n" }, { "from": "human", "value": "class Submission < ActiveRecord::Base\n validates :full_name, :age, :email, :codecademy_username, :description, :html, :css, :js,...
ruby
chosen
[ { "from": "system", "value": "Use helpers to cleanup logic\n" }, { "from": "human", "value": "class DashboardController < ApplicationController\n include Sufia::DashboardControllerBehavior\n\n include Blacklight::Configurable\n\n include Blacklight::SearchHelper\n include Blacklight::AccessC...
ruby
chosen
[ { "from": "system", "value": "Fix defined?(super) for ruby 1.9.2\n" }, { "from": "human", "value": "module Contracts\n module Core\n def self.included(base)\n common(base)\n end\n\n def self.extended(base)\n common(base)\n end\n\n def self.common(base)\n return if ...
ruby
chosen
[ { "from": "system", "value": ":bug: Fix issue to use Shellwords\n" }, { "from": "human", "value": "module Convdayone\n OPTIONS = [:date, :starred, :photo_path, :journal_file].freeze\n\n class CLI\n def self.create(content, options = {})\n raise '`dayone-cli` is not found. install from ...
ruby
chosen
[ { "from": "system", "value": "Fix free space error with both starting room+items randos\n" }, { "from": "human", "value": "\nmodule StartingRoomRandomizer\n def randomize_starting_room\n game.fix_top_screen_on_new_game()\n \n rooms = []\n game.each_room do |room|\n next if room...
ruby
chosen
[ { "from": "system", "value": "Upgrade rake to version 12.3.1" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'easy_logging/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Fix specs for servers:remove command.\n" }, { "from": "human", "value": "require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')\n\ndescribe \"servers:remove command\" do\n def cli\n @cli ||= HP::Cloud::CLI.new\n end\n\n before(:all) do\n ...
ruby
chosen
[ { "from": "system", "value": "Add test for pending_changes? due to update file\n" }, { "from": "human", "value": "require 'spec_helper'\nmodule WebSync\n describe Repository::GitRepo, \"pending_changes?\" do\n\n def build_clean_fixture_repo(working_dir)\n code = File.read(File.expand_pa...
ruby
chosen
[ { "from": "system", "value": "Create rake task to migrate tags and associations from Interactives to ExternalActivities.\n\n[#151758282]\n" }, { "from": "human", "value": "require 'rake'\n\nnamespace :app do\n namespace :materials do\n\n desc 'convert interactives to external_activities'\n ...
ruby
chosen
[ { "from": "system", "value": "Enable customer_balance to all users\n\nThis however makes the tests still pass, which rely on the off-branch\nlogic of the toggle. We'll work on them next.\n" }, { "from": "human", "value": "require 'open_food_network/feature_toggle'\n\nbeta_testers = ENV['BETA_TES...
ruby
chosen
[ { "from": "human", "value": "Add tests for the Mist Builder plugin\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Cyclid::API::Plugins::Mist do\n # Provide some simple stub\n module MistPlugin\n module Test\n class Pool\n def acquire\n 'test.example....
ruby
chosen
[ { "from": "system", "value": "Update test to use existing database\n" }, { "from": "human", "value": "require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')\n\ndescribe Pupa::Processor::Connection do\n describe '.new' do\n it 'should use MongoDB' do\n expect(Pupa::Processo...
ruby
chosen
[ { "from": "system", "value": "Use updated_at instead of created_at for recent logs\n" }, { "from": "human", "value": "class Tuner < ActiveRecord::Base\n has_many :tuner_info, :dependent => :destroy\n has_many :logs\n has_many :stations, :through => :logs\n\n accepts_nested_attributes_for :tu...
ruby
chosen
[ { "from": "system", "value": "Put source directory somewhere more sensible.\n" }, { "from": "human", "value": "default[:planet][:dump][:xml_directory] = \"/store/planet/planet\"\ndefault[:planet][:dump][:xml_history_directory] = \"/store/planet/planet/full-history\"\ndefault[:planet][:dump][:pbf...
ruby
chosen
[ { "from": "system", "value": "Use proc for env file\n" }, { "from": "human", "value": "module Iridium\n class Engine < Component\n def paths\n @paths ||= begin\n set = Hydrogen::PathSet.new root\n set[:app].add \"app\"\n\n set[:config].add \"app/config\"\n se...
ruby
chosen
[ { "from": "system", "value": "Make it possible to pass block to glob method in RedisStore\n" }, { "from": "human", "value": "require 'redis'\nmodule Goohub\n module DataStore\n class RedisStore < Base\n def initialize(options = {})\n @redis = Redis.new(options)\n end\n\n ...
ruby
chosen
[ { "from": "human", "value": "Set up file for GPS 2.3\n" }, { "from": "gpt", "value": "# Your Names\n# 1)\n# 2)\n\n# We spent [#] hours on this challenge.\n\n# Bakery Serving Size portion calculator.\n\ndef serving_size_calc(item_to_make, num_of_ingredients)\n library = {\"cookie\" => 1, \"cake\...
ruby
chosen
[ { "from": "system", "value": "Fix typo in sample_data zone creation (zonEable) and added clause to avoid re-adding the same country to the zone\n" }, { "from": "human", "value": "module Addressing\n private\n\n def address(string)\n state = country.states.first\n parts = string.split(\",...
ruby
chosen
[ { "from": "system", "value": "Revert \"load hash and object core_ext\"\n\nThis reverts commit 9ded0797e3e6eebef5adab1f4d02bf991780aa63.\n" }, { "from": "human", "value": "require \"active_support/core_ext/hash\"\nrequire \"active_support/core_ext/string\"\n\nmodule Undo\n module Serializer\n ...
ruby
chosen
[ { "from": "system", "value": "Convert Pathname to String when passing to ::Rubocop::ProcessedSource\n\nOtherwise, it errors. Changed in rubocop 0.30.0\n" }, { "from": "human", "value": "require 'pronto'\nrequire 'rubocop'\n\nmodule Pronto\n class Rubocop < Runner\n def initialize\n @con...
ruby
chosen
[ { "from": "system", "value": "Refactor: Add keyword directly to the array\n\nhttps://github.com/twingly/twingly-search-api-ruby/pull/81#discussion_r269543135\n" }, { "from": "human", "value": "Bundler.require\n\nclass SearchPostStream\n def initialize(keyword, language: nil)\n # Set environm...
ruby
chosen
[ { "from": "system", "value": "Terminate deploy is another session is running\n" }, { "from": "human", "value": "module Shuttle\n class Runner\n attr_reader :config_path\n attr_reader :config, :target\n\n def initialize(config_path, target)\n if !File.exists?(config_path)\n ...
ruby
chosen
[ { "from": "system", "value": "Change additional path from Pathname to String\n\nBecause some gems expects that autoload_paths is Array of String\n" }, { "from": "human", "value": "module Stache\n class Railtie < ::Rails::Railtie\n initializer 'stache.autoload', :before => :set_autoload_paths...
ruby
chosen
[ { "from": "system", "value": "Make BalanceCalculator use old balance calculation\n\nThis class is currently used and it gets skipped when the\n:customer_balance toggle is enabled, so there's no point on abstracting\nthe balance with `OrderBalance`. It'll never go through its\n`#new_outstanding_balance` bran...
ruby
chosen
[ { "from": "human", "value": "Add conde wars (7) - find the smallest power\n" }, { "from": "gpt", "value": "# http://www.codewars.com/kata/56ba65c6a15703ac7e002075/\n# --- iteration 1 ---\ndef find_next_power(val, pow)\n lower = val ** (1.fdiv(pow))\n ((lower.floor + 1) ** pow)\nend\n" } ]
ruby
chosen
[ { "from": "system", "value": "Add further dashboards controller specs\n" }, { "from": "human", "value": "describe DashboardsController do\n render_views\n \n describe \"Student dashboard\" do\n let(:course2) { FactoryGirl.create(:given_course)}\n \n before :all do\n @student = F...
ruby
chosen
[ { "from": "system", "value": "Check that some packages only needed to build have been removed\n" }, { "from": "human", "value": "control \"tidy_files\" do\n impact 1.0\n title \"Unnecessary files are removed\"\n desc \"The image has had build files, excess packages and other cruft deleted\"\n...
ruby
chosen
[ { "from": "human", "value": "Add tests for static file discoverer\n" }, { "from": "gpt", "value": "require 'shanty/discoverers/shantyfile'\n\nmodule Shanty\n RSpec.describe Shanty::ShantyfileDiscoverer do\n before do\n @project_templates = Dir.chdir('examples') do\n Discoverer.fi...
ruby
chosen
[ { "from": "system", "value": "Add mecab-ipadic task for Fedora\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe package('mecab-ipadic'), :if => os[:family] == 'redhat' do\n it { should be_installed }\nend\n\ndescribe package('mecab-naist-jdic'), :if => os[:family] == 'ubuntu...
ruby
chosen
[ { "from": "human", "value": "Add remote tests for SecurePayTech\n\ngit-svn-id: 15afb6ebb5ffcaa0dbaaa80925839866918ea29e@457 6513ea26-6c20-0410-8a68-89cd7235086d\n" }, { "from": "gpt", "value": "require File.dirname(__FILE__) + '/../test_helper'\n\nclass RemoteSecurePayTechTest < Test::Unit::Test...
ruby
chosen
[ { "from": "human", "value": "Set Sidekiq configuration per Heroku's policies\n" }, { "from": "gpt", "value": "# https://devcenter.heroku.com/articles/forked-pg-connections#sidekiq\nSidekiq.configure_server do |config|\n database_url = ENV['DATABASE_URL']\n if database_url\n ENV['DATABASE_UR...
ruby
chosen
[ { "from": "system", "value": "Send all events to Jaconda" }, { "from": "human", "value": "class Service::Jaconda < Service\n string :subdomain, :room_id, :room_token\n boolean :digest\n\n def receive_push\n raise_config_error \"Missing 'subdomain'\" if data['subdomain'].to_s == ''\n r...
ruby
chosen
[ { "from": "human", "value": "Add QQ input method, version 2.8.86.400\n" }, { "from": "gpt", "value": "class Qqinput < Cask\n version '2.8.86.400'\n sha256 '5b90cf604230013d5afa974b5b4835c0d6faf55da932cebce4f72478b5665a4d'\n\n url 'http://qqime.cdn.sogou.com/QQInput_Mac_Setup_2_8_86_400.dmg'\n...
ruby
chosen
[ { "from": "system", "value": "Include the contributing guide in the gem\n" }, { "from": "human", "value": "# coding: utf-8\n\nrequire File.expand_path(\"../lib/benchmark/memory/version\", __FILE__)\n\nGem::Specification.new do |spec|\n spec.name = \"benchmark-memory\"\n spec.version ...
ruby
chosen
[ { "from": "system", "value": "spec/textmate: Make sure it returns nil if the editor is not running.\n" }, { "from": "human", "value": "require 'spec_helper'\n\nmodule Editor\n describe Textmate do\n it \"should respond to :app as class methods\" do\n Textmate.should respond_to(:app)\n ...
ruby
chosen
[ { "from": "human", "value": "Add spec for base runner\n" }, { "from": "gpt", "value": "describe KnapsackPro::Runners::BaseRunner do\n let(:adapter_class) { double }\n let(:runner) do\n described_class.new(adapter_class)\n end\n let(:allocator) { instance_double(KnapsackPro::Allocator) }\n...
ruby
chosen
[ { "from": "system", "value": "Set persistent object on repo success\n" }, { "from": "human", "value": "module LittleMapper\n module MapperInstanceMethods\n def to_persistent(entity)\n pe = self.class.persistent_entity.new\n self.class.mappings.each do |m|\n m.from(entity).to...
ruby
chosen
[ { "from": "system", "value": "Update podspec to support iOS 7 and latest version\n" }, { "from": "human", "value": "Pod::Spec.new do |spec|\n spec.name = 'Argo'\n spec.version = '0.2'\n spec.summary = 'Functional JSON parsing library for Swift.'\n spec.homepage = 'https://github.com/thoughtb...
ruby
chosen
[ { "from": "system", "value": "Add Kase.open and Kase.closed functions\n" }, { "from": "human", "value": "module Highrise\n class Kase < Subject\n def close!\n self.closed_at = Time.now.utc\n save\n end\n end\nend" }, { "from": "gpt", "value": "module Highrise\n cla...
ruby
chosen
[ { "from": "system", "value": "Allow for nil and false values for consolidation\n" }, { "from": "human", "value": "module Pronto\n class Config\n def initialize(config_hash = ConfigFile.new.to_h)\n @config_hash = config_hash\n end\n\n %w(github gitlab bitbucket).each do |service|\n...
ruby
chosen
[ { "from": "system", "value": "Update podspec to remove XCTest\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n\n s.name = 'LolayLocksmith'\n s.version = '1'\n s.summary = 'iOS Wrapper for Keychain Utilities such as SecItemCopyMatching, SecItemAd...
ruby
chosen