conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Fix lame reg engine workaround\n" }, { "from": "gpt", "value": "Gem::Specification.new do |s|\n s.name = \"registration_engine\"\n s.version = \"0.0.1\"\n s.authors = [ \"Scott Willson\" ]\n s.email = [ \"scott.willson@gmail.com\" ]\n s.home...
ruby
chosen
[ { "from": "system", "value": "Update gemspec for new release.\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'capistrano-deploytags'\n s.version = '0.5.2'\n s.date = '2012-04-02'\n s.summary = \"Add dated, environment-specific tags to your g...
ruby
chosen
[ { "from": "system", "value": "Fix method name in buffer spec" }, { "from": "human", "value": "require_relative \"../lib/buffer\"\n\nRSpec.describe Buffer do\n let(:buffer) { Buffer.new \"8675309\", [\"Go\", \"CSS\"] }\n let(:repo1) { double language: \"JavaScript\" }\n let(:repo2) { double la...
ruby
chosen
[ { "from": "human", "value": "Add spec for refresh_workers toolbar button\n" }, { "from": "gpt", "value": "describe ApplicationHelper::Button::RefreshWorkers do\n describe '#visible?' do\n %w(download_logs evm_logs audit_logs).each do |lastaction|\n context \"action #{lastaction} being t...
ruby
chosen
[ { "from": "system", "value": "Enable codeclimate to evaluate tests\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\nrequire 'view_model'\n\nrequire 'minitest/autorun'\n" }, { "from": "gpt", "value": "if ENV['CODECLIMATE_REPO_TOKEN']\n re...
ruby
chosen
[ { "from": "system", "value": "Move examples to shared_examples(create shared_examples)\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nrequire 'rspec'\n" }, { "from": "gpt", "value": "# -*- coding: utf-8 -*-\nrequire 'rspec'\n\nshared_examples \"should equal 'H24.4.29'\" ...
ruby
chosen
[ { "from": "system", "value": "Disable real network connections for FakeWeb. Tests are still broken, but run fast as possible.\n" }, { "from": "human", "value": "# encoding: utf-8\n\n# This file is copied to spec/ when you run 'rails generate rspec:install'\nENV[\"RAILS_ENV\"] ||= 'test'\nrequire...
ruby
chosen
[ { "from": "system", "value": "Remove DynamoDB output from stdout\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'bundler/setup'\nrequire 'rspec'\n\nrequire 'aws-sdk-dynamodb'\n\nAws.config.update({\n credentials: Aws::Credentials.new(\n 'your_access_key_id',\n 'your_secret...
ruby
chosen
[ { "from": "system", "value": "Use new syntax for setting SimpleCov formatters.\n" }, { "from": "human", "value": "require \"simplecov\"\nrequire \"coveralls\"\nSimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[\n SimpleCov::Formatter::HTMLFormatter,\n Coveralls::SimpleCov::Formatter\n...
ruby
chosen
[ { "from": "system", "value": "Allow specs to be filtered.\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'httpclient'\nunless RUBY_PLATFORM =~ /java/\n require 'curb'\n require 'patron' \n require 'em-http'\nend\n\n$LOAD_PATH.unshift(File.dirname(__FILE__))\n$LOAD_PATH.unshift...
ruby
chosen
[ { "from": "system", "value": "Use webrick as capybara server\n\nCapybara 3 tries to use puma as default which is not available here.\nInstead of adding another dependency we'll use webrick instead.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'active_support'\nrequ...
ruby
chosen
[ { "from": "system", "value": "Remove TODO that we're not going to do\n" }, { "from": "human", "value": "require 'features_helper'\n\n# TODO: switch to Capybara scenario style\ndescribe 'new dataset' do\n attr_reader :start_new_dataset\n\n before(:each) do\n visit('/')\n first(:link_or_bu...
ruby
chosen
[ { "from": "system", "value": "Update to use .build-test directly\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'extensions/kernel'\nrequire 'systemu'\nrequire 'test/unit'\nrequire 'pathname'\nrequire_relative 'Rake.rb'\nrequire_relative 'Path.rb'\n\nmodule WebBlocks\n \n modul...
ruby
chosen
[ { "from": "system", "value": "Test bad-data case for Vdc::get_by_name\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Vcloud::Core::Vdc do\n\n let(:uuid_matcher) { '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}' }\n\n before(:all) do\n config_file = File....
ruby
chosen
[ { "from": "system", "value": "Update tiny_url spec to be read by travis\n" }, { "from": "human", "value": "##require 'link_shrink/shrinkers/tinyurl'\n#require 'spec_helper'\n#\n#describe LinkShrink::Shrinkers::TinyUrl do\n# include_examples 'shared_examples'\n#\n# let(:link_shrink) { described...
ruby
chosen
[ { "from": "system", "value": "Fix adding gitweb to gerrit config\n" }, { "from": "human", "value": "# Encoding: utf-8\n#\n# Cookbook Name:: cicd_infrastructure\n# Recipe:: integration_gerrit_gitweb\n#\n# Copyright (c) 2014 Grid Dynamics International, Inc. All Rights Reserved\n# Classification l...
ruby
chosen
[ { "from": "system", "value": "Add author with zines trait\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :author do\n sequence(:name) { |n| \"Author #{n}\" }\n end\nend\n" }, { "from": "gpt", "value": "FactoryGirl.define do\n factory :author do\n sequence...
ruby
chosen
[ { "from": "system", "value": "Refactor Redimap::IMAP tests, removing pending invalid connection.\n\nInvalid connection tests will not currently be handled; the pending\nmarkers are removed, to make the testing clearer.\n" }, { "from": "human", "value": "require 'net/imap'\n\nrequire 'spec_helper...
ruby
chosen
[ { "from": "system", "value": "Allow passing superclass to model and create_constant for specs.\n" }, { "from": "human", "value": "module Support\n module Constants\n extend ActiveSupport::Concern\n\n module ClassMethods\n def uses_constants(*constants)\n before { create_consta...
ruby
chosen
[ { "from": "system", "value": "Update seed to have announcements\n" }, { "from": "human", "value": "group = Basechurch::Group.create(name: 'English Service')\nuser = Basechurch::User.create(email: 'test@example.com', password: 'password')\nbulletin = Basechurch::Bulletin.create(published_at: Date...
ruby
chosen
[ { "from": "system", "value": "Change EC2 resource coding order\n" }, { "from": "human", "value": "module CloudCostTracker\n module Coding\n module Compute\n module AWS\n # Implements the logic for attaching billing codes to all resources\n # in a single AWS EC2 account, an...
ruby
chosen
[ { "from": "system", "value": "Update podspec to point to most recent tag\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"Snail\"\n s.version = \"0.2.3\"\n s.summary = \"An observables framework for Swift\"\n s.homepage = \"https://github.com/UrbanCo...
ruby
chosen
[ { "from": "system", "value": "Add pry, minitest, turn 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 'sidekiq_pipeline/version'\n\nGem::Specification.new ...
ruby
chosen
[ { "from": "system", "value": "Add superclass for all ContactSport errors.\n" }, { "from": "human", "value": "require \"contact_sport/version\"\nrequire 'contact_sport/vcard_reader'\nrequire 'contact_sport/outlook_reader'\n\nmodule ContactSport\n\n # Raised when a contacts file doesn't appear to...
ruby
chosen
[ { "from": "system", "value": "Fix wrong method name by mistake" }, { "from": "human", "value": "require \"chatroid\"\n\nChatroid.new do\n set :service, \"Twitter\"\n set :consumer_key, \"...\"\n set :consumer_secret, \"...\"\n set :access_key, \"...\"\n set :access_secret, ...
ruby
chosen
[ { "from": "system", "value": "Fix error message for MRI 1.9.3\n" }, { "from": "human", "value": "module ISO8601\n ##\n # Contains all ISO8601-specific errors.\n module Errors\n class StandardError < ::StandardError\n end\n ##\n # Raised when the given pattern doesn't fit as ISO 86...
ruby
chosen
[ { "from": "system", "value": "Add 'Usage:' to usage dialog\n" }, { "from": "human", "value": "module Load\n\tdef self.help\n\t\tputs \"load source/repo [ target ]\"\n\tend\n\tdef self.load(source, target)\n\t\tif source.index(':') == nil and source.index('@') == nil\n\t\t\trepo = \"git@github.co...
ruby
chosen
[ { "from": "system", "value": "Add user to the seed file\n" }, { "from": "human", "value": "# This file should contain all the record creation needed to seed the database with its default values.\n# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).\n#\...
ruby
chosen
[ { "from": "human", "value": "Fix content_id mismatches between draft and live content stores" }, { "from": "gpt", "value": "namespace :data_hygiene do\n namespace :draft_content_id_cleanup do\n def report(cleanup: false)\n unless ENV[\"MONGODB_URI\"] && ENV[\"MONGODB_URI\"].include?(\"d...
ruby
chosen
[ { "from": "system", "value": "Use described_class to fix a rubocop offense\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'db_helper'\n\nclass Post < ShardHandler::Model\nend\n\ndescribe ShardHandler do\n before(:all) do\n DbHelper.setup_shards\n DbHelper.connect_to_sha...
ruby
chosen
[ { "from": "system", "value": "Add specs for role associations\n" }, { "from": "human", "value": "require \"rails_helper\"\n\ndescribe Role do\n pending \"add some examples to (or delete) #{__FILE__}\"\nend\n" }, { "from": "gpt", "value": "require \"rails_helper\"\n\ndescribe Role do...
ruby
chosen
[ { "from": "system", "value": "Handle flat file responses correctly\n" }, { "from": "human", "value": "module Spree::Fulfillment::Providers::Amazon\n class NokogiriParser\n def initialize(res, encoding)\n @xml = Nokogiri::XML(res.body)\n end\n\n private\n\n def method_missing(me...
ruby
chosen
[ { "from": "system", "value": "Add note about rendering order\n" }, { "from": "human", "value": "module Laze\n class Renderer\n attr_reader :options, :string\n\n def initialize(*args)\n raise ArgumentError unless args.any?\n\n if args[0].is_a?(Page)\n @string = args[0].con...
ruby
chosen
[ { "from": "system", "value": "Use let for kerb5 instance\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'rails_app_helper'\n\nRSpec.describe 'Kerberos Authentication Server' do\n describe 'abc' do\n it 'passes krb authentication' do\n expect(Krb5Auth::Krb5.new.get_ini...
ruby
chosen
[ { "from": "system", "value": "Update to use statistics class\n" }, { "from": "human", "value": "require_relative 'job_serializer'\n\nmodule Workerholic\n class JobProcessingError < StandardError; end\n\n class JobProcessor\n def initialize(serialized_job)\n @serialized_job = serialized...
ruby
chosen
[ { "from": "system", "value": "Set initial log level to warn\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nrequire \"logger\"\n\nmodule Juicer\n def self.log\n @@log ||= Logger.new($stdout)\n end\n\n def self.log=(log)\n @@log = log\n end\n\n module Loggable\n def lo...
ruby
chosen
[ { "from": "system", "value": "Read client id from socket\n" }, { "from": "human", "value": "class MessageQueue\n attr_reader :id\n\n def initialize(client_socket)\n @socket = client_socket.accept\n @id = 1 # should read from socket instead\n @queue = Queue.new\n\n puts 'Client conn...
ruby
chosen
[ { "from": "system", "value": "Read cookbook version from gem version" }, { "from": "human", "value": "name 'chef-sugar'\nmaintainer 'Seth Vargo'\nmaintainer_email 'sethvargo@gmail.com'\nlicense 'Apache 2.0'\ndescription 'Installs chef-sugar. Please see the chef-su...
ruby
chosen
[ { "from": "system", "value": "Add compatibility for older Chef 12 releases\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "name 'ntp'\nmaintainer 'Chef Software, Inc.'\nmaintainer_email 'cookbooks@chef.io'\nlicense 'Apache 2.0'\nd...
ruby
chosen
[ { "from": "human", "value": "Add migration to evaluate .omn files.\n" }, { "from": "gpt", "value": "class AddOmnToOntologyFileExtensions < ActiveRecord::Migration\n def up\n ActiveRecord::Base.connection.\n execute(\"INSERT INTO ontology_file_extensions (extension, distributed) VALUES (...
ruby
chosen
[ { "from": "system", "value": "Allow APIError to record HTTP response code.\n" }, { "from": "human", "value": "module Nexpose\n class APIError < ::RuntimeError\n attr_accessor :req, :reason\n\n def initialize(req, reason = '')\n @req = req\n @reason = reason\n end\n\n def t...
ruby
chosen
[ { "from": "system", "value": "Add .js.es6 as known filetype\n" }, { "from": "human", "value": "require 'pronto'\nrequire 'eslintrb'\n\nmodule Pronto\n class ESLint < Runner\n def run\n return [] unless @patches\n\n @patches.select { |patch| patch.additions > 0 }\n .select { ...
ruby
chosen
[ { "from": "system", "value": "Check if ApplicationController is defined before assiging the view_context\n" }, { "from": "human", "value": "module Simpre\n # A helper method for decorating objects\n module Helper\n def decorate(item_or_collection)\n if item_or_collection.respond_to?(:m...
ruby
chosen
[ { "from": "system", "value": "Use reverse_merge to merge locals\n" }, { "from": "human", "value": "# encoding: utf-8\n# frozen_string_literal: true\nrequire 'view/view_helpers'\n\nmodule View\n class Component\n include ComponentHelper\n\n cattr_reader :presenter_class\n\n def self.pre...
ruby
chosen
[ { "from": "system", "value": "Install gems when building Blank\n" }, { "from": "human", "value": "namespace :blank do\n task :switch_origin do\n `git remote add origin #{ENV['REPO']}`\n `git push origin master`\n `git fetch origin`\n `git checkout origin/master`\n `git branch --t...
ruby
chosen
[ { "from": "system", "value": "Prepare for every other week\n" }, { "from": "human", "value": "namespace :entry do\n\n # rake entry:send_entries_test\n task :send_entries_test => :environment do\n user = User.where(:email=>\"admin@dabble.ex\").first\n EntryMailer.send_entry(user).deliver_...
ruby
chosen
[ { "from": "system", "value": "Add rails version missing from migration\n" }, { "from": "human", "value": "class ActsAsVotableMigration < ActiveRecord::Migration\n def self.up\n create_table :votes do |t|\n t.references :votable, polymorphic: true\n t.references :voter, polymorphic:...
ruby
chosen
[ { "from": "system", "value": "Change to kramdown for compatibility on JRuby\n" }, { "from": "human", "value": "# coding: utf-8\nrequire './lib/dizby/version'\n\nGem::Specification.new do |spec|\n spec.name = 'dizby'\n spec.version = Dizby::VERSION\n spec.authors = ['Natha...
ruby
chosen
[ { "from": "system", "value": "Remove bugged couch delete code from 015 upgrade.\n" }, { "from": "human", "value": "# This is the chef-mover `phase_2_prep_migration` and `phase_2_migration`\n# that migrates containers and groups from couchDB to postgreSQL\n\ndefine_upgrade do\n if Partybus.confi...
ruby
chosen
[ { "from": "system", "value": "Correct the name of class to the class IpAddressValidator\n" }, { "from": "human", "value": "# Checks if the value of an attribute is a valid IP address.\n#\n# @example Validate that the device IP address is valid.\n# class Host << ActiveRecord::Base\n# attr_a...
ruby
chosen
[ { "from": "system", "value": "Fix linux executer -- output redirection to file\n\nUse Open3 instead of a system call.\nThis was not working, as it interpreted \">>\" as a command line argument,\nnot an output redirection\n" }, { "from": "human", "value": "module VirusScanService\n class Kaspers...
ruby
chosen
[ { "from": "system", "value": "Add README.md to the gem files list\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'ffi'\n s.version = '1.2.0.dev'\n s.author = 'Wayne Meissner'\n s.email = 'wmeissner@gmail.com'\n s.homepage = 'http://wiki.github.com/ffi/ffi'\n s....
ruby
chosen
[ { "from": "system", "value": "Fix knownhost warn for tests\n" }, { "from": "human", "value": "require 'serverspec'\nrequire 'net/ssh'\n\nif ENV['TARGET_HOST'] != 'localhost'\n\n set :backend, :ssh\n host = ENV['TARGET_HOST']\n\n options = Net::SSH::Config.for(host, [\"#{ENV['HOME']}/.ssh/conf...
ruby
chosen
[ { "from": "system", "value": "Add a test for the Reru::IO::Reader's stop method\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Reru::IO::Reader do\n it \"spits what it reads down the stream\" do\n StringIO.open(\"hello world\\nhere we go!\") do |input|\n reader = R...
ruby
chosen
[ { "from": "system", "value": "Add test for with/without \"me\"\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe Lita::Handlers::Flip, lita_handler: true do\n it { routes_command('flip me Nerdbot').to(:flip) }\n it { routes_command('flip Nerdbot').to(:flip) }\n\n it 'flip...
ruby
chosen
[ { "from": "system", "value": "Revert \"Test with adding rake as dependency\"\n\nThis reverts commit dc8ce019cd1cd9b56a3e048ef31e3ddffb172091.\n" }, { "from": "human", "value": "lib = File.expand_path(\"../lib\", __FILE__)\n$:.unshift lib unless $:.include? lib\n\nrequire \"gas/version\"\n\nGem::...
ruby
chosen
[ { "from": "system", "value": "Refactor FactCave test helpers to use CommonResponses." }, { "from": "human", "value": "module GdsApi\n module TestHelpers\n module FactCave \n\n FACT_CAVE_ENDPOINT = Plek.current.find('fact-cave')\n\n def fact_cave_has_a_fact(slug, atts)\n resp...
ruby
chosen
[ { "from": "system", "value": "Include the default group for runtime gemfile dependencies\n" }, { "from": "human", "value": "module Gemnasium\n module Parser\n module Configuration\n attr_writer :runtime_groups\n\n def runtime_groups\n @runtime_groups ||= [:production]\n ...
ruby
chosen
[ { "from": "system", "value": "Handle inconsistencies of next_page / next_link response attributes\n" }, { "from": "human", "value": "module Habrahabr\n module Entities\n class ListResult\n attr_reader :pages_count, :next_link, :data\n def initialize(attrs, data_coercion_class = nil...
ruby
chosen
[ { "from": "system", "value": "Use require instead of fetch\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass CourseWikisController < ApplicationController\n def update\n course_id = params[:course_id]\n wikis = course_wiki_params[:wikis]\n CourseWiki.where(cours...
ruby
chosen
[ { "from": "system", "value": "Allow updating metadata of repositories." }, { "from": "human", "value": "class RepositoriesController < InheritedResources::Base\n\n defaults finder: :find_by_path!\n\n load_and_authorize_resource :except => [:index, :show]\n\n actions :index, :show, :create, :d...
ruby
chosen
[ { "from": "system", "value": "Add @page.state based on public?\n" }, { "from": "human", "value": "require 'active_support/concern'\n\nmodule Georgia\n module Concerns\n module Publishable\n extend ActiveSupport::Concern\n\n included do\n\n scope :published, where(public: tru...
ruby
chosen
[ { "from": "system", "value": "Fix error dropping postgres db in automigration\n\nI was getting this error when automigration the datbase\n\n Caused by:\n PG::ObjectInUse: ERROR: database \"solidus_backend_test\" is being accessed by other users\n DETAIL: There is 1 other session using the databas...
ruby
chosen
[ { "from": "human", "value": "Update image_id primary key to bigint\n" }, { "from": "gpt", "value": "class ChangeImageIdToBigint < ActiveRecord::Migration[6.0]\n def up\n change_column :images, :id, :bigint\n end\n\n def down\n change_column :images, :id, :integer\n end\nend\n" } ]
ruby
chosen
[ { "from": "system", "value": "Add methods to find box(es) from its children.\n" }, { "from": "human", "value": "# coding: utf-8\n# vim: set expandtab tabstop=2 shiftwidth=2 softtabstop=2 autoindent:\n\nmodule BMFF::Box::Container\n attr_accessor :children\n\n def container?\n true\n end\n\...
ruby
chosen
[ { "from": "system", "value": "Update gemspec to accurately reflect new direction of gem.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'model_mirror/version'\n\nGem::Speci...
ruby
chosen
[ { "from": "system", "value": "Fix typo in task description" }, { "from": "human", "value": "namespace :laravel do\n desc \"Exceute a provided artisan command\"\n task :artisan, :command_name do |t, args|\n # ask only runs if argument is not provided\n ask(:cmd, \"list\")\n command = a...
ruby
chosen
[ { "from": "system", "value": "Make Dependencies a Mapping instead of an OpenMapping\n\nWe don't need (or want, really) the \"open\" behavior here.\n" }, { "from": "human", "value": "module CC\n module Yaml\n module Nodes\n class Dependencies < OpenMapping\n map :files, to: FileDe...
ruby
chosen
[ { "from": "system", "value": "Add support for long instance IDs\n\nChanges the regular expression to detect instance IDs to support the new longer IDs. This fixes issue #431." }, { "from": "human", "value": "require 'chef/provisioning/aws_driver/aws_resource_with_entry'\nrequire 'chef/provisioni...
ruby
chosen
[ { "from": "system", "value": "Add a render_template method to the rendering scope.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Dimples\n # A mixin class that allows a document to render via Tilt.\n module Renderable\n attr_accessor :rendered_contents\n\n de...
ruby
chosen
[ { "from": "system", "value": "Make Markaby run on 1.9\n" }, { "from": "human", "value": "class MissingLibrary < Exception #:nodoc: all\nend\nbegin\n require 'markaby'\nrescue LoadError => e\n raise MissingLibrary, \"Markaby could not be loaded (is it installed?): #{e.message}\"\nend\n\n$MA...
ruby
chosen
[ { "from": "system", "value": "Update rubocop requirement from ~> 0.91.0 to ~> 0.92.0\n\nUpdates the requirements on [rubocop](https://github.com/rubocop-hq/rubocop) to permit the latest version.\n- [Release notes](https://github.com/rubocop-hq/rubocop/releases)\n- [Changelog](https://github.com/rubocop-hq/r...
ruby
chosen
[ { "from": "system", "value": "Make data migration more merciful\n" }, { "from": "human", "value": "class AddInReplyToAccountIdToStatuses < ActiveRecord::Migration[5.0]\n def up\n add_column :statuses, :in_reply_to_account_id, :integer, null: true, default: nil\n\n ActiveRecord::Base.trans...
ruby
chosen
[ { "from": "human", "value": "Add pending spec for bug. Webrat needs to escape quotes in XPath\n" }, { "from": "gpt", "value": "require File.expand_path(File.dirname(__FILE__) + \"/../../spec_helper\")\n\n\ndescribe \"field_by_xpath\" do\n it \"should work when there is a single quote in the ID\...
ruby
chosen
[ { "from": "human", "value": "Add scenario for editing a future article\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\nRSpec.feature 'Drafting articles', type: :feature do\n let(:admin) { create :user, :as_admin }\n\n before do\n load Rails.root.join('db', 'seeds.rb')\n Blog.f...
ruby
chosen
[ { "from": "system", "value": "Add karmacracy to main module\n" }, { "from": "human", "value": "require 'link_shrink/version'\nrequire 'link_shrink/options'\nrequire 'link_shrink/util'\nrequire 'link_shrink/request'\nrequire 'link_shrink/json_parser'\nrequire 'link_shrink/shrinkers/base'\nrequire...
ruby
chosen
[ { "from": "system", "value": "Install new version of Ruby and create gemset before updating code\n" }, { "from": "human", "value": "Capistrano::Configuration.instance(:must_exist).load do\n require \"rvm/capistrano\"\n\n # RVM methods:\n set :rvm_type, :system\n set :rvm_ruby_string, :local\...
ruby
chosen
[ { "from": "system", "value": "Remove `cd` as it cause issues in Debian" }, { "from": "human", "value": "require 'fileutils'\n\nnamespace :npm do\n desc \"Install npm packages\"\n task :install do\n package_file = ::Rails.configuration.npm.package_file\n browserify_options = ::Rails.confi...
ruby
chosen
[ { "from": "system", "value": "Add addtional chef config item\n" }, { "from": "human", "value": "#\n# Cookbook Name:: apache2\n# Recipe:: default\n#\n# Copyright (C) 2015 \n#\n# \n#\npackage 'apache2'\n\nservice 'apache2' do\n action [:start, :enable]\nend\n\ntemplate '/var/www/index.html' do\n ...
ruby
chosen
[ { "from": "system", "value": "Add some documentation around the faraday middleware\n" }, { "from": "human", "value": "# @private\nmodule FaradayMiddleware\n # @private\n class NullResponseBody < Faraday::Middleware\n def call(env)\n @app.call(env).on_complete do |response|\n if ...
ruby
chosen
[ { "from": "system", "value": "Switch LegacyUser to use UserMethods\n" }, { "from": "human", "value": "module Spree\n # Default implementation of User.\n #\n # @note This class is intended to be modified by extensions (ex.\n # spree_auth_devise)\n class LegacyUser < Spree::Base\n includ...
ruby
chosen
[ { "from": "system", "value": "Use display_name for peach restaurants\n" }, { "from": "human", "value": "class PeachRestaurant\n attr_reader :name\n\n def initialize(restaurant, reaction_formatter)\n @restaurant = restaurant\n @reaction_formatter = reaction_formatter\n end\n\n def name\...
ruby
chosen
[ { "from": "system", "value": "Support for HTTP auth CouchDB reporter.\n" }, { "from": "human", "value": "require \"json\"\nrequire \"time\"\n\nclass Time\n def to_json(*args) #:nodoc:\n iso8601(3).to_json(*args)\n end\nend\n\nmodule Stampede\n module Reporters\n class CouchDB\n def...
ruby
chosen
[ { "from": "system", "value": "Add a require for capybara/dsl in card balance script\n" }, { "from": "human", "value": "require 'capybara'\nrequire 'capybara/poltergeist'\n\nCapybara.register_driver :poltergeist_debug do |app|\n Capybara::Poltergeist::Driver.new(app, :inspector => true, :js_erro...
ruby
chosen
[ { "from": "human", "value": "Add rake task to promote users to admin\n\nFix #398\n" }, { "from": "gpt", "value": "namespace :feedbin do\n desc \"Promote user to admin status\"\n task :make_admin, :email do |task, args|\n if args[:email]\n User.find_by_email(args[:email]).update(admin: ...
ruby
chosen
[ { "from": "human", "value": "Add basic Formatter that for now prints successful tests\n" }, { "from": "gpt", "value": "require 'colorize'\n\nmodule Dest\n\n class Formatter\n\n def initialize(evald_result)\n @evald_result\n end\n\n def print\n if @evald_result[:result][0]\n ...
ruby
chosen
[ { "from": "system", "value": "Fix issue if id_rsa key is not available\n" }, { "from": "human", "value": "module Dokkufy\n class Server\n attr_accessor :hostname, :username\n\n def initialize hostname, username\n self.hostname = hostname\n self.username = username\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Add convenient method to API Call.\n" }, { "from": "human", "value": "class ApiCall < Versioneye::Model\n\n include Mongoid::Document\n include Mongoid::Timestamps\n\n field :api_key , type: String\n field :user_id , type: String\n field :fullpath , typ...
ruby
chosen
[ { "from": "system", "value": "Fix OSX/iOS build after sqlite update\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"liblowladb\"\n s.version = \"0.0.2\"\n s.summary = \"A synchronizing embedded client database based on MongoDB.\"\n s.homepag...
ruby
chosen
[ { "from": "human", "value": "Revert \"Removing unused AllHelpers approach\"\n\nThis reverts commit 10722d24910589217fda403cd3dd8bf48c24b224.\n" }, { "from": "gpt", "value": "module Draper\n module AllHelpers\n # Most of the black magic here thanks to Xavier Shay (@xshay)\n # Provide acces...
ruby
chosen
[ { "from": "system", "value": "Add .pre for next release\n" }, { "from": "human", "value": "module EY\n VERSION = '2.0.10'\n ENGINEYARD_SERVERSIDE_VERSION = ENV['ENGINEYARD_SERVERSIDE_VERSION'] || '2.0.4'\nend\n" }, { "from": "gpt", "value": "module EY\n VERSION = '2.0.11.pre'\n E...
ruby
chosen
[ { "from": "system", "value": "Add closure functions for cURL callbacks\n" }, { "from": "human", "value": "module Ethon\n class Easy\n\n # This module contains the logic and knowledge about the\n # available options on easy.\n module Options\n attr_reader :url\n\n def url=(val...
ruby
chosen
[ { "from": "system", "value": "Use cross-platform line-endings in logger\n" }, { "from": "human", "value": "##\n# RDO: Ruby Data Objects.\n# Copyright © 2012 Chris Corbyn.\n#\n# See LICENSE file for details.\n##\n\nrequire \"logger\"\n\nmodule RDO\n # A Logger that outputs using color to highlig...
ruby
chosen
[ { "from": "system", "value": "Add timeout for short transaction\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'timeout'\n\nmodule RubyRabbitmqJanus\n module Rabbit\n # @author VAILLANT Jeremy <jeremy.vaillant@dazzl.tv>\n #\n # Class for manage connection w...
ruby
chosen
[ { "from": "system", "value": "Use sub() instead of split()\n" }, { "from": "human", "value": "module VundleCli\n module Helpers\n module_function\n\n def file_validate(fpath, check_dir = false)\n fpath = File.expand_path(fpath)\n\n unless File.exist?(fpath)\n raise Argume...
ruby
chosen
[ { "from": "system", "value": "Add format validation to make sure that the value is only composed of hex characters\n" }, { "from": "human", "value": "require 'referehencible/version'\n\nmodule Referehencible\n def self.included(base)\n base.class_eval do\n ###\n # Validations\n ...
ruby
chosen
[ { "from": "system", "value": "Allow passing a list of modules to the 'helpers' method [NO TESTS]\n" }, { "from": "human", "value": "require 'sinatra/base'\n\nmodule Sinatra\n class Default < Base\n set :app_file, lambda {\n ignore = [\n /lib\\/sinatra.*\\.rb$/, # all sinatra code...
ruby
chosen
[ { "from": "system", "value": "Define Engine only if Rails is available\n" }, { "from": "human", "value": "require \"vidibus/uuid\"\nrequire \"vidibus/validate_uuid\"\nrequire \"vidibus/uuid/mongoid\"\n\nmodule Vidibus::Uuid\n class Engine < ::Rails::Engine; end \nend\n\nActiveModel::Validation...
ruby
chosen
[ { "from": "system", "value": "Switch nokogiri back to stable, seg fault issue still exits\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"omf_common/version\"\n\nGem::Specification.new do |s|\n s.name = \"omf_common\...
ruby
chosen
[ { "from": "system", "value": "Add error method and make outf more featureful\n" }, { "from": "human", "value": "require 'highline'\nrequire 'yaml'\nrequire 'json'\nrequire 'pp'\n\nmodule MrMurano\n module Verbose\n def verbose(msg)\n if $cfg['tool.verbose'] then\n say msg\n ...
ruby
chosen