conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Add completed 4.2.3 local variables and basic arithmetic.\n" }, { "from": "gpt", "value": "# Solution Below\n\nnum1 = 26\nnum2 = 94\nsum = num1+num2\ndifference = num1-num2\nquotient = num1.to_f/num2.to_f\nproduct = num2 * num1\nmodulus = num1 % num2\n\nputs quotient...
ruby
chosen
[ { "from": "system", "value": "Use at most 3 sentences from each synopsis.\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\nBASE_URL = \"http://www.madehow.com/\"\n\nclass MadeHowItem\n attr_accessor :name, :link, :desc\n \n def initialize(name, link, desc=nil)\n @name = name\n ...
ruby
chosen
[ { "from": "system", "value": "Use Dalli to manage memcached in CI env\n\nThis will ensure that Test is closer to the live environments.\n" }, { "from": "human", "value": "FinderFrontend::Application.configure do\n # We use the non-default in memory cache store for development purposes.\n # It ...
ruby
chosen
[ { "from": "system", "value": "Change unicord process count to 2\n" }, { "from": "human", "value": "# Due to catarse's heavy page load, we are setting it to 4 workers\n# 1024/4 = 240MB for each web worker\n# 512/4 = 128MB for each web worker (in this case, make it 3 worker processes)\nif ENV['PX...
ruby
chosen
[ { "from": "system", "value": "Set min supported ruby version\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'oxblood/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Fix amazon refersher to use legacy refresh\n" }, { "from": "human", "value": "module ManageIQ::Providers\n class Amazon::NetworkManager::Refresher < ManageIQ::Providers::BaseManager::Refresher\n include ::EmsRefresh::Refreshers::EmsRefresherMixin\n\n def pars...
ruby
chosen
[ { "from": "system", "value": "Call it test_hash instead of test_id\n" }, { "from": "human", "value": "require 'abnormal/version'\n\nclass Abnormal\n def self.db; @@db; end\n def self.db=(db)\n @@db = db\n end\n\n def self.ab_test(identity, test_name, alternatives, conversions)\n db['te...
ruby
chosen
[ { "from": "system", "value": "Delete platform attribute from gemspec\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"jschema\"\n s.version = \"0.0.0\"\n s.date = \"2013-11-11\"\n s.summary = \"JSON Schema implementation\"\n s.description =...
ruby
chosen
[ { "from": "system", "value": "Set email factory primary to false by default\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :email do\n type :university\n address { Faker::Internet.email }\n end\nend" }, { "from": "gpt", "value": "FactoryGirl.define do\n f...
ruby
chosen
[ { "from": "system", "value": "Add test for URI with parameters\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe \"the pget_filename function\" do\n let(:scope) { PuppetlabsSpec::PuppetInternals.scope }\n\n it \"should exist\" do\n Puppet::Parser::Functions.function(\"pge...
ruby
chosen
[ { "from": "system", "value": "Complete the +pick+ opcode test in multithread env.\n" }, { "from": "human", "value": "require 'spec_helper'\nmodule Gisele\n class VM\n describe 'op_pick' do\n\n let(:vm){ VM.new 0, [] }\n\n subject{\n vm.op_pick\n vm.stack.last\n }...
ruby
chosen
[ { "from": "system", "value": "Change home page scenario description\n" }, { "from": "human", "value": "require \"rails_helper\"\n\nRSpec.describe \"Home page\" do\n scenario \"visit\" do\n visit root_path\n\n expect(page).to have_content \"Welcome to Ruby Taiwan\"\n end\nend\n" }, { ...
ruby
chosen
[ { "from": "system", "value": "Replace description with summary (required)\n" }, { "from": "human", "value": "# coding: utf-8\n\nGem::Specification.new do |spec|\n spec.name = \"subdomain_locale\"\n spec.version = \"0.1.1\"\n spec.authors = [\"Semyon Perepelitsa\"]\n spec...
ruby
chosen
[ { "from": "system", "value": "Add pry as 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 'mute/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Check column and index presence in db in filtrable for option types migration\n" }, { "from": "human", "value": "class AddFilterableColumnToSpreeOptionTypes < ActiveRecord::Migration[6.0]\n def change\n add_column :spree_option_types, :filterable, :boolean, defa...
ruby
chosen
[ { "from": "system", "value": "Update dependencies to work with rails4" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/asana/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Ryan Bright\"]\n gem.email = [\"ryan@...
ruby
chosen
[ { "from": "system", "value": "Add myself to authors in gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"qunited/version\"\n\nGem::Specification.new do |s|\n s.name = \"qunited\"\n s.version = QUnited::VER...
ruby
chosen
[ { "from": "system", "value": "Fix require order to avoid NameError\n" }, { "from": "human", "value": "require 'construi/config'\nrequire 'construi/runner'\n\nrequire 'yaml'\n\nmodule Construi\n String.disable_colorization = false\n\n def self.run(targets)\n Runner.new(Config.load_file('cons...
ruby
chosen
[ { "from": "system", "value": "chore: Allow DB logging to be turned off\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'sequel'\nrequire 'ditty/services/logger'\nrequire 'active_support'\nrequire 'active_support/core_ext/object/blank'\n\npool_timeout = (ENV['DB_POOL_T...
ruby
chosen
[ { "from": "human", "value": "Create sparql helper module to use custom SPARQL::Client class.\n" }, { "from": "gpt", "value": "require 'umakadata/my_sparql_client'\nrequire 'umakadata/logging/sparql_log'\n\nmodule Umakadata\n module SparqlHelper\n\n def prepare(uri)\n @client = Umakadata...
ruby
chosen
[ { "from": "system", "value": "Test for randomly generated url\n" }, { "from": "human", "value": "require './app'\nrequire 'spec_helper'\n\ndescribe PalyIO::Web do\n before(:all) do\n # ensure both API and Web are running, so that the JS doesn't die\n Capybara.app, _ = Rack::Builder.parse_...
ruby
chosen
[ { "from": "system", "value": "Make PostgreSQL 9.5 Beta apt packages available\n\nThis change is a little helper for users interested to install 9.5 on\nthe build fly. The pre-installation of 9.5 on Travis machine/container\nimages will only come after general availability (which is currently\nplanned for en...
ruby
chosen
[ { "from": "human", "value": "Add function to get homebrew installed leaves\n\nLeaves are formula without a dependent parent\n" }, { "from": "gpt", "value": "require 'formula'\ndeps_graph = Formula.get_used_by\nformulas = HOMEBREW_CELLAR.children.select { |pn| pn.directory? }.collect { |pn| pn.ba...
ruby
chosen
[ { "from": "system", "value": "Remove stacktrace in occuring http error\n" }, { "from": "human", "value": "module GemSearch\n module Commands\n class Base\n attr_reader :options\n\n def initialize(options)\n @options = options\n end\n\n private\n\n def puts_a...
ruby
chosen
[ { "from": "system", "value": "Make sure GType is always initialized\n" }, { "from": "human", "value": "module GIRepository\n class IRepository\n def self.default\n @@singleton ||= new(Lib::g_irepository_get_default)\n end\n\n def get_n_infos namespace\n Lib.g_irepository_get_...
ruby
chosen
[ { "from": "system", "value": "Add name to the table listing.\n" }, { "from": "human", "value": "require 'hpcloud/commands/servers/add'\nrequire 'hpcloud/commands/servers/remove'\nrequire 'hpcloud/commands/servers/reboot'\n\nmodule HP\n module Cloud\n class CLI < Thor\n\n map 'servers:li...
ruby
chosen
[ { "from": "system", "value": "Update required Compass version for gem\n" }, { "from": "human", "value": "require './lib/spinners'\n\nGem::Specification.new do |s|\n # Release Specific Information\n s.version = ModernizrMixin::VERSION\n s.date = ModernizrMixin::DATE\n\n # Gem Details\n s.nam...
ruby
chosen
[ { "from": "system", "value": "Use a more direct syntax to include ClassMethods\n" }, { "from": "human", "value": "# This code is free software; you can redistribute it and/or modify it under\n# the terms of the new BSD License.\n#\n# Copyright (c) 2009-2010, Sebastian Staudt\n\nrequire 'singleto...
ruby
chosen
[ { "from": "system", "value": "Fix the possessive spelling of Rails's\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule RuboCop\n module Cop\n module Rails\n # This cop checks for the use of output calls like puts and print\n class Output < Cop\n MSG ...
ruby
chosen
[ { "from": "system", "value": "Set asset digest to true.\n" }, { "from": "human", "value": "Rails.application.configure do\n # Settings specified here will take precedence over those in config/application.rb.\n\n # In the development environment your application's code is reloaded on\n # every...
ruby
chosen
[ { "from": "system", "value": "Remove account from azure asset container var\n" }, { "from": "human", "value": "if Rails.env.in?(%(development test cucumber))\n CarrierWave.configure do |config|\n config.storage = :file\n config.enable_processing = false\n end\nelse\n CarrierWave.configu...
ruby
chosen
[ { "from": "system", "value": "Update gem spec homepage, summary and description" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'locobot/version'\n\nGem::Specification.new do |spec|\n ...
ruby
chosen
[ { "from": "system", "value": "Validate behaviour against a real bucket.\n" }, { "from": "human", "value": "require \"spec_helper\"\nrequire \"aws-sdk-resources\"\n\nrequire_relative \"resource_behaviour.rb\"\n\nif ENV.key?(\"AWS_ACCESS_KEY_ID\")\n describe Aws::S3::Resource, :integration => tru...
ruby
chosen
[ { "from": "human", "value": "Add feature test for admin editing user.\n\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\nRSpec.feature 'Admin goes to user page', :WebDriver => true do\n before do\n login_as('admin')\n visit users_path\n end\n\n scenario 'Admin can view user pag...
ruby
chosen
[ { "from": "system", "value": "Update comment - we acutally do need this in Rails, not just PHP\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe FeedsController, :type => :request do\n include HTMLCompareHelper\n fixtures :all\n\n before :each do\n # The PHP app uses cac...
ruby
chosen
[ { "from": "system", "value": "Add specs to pass game view\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe \"games/show\", type: :view do\n before(:each) do\n @game = assign(:game, Game.create!(number_of_players: 2))\n end\n\n it \"renders attributes in <p>\" do\...
ruby
chosen
[ { "from": "system", "value": "Fix migration so you don't get duplicate parts." }, { "from": "human", "value": "class ConvertVersionedAssociationFromHashToObject < ActiveRecord::Migration\n def self.up\n Version.find(:all).each do |version|\n attributes = YAML::load(version.yaml)\n ...
ruby
chosen
[ { "from": "system", "value": "Change require rom to rom-core only\n" }, { "from": "human", "value": "require 'rom'\n\nrequire 'rom/yaml/version'\nrequire 'rom/yaml/gateway'\nrequire 'rom/yaml/relation'\n\nROM.register_adapter(:yaml, ROM::YAML)\n" }, { "from": "gpt", "value": "require...
ruby
chosen
[ { "from": "system", "value": "Remove accidental conflict in Prototype model\n" }, { "from": "human", "value": "class Spree::Prototype < ActiveRecord::Base\n<<<<<<< HEAD\n has_and_belongs_to_many :properties, :class_name => 'Spree::Property', :join_table => \"spree_properties_prototypes\"\n has...
ruby
chosen
[ { "from": "system", "value": "Add upper bounds to avoid Rails 5 libraries\n" }, { "from": "human", "value": "# coding: utf-8\nGem::Specification.new do |spec|\n spec.name = \"minidoc\"\n spec.version = \"0.0.1\"\n spec.authors = [\"Bryan Helmkamp\"]\n spec.email ...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary system test code\n\nIt turns out that we don't need to require system tests in the railties\ntest helper so we can remove it. If you're using system tests they will\nbe loaded by inheriting from ActionDispatch::SystemTestCase and the\nroutes will be loaded by...
ruby
chosen
[ { "from": "system", "value": "Include Capybara::DSL instead of deprecated Capybara in integration spec.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe \"Navigation\" do\n include Capybara\n \n it \"should be a valid app\" do\n ::Rails.application.should be_a(Dummy::Ap...
ruby
chosen
[ { "from": "system", "value": "Remove the Tagging menu for the configuration profiles list - as this feature is not yet added\n" }, { "from": "human", "value": "class ApplicationHelper::Toolbar::ConfigurationManagerProviderCenter < ApplicationHelper::Toolbar::Basic\n button_group('provider_vmdb'...
ruby
chosen
[ { "from": "system", "value": "Add more tests for chefspec\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nrequire_relative 'spec_helper'\n\ndescribe 'ndenv::default' do\n subject { ChefSpec::Runner.new.converge(described_recipe) }\n\n # Write full examples using the `expect` synt...
ruby
chosen
[ { "from": "system", "value": "Replace short form with descriptive test\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe \"Example API\", type: :apivore, order: :defined do\n\n include Apivore::RspecHelpers\n\n subject { Apivore::SwaggerChecker.instance_for(\"/swagger-doc.js...
ruby
chosen
[ { "from": "system", "value": "Add tests to see how knapsack_pro handle case then someone stub Time.now\n" }, { "from": "human", "value": "describe 'Timecop' do\n let(:time_1) { Time.local(2015, 12, 1) }\n let(:time_2) { Time.local(2016, 1, 21) }\n\n it 'travel in time' do\n Timecop.travel(...
ruby
chosen
[ { "from": "system", "value": "Add React dependency to podspec\n\nAdd React dependency to podspec to support CocoaPods 1.5.0\r\n\r\nCocoaPods 1.5.0 does no longer add all header search paths for each xcconfig generated and instead, it only adds the header search paths for the dependencies of the pod as state...
ruby
chosen
[ { "from": "system", "value": "Fix bug on path to erb views\n" }, { "from": "human", "value": "get '/contribute' do\n erb :'/contribute'\nend\n\nget '/brands/new' do\n erb :'/new_brand'\nend\n\npost 'brands' do\n @brand = Brand.new(params[])\nend" }, { "from": "gpt", "value": "get ...
ruby
chosen
[ { "from": "system", "value": "Remove AS declarative extension from erb tag test\n\nThe extension was removed in 22bc12ec374b8bdeb3818ca0a3eb787dd3ce39d8,\nmaking \"test\" an alias for minitest's \"it\".\n" }, { "from": "human", "value": "require \"abstract_unit\"\nrequire \"template/erb/helper\"...
ruby
chosen
[ { "from": "system", "value": "Reimplement NullResolver on base resolver\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire \"action_view/template/resolver\"\n\nmodule ActionView #:nodoc:\n # Use FixtureResolver in your tests to simulate the presence of files on the\n #...
ruby
chosen
[ { "from": "system", "value": "Update HandbrakeCLI Nightly to v6945svn\n\nHandBrakeCLI Nightly v6945svn built 2015-02-28.\n" }, { "from": "human", "value": "cask :v1 => 'handbrakecli-nightly' do\n version '6937svn'\n sha256 '90b9a33ea8e87c3a0a7ce1bb68bc71a63973800cfe373e5a67960ea573db3877'\n\n ...
ruby
chosen
[ { "from": "human", "value": "Make sure we remove old guides that may not exist\n\nThere are 4 guides from the previous version of this migration that\ndon't appear to exist in the DB anymore, but some of them exist in the\nsearch index. This tries to de-index the documents from ElasticSearch\neven if they d...
ruby
chosen
[ { "from": "system", "value": "Fix missing `end` in data migration\n\nA syntax error is preventing the data migration from running.\nFix this by adding the missing `end` for the `if` construct.\n" }, { "from": "human", "value": "# Unpublish guidance/seed-enterprise-investment-scheme-procedures an...
ruby
chosen
[ { "from": "system", "value": "Allow successive calls to rake db:seed\n" }, { "from": "human", "value": "admin = User.get_from_ENV\n\nblock_list = BlockList.create(\n :name => 'Testing12',\n :description => 'for testing, maintenence, etc',\n :expires => nil,\n)\n\nAdmin.create(\n...
ruby
chosen
[ { "from": "system", "value": "Remove invitations step for now\n" }, { "from": "human", "value": "class Admin::AfterCreateController < Admin::AdminController\n include Wicked::Wizard\n steps :guide, :privacy, :logo, :events, :invitations, :done\n\n def show\n case step \n when :invitatio...
ruby
chosen
[ { "from": "system", "value": "Fix Rails 5.1 ActionController::TestRequest.create expect at least 1 argument problem.\n" }, { "from": "human", "value": "require 'spec_helper'\n\nclass WechatApiController < ActionController::API\nend\n\nRSpec.describe WechatApiController, type: :controller do\n i...
ruby
chosen
[ { "from": "system", "value": "Switch from .where(...).first to .first(...)\n" }, { "from": "human", "value": "get \"/solve\" do\n redirect \"/\"\nend\n\nget \"/solve/brest_submit\" do\n erb :solve_submission\nend\n\npost \"/solve/brest_parse\" do\n result = ReconDatabase::BrestParser.new(para...
ruby
chosen
[ { "from": "system", "value": "Remove unused memberCorporations rowset from Eve::AllianceList.\n" }, { "from": "human", "value": "require_relative \"../base_item\"\n\nmodule Greeve\n module Eve\n # Returns active alliances in New Eden and their member corporations.\n #\n # @see https://...
ruby
chosen
[ { "from": "system", "value": "Sort params keys before mapping to force order.\n" }, { "from": "human", "value": "require 'rack/response'\n\nmodule Rack\n module LinkHeaders\n # Helper for easy adding link headers to rack responses.\n module Helper\n def self.included(base)\n b...
ruby
chosen
[ { "from": "system", "value": "Allow users to pass through additional validation options\n\n- Like `on: :update`\n" }, { "from": "human", "value": "module SimplestPhoto\n module HasPhoto\n\n def has_photo(name, required: false)\n has_one :\"#{name}_attachment\",\n -> { where...
ruby
chosen
[ { "from": "system", "value": "Update exe to remove bang off run method\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\nrequire 'gmail/slack/notifier'\n\nGmail::Slack::Notifier.new.run!\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\n\nrequire 'gmail/slack/notifier'\n\...
ruby
chosen
[ { "from": "system", "value": "Allow white space after class name for Ruby 1.8.7" }, { "from": "human", "value": "require 'delayed_job_mongoid'\n\nmodule Vidibus\n module WatchFolder\n class Job < Struct.new(:uuid, :event, :path, :checksum, :delay)\n def enqueue!\n validate!\n ...
ruby
chosen
[ { "from": "system", "value": "Upgrade Vivaldi.app (Snapshot) to v1.0.219.51\n" }, { "from": "human", "value": "cask :v1 => 'vivaldi-snapshot' do\n version '1.0.209.3'\n sha256 '07067b11414f7dffff6fb03deb832fdd23bef64cfc67c27911f2c131842d8641'\n\n url \"https://vivaldi.com/download/snapshot/Vi...
ruby
chosen
[ { "from": "system", "value": "Exclude object files from rdoc\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'ffi'\n s.version = '1.5.0'\n s.author = 'Wayne Meissner'\n s.email = 'wmeissner@gmail.com'\n s.homepage = 'http://wiki.github.com/ffi/ffi'\n s.summary =...
ruby
chosen
[ { "from": "system", "value": "Move rails dependency to runtime one\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'arproxy/query_caller_location_annotator/version'\n\nGem::Specificat...
ruby
chosen
[ { "from": "system", "value": "Add link to article to notification message\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n# == Schema Information\n# Table name: alerts\n#\n# id :integer not null, primary key\n# course_id :integer\n# user_id ...
ruby
chosen
[ { "from": "system", "value": "Make default_environment a class method\n\nAs instance methods are deprecated since this PR[0].\n\n[0] `https://github.com/solidusio/solidus/pull/4064`\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass Spree::AvataxConfiguration < Spree::Pref...
ruby
chosen
[ { "from": "system", "value": "Fix syntax error in gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'torasup/version'\n\nGem::Specification.new do |gem|\n gem.name ...
ruby
chosen
[ { "from": "human", "value": "Add NR stats to country statistics\n" }, { "from": "gpt", "value": "class AddNrFieldsToCountryStatistics < ActiveRecord::Migration\n def change\n add_column :country_statistics, :percentage_nr_land_cover, :float\n add_column :country_statistics, :percentage_nr...
ruby
chosen
[ { "from": "system", "value": "Disable rate-limiter rejection tracking on notification email worker" }, { "from": "human", "value": "class NotificationEmailWorker\n include Sidekiq::Worker\n \n sidekiq_options congestion: {\n interval: 1.hour,\n max_in_interval: 10,\n min_delay: 5.min...
ruby
chosen
[ { "from": "system", "value": "Add require Client on top\n" }, { "from": "human", "value": "require 'amazon-drs/version'\n\nmodule AmazonDrs\n # Your code goes here...\nend\n" }, { "from": "gpt", "value": "require 'amazon-drs/version'\nrequire 'amazon-drs/client'\n\nmodule AmazonDrs\...
ruby
chosen
[ { "from": "system", "value": "Add .pre for next release\n\nChange-Id: I52cd42b0bbd79d676ed6164803886e7b5384b935\nReviewed-on: http://review.engineyard.com/261\nReviewed-by: Sam Merritt <5aec43857f03982d0d771daf2f8c2a359d3ce580@engineyard.com>\nTested-by: Sam Merritt <5aec43857f03982d0d771daf2f8c2a359d3ce580...
ruby
chosen
[ { "from": "system", "value": "Convert ternary expression into if/else in S3Storage.build\n\nI'm about to make this logic more complicated and I think it will be\neasier to see the changes if I make this change first.\n" }, { "from": "human", "value": "require 's3_storage/null'\n\nclass S3Storage...
ruby
chosen
[ { "from": "human", "value": "Add some tests for numbers that weren't working with Phonie\n" }, { "from": "gpt", "value": "require 'test_helper'\n\nmodule Fakie\n class SpotTest < TestCase\n def test_fr\n phone_number = PhoneNumber.parse('+33 06 61 25 00 00')\n assert_equal 'FR', ph...
ruby
chosen
[ { "from": "system", "value": "Fix bug; make use of basic java.io.* classes more JRuby-ish\n" }, { "from": "human", "value": "require 'saxon/xslt/version'\nrequire 'java'\n$CLASSPATH << File.expand_path('../../../vendor/saxonica/saxon9he.jar', __FILE__)\n$CLASSPATH << File.expand_path('../../../v...
ruby
chosen
[ { "from": "human", "value": "Add boilerplate to begin testing Posts\n" }, { "from": "gpt", "value": "require 'minitest_helper'\n\n# MediumSpec is used to test the main Medium SDK Client\nmodule MediumSpec\n describe 'Medium Posts Client', 'The Medium SDK Gem Posts Resource Client' do\n befor...
ruby
chosen
[ { "from": "system", "value": "Add exceptions to CLI test\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass CliTest < MiniTest::Test\n\n def test_list\n cli = Cheatly::CLI.new([], nopaginate: true, test: true)\n cli.list\n\n cli = Cheatly::CLI.new([], local: true, nopagi...
ruby
chosen
[ { "from": "system", "value": "Change the quick test script to use a doc object\n\nThis allows using markdownlint's doc object methods as used in rules when\ntroubleshooting a document.\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n# Quick script for viewing getting at kramdown's view o...
ruby
chosen
[ { "from": "system", "value": "Fix test for ruby <= 2.2\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass Tumugi::Target::FileTargetTest < Test::Unit::TestCase\n sub_test_case '#exist?' do\n setup do\n @file = Tempfile.new\n end\n\n teardown do\n @file.close!\n...
ruby
chosen
[ { "from": "system", "value": "Improve description and add homepage\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'pessimize/version'\n\nGem::Specification.new do |gem|\n ...
ruby
chosen
[ { "from": "system", "value": "Enforce Capybara ~> 2.0, since Poltergeist fails with 2.1\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/phantomjs/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Christoph Olszowka\"]\...
ruby
chosen
[ { "from": "system", "value": "Add Chas and Marek as contributors\n" }, { "from": "human", "value": "lib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'shameless/version'\n\nGem::Specification.new do |spec|\n spec.name = \"shame...
ruby
chosen
[ { "from": "system", "value": "Make character_classes compatible with Ruby 1.8.\n" }, { "from": "human", "value": "require 'cowsay/version'\nrequire 'cowsay/character'\n\nmodule ::Cowsay\n module_function # all instance methods are available on the module (class) level\n\n def random_character\...
ruby
chosen
[ { "from": "system", "value": "Add space at bottom of file\n" }, { "from": "human", "value": "require \"hanvox/proc_audio\"\nrequire \"hanvox/raw\"\nrequire \"hanvox/version\"\n\nmodule Hanvox\n \nend" }, { "from": "gpt", "value": "require \"hanvox/proc_audio\"\nrequire \"hanvox/raw\...
ruby
chosen
[ { "from": "system", "value": "Use constant instead of global variable.\n" }, { "from": "human", "value": "require 'mactag/railtie'\nrequire 'mactag/config'\nrequire 'mactag/builder'\nrequire 'mactag/dsl'\nrequire 'mactag/tag'\n\nmodule Mactag\n autoload :Bundler, 'bundler'\n autoload :Rails, '...
ruby
chosen
[ { "from": "system", "value": "Read server port from ENV" }, { "from": "human", "value": "require 'eventmachine'\nrequire 'thin'\n\nclass Spotbot::Runner\n\n # We use a logger to print some information on when things are happening.\n $stderr.sync = true\n $logger = Logger.new($stderr)\n $logg...
ruby
chosen
[ { "from": "system", "value": "Fix production code for passing test.\n" }, { "from": "human", "value": "require \"ruzai2/version\"\nrequire \"active_support\"\nrequire \"active_support/core_ext\"\nrequire \"active_record\"\n\nmodule Ruzai2\n class RuzaiList < ActiveRecord::Base\n class << sel...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary class specification from factory" }, { "from": "human", "value": "# -*- encoding : utf-8 -*-\n# Read about factories at https://github.com/thoughtbot/factory_girl\n\nFactoryGirl.define do\n factory :organ do\n factory :tasa_arvotyoryhma, :clas...
ruby
chosen
[ { "from": "system", "value": "Disable connections in integration tests\n" }, { "from": "human", "value": "require 'test_helper'\nrequire 'capybara/rails'\nrequire 'webmock'\n\nDatabaseCleaner.strategy = :transaction\n\nclass ActionDispatch::IntegrationTest\n include Capybara::DSL\n include Web...
ruby
chosen
[ { "from": "human", "value": "Add moovy spec directory and movie spec\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Moovy::Movie do\n it 'allows me to search for a movie title' do\n movies = Moovy::Movie.search('Frozen')\n expect(movies).to_not eql([])\n expect(movi...
ruby
chosen
[ { "from": "system", "value": "Update to latest rethinkdb library (v1.11.0.1)\n" }, { "from": "human", "value": "# encoding: utf-8\n$:.unshift File.expand_path(\"../lib\", __FILE__)\n$:.unshift File.expand_path(\"../../lib\", __FILE__)\n\nrequire 'no_brainer/version'\n\nGem::Specification.new do ...
ruby
chosen
[ { "from": "system", "value": "Support Erlang 17.0-rc1 with kerl" }, { "from": "human", "value": "default[:kerl][:releases] = %w(R14B02 R14B03 R14B04 R15B R15B01 R15B02 R15B03 R16B R16B01 R16B02 R16B03 R16B03-1)\ndefault[:kerl][:path] = \"/usr/local/bin/kerl\"\n" }, { "from": "gpt", ...
ruby
chosen
[ { "from": "system", "value": "Update gemspec to allow bundler 2.x\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'powerpack/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Add last test, which already passes\n" }, { "from": "human", "value": "require 'test/unit'\nrequire 'jsshuffle'\nrequire 'execjs'\n\nclass ParameterRenamingTest < Test::Unit::TestCase\n def test_can_include\n assert_nothing_raised do\n @shuffler...
ruby
chosen
[ { "from": "system", "value": "Update bash-it sha to latest for chruby support\n\n * existing version is from Aug 2012\n * changes: https://github.com/revans/bash-it/compare/5cb0ecc...8bf641b\n" }, { "from": "human", "value": "node.default['versions']['bash_it'] = '5cb0ecc1c813bc5619e0f708b8015...
ruby
chosen
[ { "from": "system", "value": "Revert \"Retains compatibility with 0.60.4\"\n\nThis reverts commit 8a4f12d0f09626d9ada0bf76f20c417597cd034e.\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.platform = Gem::Platform::RUBY\n s.name = 'spree_log_viewer'\n s.version ...
ruby
chosen
[ { "from": "system", "value": "Update my email address in the gemspec\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\n\nGem::Specification.new do |spec|\n spec.name = 'yubioath'\n s...
ruby
chosen
[ { "from": "system", "value": "Include BookKeeping version in crypto-square example solution\n" }, { "from": "human", "value": "class Crypto\n\n def initialize(plaintext)\n @plaintext = plaintext\n end\n\n def normalize_plaintext\n @normalized ||= @plaintext.downcase.gsub(/\\W/, '')\n e...
ruby
chosen
[ { "from": "system", "value": "Use Pavlov syntax for search interactor\n" }, { "from": "human", "value": "module Pavlov\n module SearchHelper\n def keywords_longer_than_chars(keywords, nr)\n keywords.split(/\\s+/).select{|x|x.length > nr}.join(\" \")\n end\n def search_with query_n...
ruby
chosen
[ { "from": "system", "value": "Add rake-compiler to development dependencies.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'rb_tuntap/version'\n\nGem::Specification.new do |spec|\n ...
ruby
chosen