conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Add full code for jungle doctor who" }, { "from": "gpt", "value": "use_bpm 120\n\nlive_loop :bass_line do\n use_synth :prophet\n \n play (ring :e2, :e2, :e2, :e2, :r, :r,\n :e2, :e2, :e2, :e2, :r, :r,\n :e2, :e2, :e2, :e2, :r, :r,\n :g2, :r, :...
ruby
chosen
[ { "from": "system", "value": "Fix wrong added lines regex\n\n+ string should be escaped on the regex" }, { "from": "human", "value": "require \"danger/plugin_support/plugin\"\n\n# Danger\nmodule Danger\n # Handles interacting with local only plugin inside a Dangerfile.\n # It is support pluggi...
ruby
chosen
[ { "from": "system", "value": "Remove dotenv dependency until 1.0 is released\n\nOtherwise there is a circular 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 'dotenv/deploy...
ruby
chosen
[ { "from": "system", "value": "Call super for normal inherited behaviour\n" }, { "from": "human", "value": "module RequestLogAnalyzer\n module ClassLevelInheritableAttributes\n def inheritable_attributes(*args)\n @inheritable_attributes ||= [:inheritable_attributes]\n @inheritable_a...
ruby
chosen
[ { "from": "system", "value": "Add client logic to import worker.\n" }, { "from": "human", "value": "class DailyImportWorker\n include Sidekiq::Worker\n sidekiq_options queue: 'daily_import'\n\n def perform\n User.create(email: \"me@example.com\")\n end\nend\n" }, { "from": "gpt", ...
ruby
chosen
[ { "from": "system", "value": "Fix order in tournament report\n" }, { "from": "human", "value": "require 'open-uri'\n\nclass Rpt::TournamentReportsController < Rpt::AbstractReportController\n helper_method :self_promoter\n\n def show\n @tournament = Tournament.yr(@year).find(params[:id])\n ...
ruby
chosen
[ { "from": "system", "value": "Update the help topics based on changed man pages.\n" }, { "from": "human", "value": "# Do not edit this file by hand\n# This file is autogenerated by the docs:list rake task from the available manpages\n\nHELP_TOPICS = [\"chef-shell\", \"knife-bootstrap\", \"knife-...
ruby
chosen
[ { "from": "system", "value": "Fix syntax error in FTPS adapter\n" }, { "from": "human", "value": "require 'dandelion/utils'\n\nmodule Dandelion\n module Adapter\n class FTPS < Dandelion::Adapter::FTP\n include ::Dandelion::Utils\n\n adapter 'ftps'\n\n def initialize(config)\n ...
ruby
chosen
[ { "from": "system", "value": "Handle timezones properly when writing events to CSV.\n" }, { "from": "human", "value": "class EventListFileWriter\n def write events, file_name\n CSV.open(file_name, \"wb\") do |csv|\n csv << [\"Group name\", \"Event name\", \"Day of week\", \"Date\", \"St...
ruby
chosen
[ { "from": "system", "value": "Use exception-raising method setup functions\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Pango\n load_class :Language\n\n class Language\n setup_instance_method 'get_scripts'\n\n def get_scripts_with_override\n result = ge...
ruby
chosen
[ { "from": "system", "value": "Change Datamatrix height on ZPL2\n" }, { "from": "human", "value": "module Languages\n class Zpl2\n class BarcodeFactory\n def self.create_barcode(font, code_type, opts = {})\n if Barcode1D::BarcodeClasses.keys.include? code_type\n Barcode1D...
ruby
chosen
[ { "from": "system", "value": "Fix for single values that were being returned as arrays incorrectly." }, { "from": "human", "value": "module Plucky\n class CriteriaMerger\n def self.merge(hash, other)\n hash.dup.tap do |target|\n other.keys.each do |key|\n if target[key]....
ruby
chosen
[ { "from": "system", "value": "Support puppet parsing while oratab is not available\n" }, { "from": "human", "value": "newparam(:sid) do\n include EasyType\n\n desc \"SID to connect to\"\n\n to_translate_to_resource do | raw_resource|\n \traw_resource.column_data('SID')\n end\n\nend\n\n" }...
ruby
chosen
[ { "from": "system", "value": "Normalize non-alphanumerics in database name\n" }, { "from": "human", "value": "Rails::Application::Configuration.class_eval do\n\n def database_configuration_with_default\n config_file =\n begin\n database_configuration_without_default\n rescue...
ruby
chosen
[ { "from": "system", "value": "Remove to_s on html attributes delegation.\n" }, { "from": "human", "value": "module ElementFactory\n class Element\n attr_accessor :name, :attributes\n\n def initialize(name, attributes_or_string=nil)\n @name = name.to_s\n @attributes = coerce_attr...
ruby
chosen
[ { "from": "system", "value": "Clarify that HtmlValidator takes a Govspeak string\n\nThe name might lead you to think it takes HTML - that's what is being assumed\nin govuk_content_models.\n" }, { "from": "human", "value": "class Govspeak::HtmlValidator\n attr_reader :string\n\n def initialize(...
ruby
chosen
[ { "from": "system", "value": "Remove version lock from Mementus dependency\n" }, { "from": "human", "value": "$:.push File.expand_path('../lib', __FILE__)\n\nrequire 'yarrow/version'\n\nGem::Specification.new do |spec|\n spec.name = 'yarrow'\n spec.version = Yarrow::VERSION\n spec....
ruby
chosen
[ { "from": "system", "value": "Fix malformed URI in error message in UmapiClient\n" }, { "from": "human", "value": "require 'faraday'\nrequire 'faraday_middleware'\nrequire 'ostruct'\nrequire 'corefines'\n\nmodule SiriusApi\n class UmapiClient\n\n using Corefines::Object::in?\n\n def initi...
ruby
chosen
[ { "from": "human", "value": "Add rake task to import staging data" }, { "from": "gpt", "value": "namespace :db do\n desc \"Import data from staging environment\"\n task :import => [:environment, :drop, :create] do\n Bundler.with_clean_env do\n dump_name = \"latest.sql\"\n system(...
ruby
chosen
[ { "from": "human", "value": "Test failure cases with Organizers\n" }, { "from": "gpt", "value": "require 'spec_helper'\nrequire 'test_doubles'\n\nRSpec.describe LightService::Organizer do\n class TestSkipBefore\n extend LightService::Organizer\n def self.call\n with(:number => 1)\n ...
ruby
chosen
[ { "from": "human", "value": "Add data migration to fix measure 2984812 end date as it's different on EU TARIC\n" }, { "from": "gpt", "value": "TradeTariffBackend::DataMigrator.migration do\n name \"Set end date for measure sid 2984812 as we have discrepancy in data between the Trade Tariff\" \\...
ruby
chosen
[ { "from": "human", "value": "Change cloud tenants description to text\n\nThe 255 character limit on the cloud tenant description field causes inventory\ncollection to irreparably fail with the error:\n\nPGError: ERROR: value too long for type character varying(255)\n\nSince OpenStack allows a tenant descri...
ruby
chosen
[ { "from": "system", "value": "Use HOMEBREW_PREFIX/opt to find installs instead of symlinks in bin, lib, sbin.\n\nCloses Homebrew/homebrew#25868.\n\nSigned-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>\n" }, { "from": "human", "value": "require 'extend/pathname'\n\n...
ruby
chosen
[ { "from": "system", "value": "Delete nav items when the nav is deleted.\n" }, { "from": "human", "value": "class Navigation < ActiveRecord::Base\n validates :description, presence: true\n validates :name, presence: true, uniqueness: { case_sensitive: false }\nend\n" }, { "from": "gpt",...
ruby
chosen
[ { "from": "human", "value": "Add compound operator_id and id index to SSPs\n" }, { "from": "gpt", "value": "class AddOperatorIdAndIdCompoundIndexToSSPs < ActiveRecord::Migration\n def change\n add_index :current_schedule_stop_pairs, [:operator_id, :id] unless index_exists?(:current_schedule_...
ruby
chosen
[ { "from": "system", "value": "Use local variables in peertransfer_chat\n" }, { "from": "human", "value": "require 'slackr'\n\nmodule PeertransferChat\n class Client\n\n def self.upload(filename)\n new.upload(filename)\n end\n\n def self.speak(something)\n new.speak(something)...
ruby
chosen
[ { "from": "human", "value": "Maintenance: Enable `allow_reload` for Capybara find methods to avoid Selenium::WebDriver::Error::StaleElementReferenceError exceptions.\n" }, { "from": "gpt", "value": "# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/\n\n# This file overwri...
ruby
chosen
[ { "from": "system", "value": "Update DBeaver enterprise to v3.1.5\n" }, { "from": "human", "value": "cask :v1 => 'dbeaver-enterprise' do\n version '3.1.4'\n\n if Hardware::CPU.is_32_bit?\n sha256 '5e3c5bab9d1ee2ba811c019f8c062cdaec8930b39ae97b16fa0fe2011e997496'\n url \"http://dbeaver.jk...
ruby
chosen
[ { "from": "system", "value": "Remove edit/write actions from raw handler\n" }, { "from": "human", "value": "class RawHandler < Compound::Handler\n\n\tdef view(path)\n\t\theaders \"Content-Type\" => \"text/plain\"\n\t\tFile.open(path){ |f| f.read }\n\tend\n\n\tdef edit(path)\n\t\theaders \"Conten...
ruby
chosen
[ { "from": "system", "value": "Fix another warning in more recent Ruby versions\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule DeepCover\n module StructWithOptions\n module Initializer\n def initialize(*args, **options)\n super(*args, options)\n en...
ruby
chosen
[ { "from": "human", "value": "Improve reasoning of log lines in threaded processes.\n" }, { "from": "gpt", "value": "# This customization adds the id of the current Thread to all log lines.\n# It was introduced to make it more easy to follow the execution of tasks in the log in threaded processes...
ruby
chosen
[ { "from": "system", "value": "Sort search result if use PGroonga\n" }, { "from": "human", "value": "module FullTextSearch\n module PGroonga\n def self.prepended(base)\n base.extend(ClassMethods)\n end\n\n module ClassMethods\n # Overwrite ActsAsSearchable\n def search_to...
ruby
chosen
[ { "from": "system", "value": "Fix base url and api version in swagger.\n" }, { "from": "human", "value": "require_relative 'v0/api'\nrequire 'grape-swagger'\n\nclass ApiV0 < Grape::API\n\n swagger_path = 'swagger'\n\n get do\n # Redirect base url to Swagger docs\n redirect \"http://petst...
ruby
chosen
[ { "from": "system", "value": "Add a beer creation in the app\n" }, { "from": "human", "value": "require 'rubygems'\n\n# dependencies\nrequire 'bundler/setup'\nrequire \"cuba\"\nrequire 'data_mapper'\nrequire 'slim'\n\n# app\nrequire \"./app\"\nDir[\"./models/*.rb\"].each {|file| require file }\n...
ruby
chosen
[ { "from": "system", "value": "Add OS / .NET detection to the installer. Tested working\n\n\nFormer-commit-id: 5b0246ae2b5f8c1c1d21b31cc2f2c0d431918e32" }, { "from": "human", "value": "\n#\n# Cookbook Name:: ms_dotnet35\n# Recipe:: default\n#\n# Copyright 2012, Webtrends Inc.\n#\n# All rights re...
ruby
chosen
[ { "from": "system", "value": "Make show route more defensive\n" }, { "from": "human", "value": "require './config/environment'\nrequire 'sinatra/base'\n\nclass App < Sinatra::Base\n\n # config.yml file must be created first (in config folder)\n configure do\n yaml = YAML.load_file(\"config/...
ruby
chosen
[ { "from": "system", "value": "Add bower_components to asset path\n" }, { "from": "human", "value": "require File.expand_path('../boot', __FILE__)\n\nrequire 'rails/all'\n\n# Require the gems listed in Gemfile, including any gems\n# you've limited to :test, :development, or :production.\nBundler....
ruby
chosen
[ { "from": "system", "value": "Add explicit check for invite code envar\n" }, { "from": "human", "value": "require File.expand_path('../boot', __FILE__)\n\nrequire 'rails/all'\n\n# Require the gems listed in Gemfile, including any gems\n# you've limited to :test, :development, or :production.\nBu...
ruby
chosen
[ { "from": "system", "value": "Use correct pidfile in development mode\n" }, { "from": "human", "value": "listen 8080\npreload_app false\nstdout_path '/dev/null'\n\nclass DevWorker\n class <<self\n attr_accessor :attempts\n end\n @attempts = []\nend\n\nbefore_fork do |_, _|\n DevWorker.att...
ruby
chosen
[ { "from": "system", "value": "Make the entire internal channel private\n" }, { "from": "human", "value": "module ActionCable\n module Connection\n module InternalChannel\n extend ActiveSupport::Concern\n\n def internal_redis_channel\n \"action_cable/#{connection_identifier}\...
ruby
chosen
[ { "from": "system", "value": "Refactor fact and node lookup\n\nRefactored the fact and node lookup to not use the\nterminus. The terminus could wind up looking\nin unexpected places and would introduce\nunnessary system requirements into the tests.\n" }, { "from": "human", "value": "module RSpec...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary foreign data source check\n\nIt seems unnecessary to make a call out to get the bank\nholiday data every time the suite of specs is run. Besides\nthis the actual test makes no assertion! & the attempt at\nan assertion incorrectly uses sets `proper_superset?`\...
ruby
chosen
[ { "from": "system", "value": "Add spec for initializing a Thread multiple times\n" }, { "from": "human", "value": "require File.expand_path('../../../spec_helper', __FILE__)\nrequire File.expand_path('../fixtures/classes', __FILE__)" }, { "from": "gpt", "value": "require File.expand_...
ruby
chosen
[ { "from": "system", "value": "Add step to verify original Grouping\n" }, { "from": "human", "value": "module KnowsTheDomain\n def itunes\n @itunes ||= Itunes.new\n end\nend\nWorld(KnowsTheDomain)\n\n# Scenario Outline: Get artist group and genre information\n\nGiven(/^track (\\d+)$/) do |tr...
ruby
chosen
[ { "from": "system", "value": "gemspec: Add GitHub repo as homepage\n\nFor automatic redirects from http://gem.wtf/decorate-responder :)" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib...
ruby
chosen
[ { "from": "system", "value": "Update the version guard to 3.0\n" }, { "from": "human", "value": "require_relative '../../spec_helper'\nrequire_relative 'fixtures/classes'\nrequire_relative 'shared/index'\n\nruby_version_is ''...'2.8' do\n describe \"Hash#index\" do\n it_behaves_like :hash_in...
ruby
chosen
[ { "from": "system", "value": "Fix for error message handling\n" }, { "from": "human", "value": "class QuestionsController < ApplicationController\n def index\n end\n\n def new\n if logged_in?\n @question = Question.new\n @tag = Tag.new\n else\n redirect_to login_path\n ...
ruby
chosen
[ { "from": "system", "value": "Add xhr handling for responses\n" }, { "from": "human", "value": "class ResponsesController < ApplicationController\n\n def new\n if current_user != nil\n @parent = parent_object\n @parent_name = @parent.class.name.downcase.pluralize\n @response =...
ruby
chosen
[ { "from": "system", "value": "Use mocha ~> 0.13.3 (so require \"mocha/setup\" works)\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/freeling/analyzer/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Damián Silvani\"]...
ruby
chosen
[ { "from": "system", "value": "Delete artefacts when changed to nonindexed kinds\n\nWe have had some artefacts created (incorrectly) as Answers when they should\nhave been CompletedTransactions. These were not removed automatically. This\nchange would ensure that they are in future.\n" }, { "from": "...
ruby
chosen
[ { "from": "system", "value": "[ibm] Remove IBM from flavors tests\n" }, { "from": "human", "value": "for provider, config in compute_providers\n\n next if [:glesys, :voxel].include?(provider)\n\n Shindo.tests(\"Fog::Compute[:#{provider}] | flavors\", [provider]) do\n\n flavors_tests(Fog::Co...
ruby
chosen
[ { "from": "human", "value": "Add implementation of tenth rule of disambiguator prefix\n" }, { "from": "gpt", "value": "module Sastrawi\n module Morphology\n module Disambiguator\n class DisambiguatorPrefixRule10\n def disambiguate(word)\n contains = /^me([lrwy])([aiueo])...
ruby
chosen
[ { "from": "system", "value": "Remove comment about functionality that isn't implemented.\n" }, { "from": "human", "value": "Synvert::Rewriter.new 'ruby', 'new_safe_navigation_operator' do\n description <<-EOF\nUse ruby new safe navigation operator.\n\n u && u.profile && u.profile.thumbnails ...
ruby
chosen
[ { "from": "system", "value": "Use different endpoint and response code to verify.\n" }, { "from": "human", "value": "require 'omniauth-github'\n\nmodule OmniAuth\n module Strategies\n class GitHubTeamMember < OmniAuth::Strategies::GitHub\n credentials do\n { 'team_member?' => git...
ruby
chosen
[ { "from": "system", "value": "Improve consistency: also mention the optional `gcm_url` option in the GCM pusher class\n" }, { "from": "human", "value": "\nmodule RubyPushNotifications\n module GCM\n\n # This class is responsible for sending notifications to the GCM service.\n #\n # @au...
ruby
chosen
[ { "from": "system", "value": "Add comment re inflection of \"specimen\"\n\nI thought this inflection was unnecessary, but I was wrong.\nAdded comment to avoid future confusion.\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\n# Add new inflection ...
ruby
chosen
[ { "from": "system", "value": "Use the BuilderSet class as the default for BuilderSet DSL methods.\n" }, { "from": "human", "value": "require 'bricks/dsl'\n\nmodule Bricks\n class BuilderSet\n include Bricks::DSL\n\n def build(klass)\n (@builders << super).last\n end\n\n def bui...
ruby
chosen
[ { "from": "system", "value": "Make paper trail use a user's name instead of id" }, { "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_forger...
ruby
chosen
[ { "from": "system", "value": "Update Ember Resolver version to 0.1.14\n" }, { "from": "human", "value": "module Ember\n module CLI\n module Resolver\n VERSION = '0.1.13'\n end\n end\nend\n" }, { "from": "gpt", "value": "module Ember\n module CLI\n module Resolver\n ...
ruby
chosen
[ { "from": "system", "value": "Disable regular authorship syncing for now\n\nexport.arxiv.org tends to ban our IP. Since the authorship\nupdate requests scale linearly with the number of users,\nthis may be the culprit. It's more important to keep the\ncore functionality of receiving new papers intact until ...
ruby
chosen
[ { "from": "system", "value": "Move chef dependency to development, to avoid unintended chef gem update\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'chef/provider/service/daemontoo...
ruby
chosen
[ { "from": "system", "value": "Revert jquery change as was in kelkoo-services branch\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"mixingpanel/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Spec...
ruby
chosen
[ { "from": "system", "value": "Improve concern syntax and definition\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n# Finds a unique permalink for a new or updated record.\n# It considers soft-deleted records which are ignored by Spree.\n# Spree's work:\n# https://github.com/...
ruby
chosen
[ { "from": "system", "value": "FIX: Correct issue with adding auth token in tests\n" }, { "from": "human", "value": "module TestHelpers\n #\n # Authentication test helper\n #\n module AuthHelper\n #\n # Gets an auth token for the provided user\n #\n def auth_token(user = User.firs...
ruby
chosen
[ { "from": "system", "value": "Order methods inside Exposures class\n" }, { "from": "human", "value": "require \"tsort\"\nrequire \"dry/view/exposure\"\n\nmodule Dry\n module View\n class Exposures\n include TSort\n\n attr_reader :exposures\n\n def initialize(exposures = {})\n ...
ruby
chosen
[ { "from": "system", "value": "Change description and home page\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'secure_link/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Set podspec version to 1.0.1\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n\n s.name = \"AppInfoTracker\"\n s.version = \"1.0.0\"\n s.summary = \"App information tracker for your iOS, OS X, and tvOS app\"\n\n s.description = <<-DESC...
ruby
chosen
[ { "from": "system", "value": "Fix params assignment in Authorizer for nested forms\n" }, { "from": "human", "value": "# frozen_string_literal: true\nmodule Panther\n class Authorizer\n class << self\n def authorize(model:, params:, operation:)\n assign_params(model, params)\n\n ...
ruby
chosen
[ { "from": "system", "value": "Add clear_query_on_selection option to search multi selection field." }, { "from": "human", "value": "require \"formalist/element\"\nrequire \"formalist/elements\"\nrequire \"formalist/types\"\n\nmodule Formalist\n class Elements\n class SearchMultiSelectionFiel...
ruby
chosen
[ { "from": "system", "value": "Move our validation check into the aptly named check_validity!\n" }, { "from": "human", "value": "# encoding: utf-8\n\nmodule Mongoid\n module Validatable\n\n # Monkey-patch for Mongoid's uniqueness validator to enforce that the :case_sensitive option does not w...
ruby
chosen
[ { "from": "system", "value": "Use new instead of create so we can just use objects." }, { "from": "human", "value": "require 'helper'\n\ndescribe Toy::Equality do\n uses_constants('User', 'Game', 'Person')\n\n describe \"#eql?\" do\n it \"returns true if same class and id\" do\n User.n...
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_commentable/simply_commentable'\n\n# From http://guides.rubyonrails.org/plugins.html#controllers\n# Fix for:\n...
ruby
chosen
[ { "from": "system", "value": "Make normalize_header_name work with already normalized names.\n" }, { "from": "human", "value": "module Skink\nmodule Client\n\nmodule Utils\n def normalize_header_name(name)\n # c.f http://en.wikipedia.org/wiki/List_of_HTTP_header_fields\n\n case name\n ...
ruby
chosen
[ { "from": "system", "value": "Change the spec to reflect default read_timeout change\n" }, { "from": "human", "value": "describe Net::Config do\n it \"can set connect_timeout\" do\n Net::Config.connect_timeout = 10\n Net::Config.connect_timeout.should == 10\n end\n\n it \"has a default ...
ruby
chosen
[ { "from": "system", "value": "Make sure Digest loading is thread-safe\n\nI'm defining the hashers in constants to avoid any performance overhead\nby the mutex since we hash a lot of URLs\n\nDigest() is only thread safe in Ruby 2.2.0 and newer. Patch:\nhttps://github.com/ruby/ruby/commit/c02fa39463a0c6bf698b...
ruby
chosen
[ { "from": "human", "value": "Test the existing behaviour of ResultSet.\n" }, { "from": "gpt", "value": "require \"test_helper\"\nrequire \"document\"\nrequire \"elasticsearch/result_set\"\n\nclass ResultSetTest < ShouldaUnitTestCase\n\n FIELDS = %w(link title description format)\n\n def mappin...
ruby
chosen
[ { "from": "system", "value": "Update in favor of Request class\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe OrchestrateIo::Request do\n class Client\n def version ; \"v0\" ; end\n\n def request(http_method, uri, options={})\n \"#{http_method} #{uri} with #{opt...
ruby
chosen
[ { "from": "system", "value": "Allow net connect after test suite for CodeClimate\n" }, { "from": "human", "value": "require \"codeclimate-test-reporter\"\nCodeClimate::TestReporter.start\n\nENV[\"RAILS_ENV\"] ||= 'test'\n\nrequire File.expand_path(\"../../config/environment\", __FILE__)\nrequire...
ruby
chosen
[ { "from": "system", "value": "Fix timeout variable in helper\n\nWill fix #51\n" }, { "from": "human", "value": "require 'timeout'\nrequire 'open-uri'\n\nmodule Nexus3\n # Helper library for testing Nexus3 responses\n module Helper\n # Raise an error in case Nexus takes a really long time to...
ruby
chosen
[ { "from": "system", "value": "Remove line in spec helper that caused a LoadError for rspec 2.9.0\n" }, { "from": "human", "value": "require \"spork\"\nrequire \"factory_girl\"\nrequire \"test/unit\"\nif RUBY_PLATFORM =~ /darwin/\n require \"spork/ext/ruby-debug\"\nend\n\nENV[\"RAILS_ENV\"] ||= ...
ruby
chosen
[ { "from": "system", "value": "Fix line endings to unix\n" }, { "from": "human", "value": "#\r\n# Author:: Adam Edwards (<adamed@getchef.com>)\r\n#\r\n# Copyright:: 2014, Chef Software, Inc.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file...
ruby
chosen
[ { "from": "system", "value": "Use non redundant simplecov matcher\n" }, { "from": "human", "value": "# encoding: utf-8\n\nif ENV['COVERAGE'] == 'true'\n require 'simplecov'\n\n SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[\n SimpleCov::Formatter::HTMLFormatter,\n ]\n\n Simple...
ruby
chosen
[ { "from": "system", "value": "Use bundler to get app path, and put scripts there.Try 2.\n" }, { "from": "human", "value": "\n=begin\n\n Fake extension building\n\n This allows for putting our bash scripts on the path, letting rubygems\n think we are compiling something...\n\n To fool rubygem...
ruby
chosen
[ { "from": "system", "value": "Update deprecated rspec usage of expect { }.should\n" }, { "from": "human", "value": "require File.expand_path('../../spec_helper', __FILE__)\n\ndescribe Faraday::Response do\n before do\n @client = Instagram::Client.new\n end\n\n {\n 400 => Instagram::BadR...
ruby
chosen
[ { "from": "system", "value": "Simplify actions list in BookingBug service" }, { "from": "human", "value": "class BookingBug\n class Config\n ATTRIBUTES = %w(environment company_id api_key app_id email password).freeze\n attr_accessor(*ATTRIBUTES)\n\n def initialize\n yield(self) i...
ruby
chosen
[ { "from": "system", "value": "Change instance variables to regular variables\n" }, { "from": "human", "value": "class Grid\n\n def initialize(window, user, mapfile, tileset, program_file=nil)\n @window, @user = window, user\n @map = Map.new(window, mapfile, tileset)\n\n create_programs...
ruby
chosen
[ { "from": "system", "value": "Remove now extranneous strict requirement of 1.8+\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |gem|\n gem.authors = [\"John Bintz\"]\n gem.email = [\"john@coswellproductions.com\"]\n gem.description = %q...
ruby
chosen
[ { "from": "system", "value": "Set mime type when displaying errors in browser\n\nPresent content for 500 handler\n" }, { "from": "human", "value": "module Pakyow\n module Middleware\n class Router\n def initialize(app)\n @app = app\n end\n\n def call(env)\n catch...
ruby
chosen
[ { "from": "system", "value": "Add page and file actions to controller\n" }, { "from": "human", "value": "class DownloadsController < ApplicationController\nend\n" }, { "from": "gpt", "value": "class DownloadsController < ApplicationController\n def page\n end\n\n def file\n coo...
ruby
chosen
[ { "from": "system", "value": "Add missing authors to gemspec\n" }, { "from": "human", "value": "$LOAD_PATH.push File.expand_path('../lib', __FILE__)\n\n# Maintain your gem's version:\nrequire 'lit/version'\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |s|\n s.n...
ruby
chosen
[ { "from": "system", "value": "Update podspec to version 1.1.9\n" }, { "from": "human", "value": "Pod::Spec.new do | s |\n s.name = 'ActionSheetPicker-3.0'\n s.version = '1.1.8'\n s.summary = 'Better version of ActionSheetPicker with support iOS7 and other improvements.'\n s.homepage ...
ruby
chosen
[ { "from": "system", "value": "Deploy to a different context to avoid overlapping the other backgroundable test.\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'torquebox-messaging'\n\ndescribe \"backgroundable tests\" do\n\n deploy <<-END.gsub(/^ {4}/,'')\n ---\n applic...
ruby
chosen
[ { "from": "system", "value": "Resolve ambiguous match spec error in class_manager\n\nResolve spec error:\n\n Create-a-Class page when signed in as a Teacher with no existing classes selecting the Classes tab navigates to create-a-class\n\n Failure/Error: end\n\n Capybara::Ambiguous:\n Ambiguous match,...
ruby
chosen
[ { "from": "system", "value": "Test multiple operating systems for policy\n\nUse on_supported_os function to test multiple\noperating systems for class neutron::policy.\n\nChange-Id: I6c486fccc5160d3418b5b5c8631158d7f2d7f350\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'ne...
ruby
chosen
[ { "from": "system", "value": "Fix HeaderUtils to support ruby version on CentOS 7\n\nApparently, the ruby 2.0.0-p598 (CentOS 7 default) breaks with the code\nwe were using. This commit replace it with a different syntax that\nshould be reverted when CentOS 7 updates its ruby.\n" }, { "from": "human"...
ruby
chosen
[ { "from": "system", "value": "Test extra args get passed through\n" }, { "from": "human", "value": "require File.expand_path(File.dirname(__FILE__) + '/spec_helper')\nrequire 'time'\n\ndescribe PagerDutyRestClient do\n subject {PagerDutyRestClient.new('orgname', 'user@orgname.com', 'password')}...
ruby
chosen
[ { "from": "system", "value": "Update helper to return empty string when status number is blank\n" }, { "from": "human", "value": "module Referrals\n module WithdrawalHelper\n def withdrawal_status_by_number(number)\n t(\"activerecord.attributes.referrals/withdrawal.status.#{::Referrals:...
ruby
chosen
[ { "from": "system", "value": "Fix potential memory leak introduced in commit 2b98f98beb\n" }, { "from": "human", "value": "module Rip::Nodes\n class Character < Base\n attr_reader :data\n\n def initialize(location, data)\n super(location)\n @data = data.to_sym\n end\n\n de...
ruby
chosen
[ { "from": "human", "value": "Add stub rspec test to unicornherder module\n" }, { "from": "gpt", "value": "require_relative '../../../../spec_helper'\n\ndescribe 'unicornherder', :type => :class do\n\n it { is_expected.to compile }\n\n it { is_expected.to compile.with_all_deps }\n\n it { is_ex...
ruby
chosen
[ { "from": "system", "value": "Update formula to version 4.3.2\n" }, { "from": "human", "value": "class Bartycrouch < Formula\n desc \"Incrementally update/translate your Strings files\"\n homepage \"https://github.com/Flinesoft/BartyCrouch\"\n url \"https://github.com/Flinesoft/BartyCrouch.gi...
ruby
chosen