conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add the rubocop junit formatter\n" }, { "from": "human", "value": "$LOAD_PATH.push File.expand_path('../lib', __FILE__)\nrequire 'hash_attribute_assignment/version'\n\nGem::Specification.new do |s|\n s.name = 'hash_attribute_assignment'\n s.summary ...
ruby
chosen
[ { "from": "system", "value": "Fix a bug where tracking multiple raids at the same time caused data to be overwritten.\n" }, { "from": "human", "value": "module Audit\n class CharacterWcl < Character\n\n def process_result(response)\n if response.code == 200\n data = JSON.parse re...
ruby
chosen
[ { "from": "system", "value": "Refactor resume data fetcher to just inherit most of its functionality from file fetcher and only differentiate itself by parsing JSON\n" }, { "from": "human", "value": "require 'json'\nrequire_relative '../file_fetcher'\nrequire_relative '../output'\n\nmodule Resum...
ruby
chosen
[ { "from": "system", "value": "Add missing require date, fix string concat.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nrequire File.expand_path(\"../lib/dynamodb_mutex/version\", __FILE__)\n\nGem::Specification.new do |gem|\n gem.name = 'dynamodb-mutex'\n gem.version = D...
ruby
chosen
[ { "from": "system", "value": "Remove a dumb xss_terminate warning during bundle install.\n" }, { "from": "human", "value": "# borrowed from err who borrowed from topfunky who borrowed from...\n\n# set up test environment\nRAILS_ENV = 'test'\nrequire File.expand_path(File.join(File.dirname(__FILE...
ruby
chosen
[ { "from": "system", "value": "Test how Tunit sets arguments" }, { "from": "human", "value": "require_relative 'tunit/test_case'\nrequire 'tunit'\n\nclass TunitTest < Tunit::TestCase\n def setup\n Tunit.io = io\n Tunit::Runnable.runnables = [PassingTest]\n end\n\n def test_run_gathers_re...
ruby
chosen
[ { "from": "system", "value": "Update chef client to 12.10.24\n" }, { "from": "human", "value": "# Add the opscode APT source for chef\ndefault[:apt][:sources] = node[:apt][:sources] | [\"opscode\"]\n\n# Set the default server version\ndefault[:chef][:server][:version] = \"12.0.8-1\"\n\n# Set the...
ruby
chosen
[ { "from": "system", "value": "Access Worldwide API via whitehall-frontend\n\nTo simplify the migration of Whitehall to AWS, calls to the Worldwide\nAPI should be directed to whitehall-frontend, not whitehall-admin.\n\nCo-authored-by: Christopher Baines <c14e4e2094dd20d1d0dcfc7ec4547168bcc89be2@digital.cabin...
ruby
chosen
[ { "from": "system", "value": "Remove respond_to? :apply_scopes as it returns false on Ruby 2.0.0.\n" }, { "from": "human", "value": "class Api::BaseController < ApiController\n responders OpenMensa::Responders::ApiResponder,\n Responders::DecorateResponder,\n Responders::PaginateResponder...
ruby
chosen
[ { "from": "system", "value": "Fix insertion of first comment\n\n" }, { "from": "human", "value": "class CommentsController < ApplicationController\n before_action :require_user\n\n def create\n @recipe = Recipe.find params[:recipe_id]\n @comment = @recipe.comments.build comment_params\n ...
ruby
chosen
[ { "from": "system", "value": "Update destroy action in sessions controller\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n def create\n user = User.find_or_create_from_auth(auth_hash)\n\n if user\n session[:user_id] = user.id\n end\n redire...
ruby
chosen
[ { "from": "system", "value": "Add comments/comment out logic for checking if member of DBC github org\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n skip_before_action :authenticate_user!, only: [:new, :create]\n\n def new\n redirect_to '/auth/github'\...
ruby
chosen
[ { "from": "system", "value": "Check if passwords will go\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n\n def new\n\n end\n\n def create\n\n @user = User.find_by_username(params[:username])\n if @user && @user.authenticate(params[:sessions][:passwo...
ruby
chosen
[ { "from": "system", "value": "Load the patch after the ActiveRecord is loaded\n" }, { "from": "human", "value": "require 'activerecord-postgres-json/activerecord'\nrequire 'activerecord-postgres-json/coders'\n" }, { "from": "gpt", "value": "ActiveSupport.on_load :active_record do\n ...
ruby
chosen
[ { "from": "system", "value": "Change UpdateAlleleRegistry to run nightly\n" }, { "from": "human", "value": "class UpdateAlleleRegistryIds < ActiveJob::Base\n def perform(recurring = true)\n begin\n for v in Variant.where(allele_registry_id: nil) do\n v.allele_registry_id = v.get_...
ruby
chosen
[ { "from": "system", "value": "Add path name to instance_eval\n" }, { "from": "human", "value": "module ElectricSheep\n module Sheepfile\n class Evaluator\n\n def initialize(path)\n @path = File.expand_path(path)\n end\n\n def evaluate\n raise \"Unable to evaluate...
ruby
chosen
[ { "from": "system", "value": "Fix version detection for wrecked vmware-tools install\n\nI found a broken version of vmware-tools, basically the vmware-toolbox-cmd\nreturned nothing. Not for -v or --help.\n\nThe change allows the fact to say that a version is installed, but its unknown\nwhich.\n\nThis should...
ruby
chosen
[ { "from": "system", "value": "Use cached output from hets, if possible.\n\nsolves #629" }, { "from": "human", "value": "module OntologyVersion::Parsing\n extend ActiveSupport::Concern\n \n included do\n @queue = 'hets'\n \n after_create :async_parse, :if => :commit_oid?\n end\n\n d...
ruby
chosen
[ { "from": "human", "value": "Add repository tree resolver class\n" }, { "from": "gpt", "value": "class RepositoryTreeResolver\n attr_accessor :project_names\n attr_accessor :license_names\n attr_accessor :tree\n\n def initialize(repository, date = nil)\n @repository = repository\n @man...
ruby
chosen
[ { "from": "system", "value": "Use local variable instead of method chain\n" }, { "from": "human", "value": "module JsonTestData\n class JsonSchema\n attr_accessor :schema\n\n def initialize(schema)\n @schema = JSON.parse(schema, symbolize_names: true)\n end\n\n def generate_exa...
ruby
chosen
[ { "from": "system", "value": "Update ActionColumn to work with latest Core\n" }, { "from": "human", "value": "module Netzke\n module Communitypack\n module ActionColumn\n extend ActiveSupport::Concern\n\n included do |base|\n js_configure do |c|\n c.require :action_...
ruby
chosen
[ { "from": "system", "value": "Change podspec version to 0.0.26\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"CoreData-Views-Collection-ios\"\n s.version = \"0.0.25\"\n s.summary = \"Collection of Core Data based Cocoa Touch views base classes\"\n s.de...
ruby
chosen
[ { "from": "human", "value": "Create a sample that encodes a job and checks for status.\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\nrequire 'azure_media_service'\n\n# initialize\nAzureMediaService.configure do |config|\n # Media Service Account Name\n config.id = 'wiprolimited'\n # M...
ruby
chosen
[ { "from": "system", "value": "Add matching logic for MessageEventHandler\n" }, { "from": "human", "value": "module Discordrb::Events\n class MessageEvent\n attr_reader :message\n\n def initialize(message)\n @message = message\n end\n\n def author; @message.author; end\n alia...
ruby
chosen
[ { "from": "system", "value": "Add development dependency for 'rake'\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'has_breadcrumb/version'\n\nGem::Specification.new do |ge...
ruby
chosen
[ { "from": "system", "value": "Change to fix config option\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nRSpec.describe GithubCLI::API, '#configure' do\n let(:object) { described_class }\n\n before {\n allow(GithubCLI).to receive(:config).and_return(config)\n }\n subj...
ruby
chosen
[ { "from": "human", "value": "Complete 6.5 code, need to do reflection\n" }, { "from": "gpt", "value": "# RELEASE 2: NESTED STRUCTURE GOLF\n# Hole 1\n# Target element: \"FORE\"\n\narray = [[1,2], [\"inner\", [\"eagle\", \"par\", [\"FORE\", \"hook\"]]]]\n\n# attempts:\n# ==========================...
ruby
chosen
[ { "from": "system", "value": "Fix `url` stanza comment for Anvil.\n" }, { "from": "human", "value": "cask 'anvil' do\n version '2016-02-24_11-50-56'\n sha256 'a4ddaa21b8c5b52b2a21620253aba64546f565e944b76e43c052c7a022007749'\n\n # amazonaws.com is the official download host as per the vendor ...
ruby
chosen
[ { "from": "system", "value": "Exclude bundled gems from coverage reports.\n" }, { "from": "human", "value": "# Test helper.\n\n# Test coverage if enabled.\n\ndef jruby?\n defined?( RUBY_ENGINE ) and RUBY_ENGINE == 'jruby'\nend\n\nbegin\n require 'codeclimate-test-reporter'\n ENV[ 'COVERAGE' ]...
ruby
chosen
[ { "from": "system", "value": "Remove redgreen for Ruby 1.9 compatibility\n\nhttp://isitruby19.com/redgreen\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'rubygems/command'\nrequire 'test/unit'\n\nrequire 'shoulda'\nrequire 'active_support'\nrequire 'active_support/test_case'\nre...
ruby
chosen
[ { "from": "system", "value": "Update Riak to 2.0.0 release\n" }, { "from": "human", "value": "default[\"riak\"][\"package\"][\"name\"] = \"riak\"\ndefault[\"riak\"][\"package\"][\"version\"] = \"2.0.0rc1\"\n\ndefault[\"riak\"][\"package\"][\"url\"] = \"http://s3.amazonaws.com/downloads.basho.com...
ruby
chosen
[ { "from": "system", "value": "Add test for other form of section heading\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass ProjectTest < Test::Unit::TestCase\n # setup for test\n def setup\n @doc = Asciidoc::Document.new(File.readlines(sample_doc_path(:asciidoc_index)))\n e...
ruby
chosen
[ { "from": "system", "value": "Fix the observer initialiser for development mode.\n\nAs models get reloaded on every request in development mode, these\ncallbacks were running unpredictably, depending on how many requests had\nbeen made.\n" }, { "from": "human", "value": "# In development environ...
ruby
chosen
[ { "from": "system", "value": "Remove requirement for order number uniqueness\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire_dependency \"renalware/pathology\"\n\nmodule Renalware\n module Pathology\n class ObservationRequest < ApplicationRecord\n has_many :o...
ruby
chosen
[ { "from": "human", "value": "Add wkhtmltopdf for PDFKit. Useful when you cannot install wkhtmltopdf-binary gem\n" }, { "from": "gpt", "value": "require 'formula'\n\nclass WkhtmltopdfOld < Formula\n url 'http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9.tar.bz2'\n homepage 'http://code....
ruby
chosen
[ { "from": "system", "value": "Change to fix on jruby\n" }, { "from": "human", "value": "# encoding: utf-8\n\ndesc 'Load gem inside irb console'\ntask :console do\n require 'irb'\n require 'irb/completion'\n require File.join(__FILE__, '../../lib/tty-command')\n ARGV.clear\n IRB.start\nend\n...
ruby
chosen
[ { "from": "system", "value": "Correct privatisation of class method.\n" }, { "from": "human", "value": "class OauthAccount < ActiveRecord::Base\n belongs_to :user\n\n def self.from_omniauth(auth)\n where(provider: auth.provider, uid: auth.uid).first_or_initialize.tap do |account|\n acc...
ruby
chosen
[ { "from": "system", "value": "Create all 10 tricks at start of round\n" }, { "from": "human", "value": "class StartRound\n attr_reader :errors, :round\n\n def initialize(game)\n @game = game\n @round = nil\n @errors = []\n end\n\n def call\n @game.with_lock do\n start_round ...
ruby
chosen
[ { "from": "system", "value": "Update notification spec to count messages, not rows\n\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe \"Notifications\", :js do\n let(:sender) { create :member }\n let(:recipient) { create :member, login_name: 'beyo...
ruby
chosen
[ { "from": "system", "value": "Mark non-functional rubygems plugin spec 'pending'" }, { "from": "human", "value": "require File.expand_path('../../../spec_helper', __FILE__)\n\ndescribe \"bundle install with gem sources\" do\n describe \"install time dependencies\" do\n it \"installs gems wit...
ruby
chosen
[ { "from": "human", "value": "Convert last query test from Python code. It doesn't work yet, though.\n" }, { "from": "gpt", "value": "$VERBOSE = true\nrequire 'test/unit'\nrequire_relative '../lib/resource'\n\nclass TestQuery < Test::Unit::TestCase\n\n TEST_DATASET_NAME = 'ClinVar/2.0.0-1/Vari...
ruby
chosen
[ { "from": "system", "value": "Fix spec description for `=`.\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe Obtuse do\n describe \"=\" do\n describe \"Object Object\" do\n e %q{12 12 =}, 1\n e %q{\"foo\" \"foo \" =}, 0\n end\n end\nend\n" }, { "fr...
ruby
chosen
[ { "from": "system", "value": "Rename variable to avoid conflict with outer variable\n" }, { "from": "human", "value": "require 'net/https'\nrequire 'json'\n\nmodule Capistrano\n module Ghostinspector\n def self.executeApi(type, test, gi_api_key, domain, rollback)\n\n \t# Determine if we s...
ruby
chosen
[ { "from": "system", "value": "Add method to print both city and state\n" }, { "from": "human", "value": "class Address < ActiveRecord::Base\n belongs_to :user\n validates :state, length: { maximum: 2 }\n validates :user_id, :city, :state, :zip_code, presence: true\n geocoded_by :zip_code\n ...
ruby
chosen
[ { "from": "system", "value": "[002] Add attributes to Snippet model; used rails generate model cmd\n\n$ rails generate model snippet name:string type:string\ndescription:string tags:string text:text invoke mongoid\n create app/models/snippet.rb\n invoke rspec\n identical spec/mo...
ruby
chosen
[ { "from": "system", "value": "Make '.rb' part for load_file optional\n" }, { "from": "human", "value": "module TbHeavyControl\n module Configurable\n attr_reader :load_order\n\n def config(&block)\n raise 'tb_heavy_control config cannot run without block' if block.nil?\n @load_o...
ruby
chosen
[ { "from": "system", "value": "Use a Hash to map platform names.\n" }, { "from": "human", "value": "# attributes/default.rb\n#\n# Author: Simple Finance <ops@simple.com>\n# License: Apache License, Version 2.0\n#\n# Copyright 2013 Simple Finance Technology Corporation\n#\n# Licensed under the Apa...
ruby
chosen
[ { "from": "human", "value": "Add podspec file for CocoaPods support\n" }, { "from": "gpt", "value": "Pod::Spec.new do |s|\n s.name = \"Stripe\"\n s.version = \"1.0.0\"\n s.summary = \"Stripe is a RESTful API for accepting payments online.\"\n s.license = { :type => 'MI...
ruby
chosen
[ { "from": "system", "value": "Use nokogiri gem to focus on table elements\n" }, { "from": "human", "value": "# http://ruby-doc.org/stdlib-2.0.0/libdoc/open-uri/rdoc/OpenURI.html \nrequire 'open-uri'\n\n# Go fetch the contents of a URL & store them as a String\nresponse = open('http://www2.stat.d...
ruby
chosen
[ { "from": "system", "value": "Update API path in spec" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Appsignal::AuthCheck do\n let(:auth_check) { Appsignal::AuthCheck.new }\n before do\n @transmitter = mock\n Appsignal::Transmitter.should_receive(:new).\n with('h...
ruby
chosen
[ { "from": "system", "value": "Update plots helper spec to accomodate users that are not logged in\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe PlotsHelper, type: :helper do\n\n describe \"#link_to_featured_plant\" do\n\n let(:plot) { build(:plot, id: 1) }\n\n ...
ruby
chosen
[ { "from": "system", "value": "Fix issue with puppet_module_install, removed and using updated method from beaker core copy_module_to\n" }, { "from": "human", "value": "require 'beaker-rspec'\n\n# Install Puppet\nunless ENV['RS_PROVISION'] == 'no'\n hosts.each do |host|\n if host.is_pe?\n ...
ruby
chosen
[ { "from": "system", "value": "Add login with ui method for spec tests.\n\n" }, { "from": "human", "value": "module FeatureHelper\n def login_as(username)\n visit \"/login/#{username}\"\n expect(page).to have_content(username)\n end\n\n def in_newly_opened_window\n sleep(2)\n page....
ruby
chosen
[ { "from": "system", "value": "Fix spec test for previous commit\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'pixelated::apt::preferences' do\n let(:facts) do\n {\n :operatingsystem => 'Debian',\n :lsbdistid => 'Debian',\n :lsbdistcodename...
ruby
chosen
[ { "from": "system", "value": "Add lines of code search\n" }, { "from": "human", "value": "require 'app_stats/stats'\n\nmodule AppStats\n module Stats\n\n #Sort the Ruby files in your project by number of has_many\n PIPE_MINUS_COVERAGE = '| grep -v \"coverage\"'\n CURRENT_FILE = File.ba...
ruby
chosen
[ { "from": "system", "value": "Support Heroku's HTTP Post deployhook.\n" }, { "from": "human", "value": "class DeploysController < ApplicationController\n \n skip_before_filter :verify_authenticity_token, :only => :create\n skip_before_filter :authenticate_user!, :only => :create\n \n def cr...
ruby
chosen
[ { "from": "system", "value": "Add method for getting 50 random schools from db with ajax\n" }, { "from": "human", "value": "class SchoolsController < ApplicationController\n\n\tdef index\n\t\t\n\tend\n\t\n\tdef search\n\t\t# @results = PgSearch.multisearch(params[\"search\"])\n\t\t@results = Sch...
ruby
chosen
[ { "from": "system", "value": "Use Arel.sql on hardcoded SQL.\n" }, { "from": "human", "value": "class WelcomeController < ApplicationController\n def index\n @most_popular_buildings = Building.left_joins(:toilet).group(:id).order('COUNT(toilets.id) DESC').limit(5)\n @random_buildings = Bu...
ruby
chosen
[ { "from": "human", "value": "10156: Add feature spec for form status changes\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nrequire \"rails_helper\"\n\nfeature \"form status display and changes\", js: true do\n let!(:form) { create(:form, :draft, name: \"Myform\") }\n let(:u...
ruby
chosen
[ { "from": "system", "value": "Define :remove_sql_heder_comments only if not defined from upstream\n" }, { "from": "human", "value": "module ActiveRecord\n module Tasks\n class ChronomodelDatabaseTasks < PostgreSQLDatabaseTasks\n\n def structure_dump(*arguments)\n original_schema_...
ruby
chosen
[ { "from": "system", "value": "Improve OmniAuth version check to allow anything from 1.0 forward\n\nThis should enable people to try OmniAuth 2 currently in pre-release.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nbegin\n require \"omniauth\"\n require \"omniauth/version...
ruby
chosen
[ { "from": "system", "value": "Change template attribute data type to handle large json strings.\n" }, { "from": "human", "value": "class CreateFionaTables < ActiveRecord::Migration\n def change\n create_table :templates do |t|\n t.string :type\n t.string :key\n t.string :name\...
ruby
chosen
[ { "from": "system", "value": "Update logic for gettin question from email subject\n" }, { "from": "human", "value": "class EmailProcessor\n def self.process(email)\n from_email = email.from\n print \"From Email: #{from_email}\"\n user = User.where(email: from_email)\n if user.exists...
ruby
chosen
[ { "from": "system", "value": "Remove trailing space and Insert newline at the end of file\n" }, { "from": "human", "value": "require \"rails_helper\"\n\nRSpec.describe ItemsController, type: :controller do\n\n describe \"GET #index\" do\n it \"returns http success\" do\n get :index\n ...
ruby
chosen
[ { "from": "system", "value": "Add some docs to error wrapper [ci skip]\n" }, { "from": "human", "value": "module ROM\n module SQL\n module Commands\n module ErrorWrapper\n def call(*args)\n super\n rescue *ERROR_MAP.keys => e\n raise ERROR_MAP[e.class], e...
ruby
chosen
[ { "from": "system", "value": "Rename attribute removed_by => removed_by_id\n\nto ease overriding method in travis-api\n" }, { "from": "human", "value": "module Travis\n module Logs\n module Services\n class FetchLog\n def initialize(database: nil)\n @database = database ...
ruby
chosen
[ { "from": "system", "value": "Update MediaWiki detector for changes in MediaWiki 1.18" }, { "from": "human", "value": "\nmodule Versionator\n module Detector\n # Detects {MediaWiki}[http://www.mediawiki.org].\n class Mediawiki < Base\n set :app_name, \"MediaWiki\"\n set :project...
ruby
chosen
[ { "from": "human", "value": "Implement rake task to tweet about most hottest entry.\n" }, { "from": "gpt", "value": "namespace :twitter do\n desc \"This task is called by the Heroku scheduler add-on\"\n puts \"Start making tweet of hot entry\"\n task :tweet_hot_entry => :environment do\n \tc...
ruby
chosen
[ { "from": "system", "value": "Fix problem with firewall list not working on 1.9\n" }, { "from": "human", "value": "module Brightbox\n desc 'List Firewall Rules'\n arg_name '[firewall-policy-id...]'\n command [:list] do |c|\n c.action do |global_options,options,args|\n\n if args.empty?...
ruby
chosen
[ { "from": "system", "value": "Use sanitize instead of quote_value\n\nUnder the hood it works the same as passing nil to quote_value in Rails\n4+, and is deprecated in Rails 5.\n" }, { "from": "human", "value": "module Eaco\n module Adapters\n module ActiveRecord\n\n ##\n # Authoriz...
ruby
chosen
[ { "from": "system", "value": "Change migrations in RenderGenerator to output their output :)\n" }, { "from": "human", "value": "module Wheelie\n class RenderGenerator < Rails::Generators::Base\n desc 'Render the Wheelie metamodel'\n \n argument :path, required: true, type: :string, des...
ruby
chosen
[ { "from": "system", "value": "Disable default request logging - use logstasher instead\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 ...
ruby
chosen
[ { "from": "system", "value": "Add app/presenters to load path\n" }, { "from": "human", "value": " require File.expand_path('../boot', __FILE__)\n\n # Pick the frameworks you want:\n require \"active_record/railtie\"\n require \"action_controller/railtie\"\n require \"action_mailer...
ruby
chosen
[ { "from": "human", "value": "Spec: Add a not overly helpful case\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\nrequire \"spec_helper\"\n\ndescribe \"Case: Not overly helpful\" do\n %w(\n john.doe@domain.ca\n ).each do |kase|\n it \"does not propose a hint for #{kase}\" ...
ruby
chosen
[ { "from": "system", "value": "Remove new_record? expectation since since its not implemented by us\n" }, { "from": "human", "value": "shared_examples_for \"an instance supporting serialization\" do\n it 'serializes correctly with to_yaml' do\n deserialized = YAML.load(subject.to_yaml)\n\n ...
ruby
chosen
[ { "from": "system", "value": "Split RemoveOldStories spec in two\n\nOne assertion per test.\n" }, { "from": "human", "value": "require 'spec_helper'\napp_require 'tasks/remove_old_stories'\n\ndescribe RemoveOldStories do\n before do\n @arel_mock = double('arel')\n @arel_mock.stub(:delete_...
ruby
chosen
[ { "from": "system", "value": "Make sure that we open the jpeg in binary mode.\n" }, { "from": "human", "value": "require 'carrierwave/test/matchers'\n\nRSpec.describe ImageUploader, type: :model do\n include CarrierWave::Test::Matchers\n let(:instance) { create(:instance) }\n\n with_tenant(:i...
ruby
chosen
[ { "from": "system", "value": "Use set method to set backend type\n" }, { "from": "human", "value": "require 'serverspec'\nrequire 'net/ssh'\nrequire 'tempfile'\n\ninclude Specinfra::Helper::Ssh\n\ndef vagrant(cmd)\n Bundler.with_clean_env do\n env = {\"VAGRANT_CWD\" => File.dirname(__FILE__)...
ruby
chosen
[ { "from": "system", "value": "Add failing test for non-boolean command-line args\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Pdftotext::Document do\n\n subject { Pdftotext::Document.new(fixture_path) }\n\n it \"knows the path\" do\n expect(subject.path).to eql(fixtu...
ruby
chosen
[ { "from": "system", "value": "Add rake as a development dependency.\n" }, { "from": "human", "value": "require_relative \"lib/minitest/sugar/version\"\n\nGem::Specification.new do |s|\n s.name = \"minitest-sugar\"\n s.version = Minitest::Sugar::VERSION\n s.summary = \"Useful he...
ruby
chosen
[ { "from": "system", "value": "Use correct disk extension formats for Hyper-V\n" }, { "from": "human", "value": "require \"log4r\"\n\nmodule VagrantPlugins\n module HyperV\n module Cap\n module ValidateDiskExt\n LOGGER = Log4r::Logger.new(\"vagrant::plugins::hyperv::validate_disk_...
ruby
chosen
[ { "from": "system", "value": "Add watchOS and tvOS support.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"MJExtension\"\n s.version = \"3.2.5\"\n s.ios.deployment_target = '9.0'\n s.osx.deployment_target = '10.8'\n s.summary = \"A fast and convenient...
ruby
chosen
[ { "from": "system", "value": "Update PropertyDslHandler to better generate documentation\n" }, { "from": "human", "value": "# A YARD handler to deal with the \"property\" DSL method.\nclass PropertyDslHandler < YARD::Handlers::Ruby::Base\n handles method_call(:property)\n\n def process\n na...
ruby
chosen
[ { "from": "human", "value": "Add some tests for the analyzer\n" }, { "from": "gpt", "value": "require File.expand_path(File.dirname(__FILE__) + \"/../../test_helper\")\n\ninclude Xample::Text\n\ndescribe Analyzer do\n before :each do \n @obj = Object.new\n @obj.extend Analyzer\n end\n \...
ruby
chosen
[ { "from": "system", "value": "Add mac, TV and Watch support\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'Regex.swift'\n s.version = '1.0'\n s.summary = 'A Simple Swift NSRegularExpression wrapper'\n\n s.description = <<-DESC\nA simple...
ruby
chosen
[ { "from": "human", "value": "Add script to process mosaic msgcount logs\n" }, { "from": "gpt", "value": "def main()\n if ARGF.argv.empty?\n puts \"Usage: #{$PROGRAM_NAME} [list_of_msgcount_logs]\"\n exit 1\n end\n\n global_sum = 0.0\n global_count = 0\n ARGF.argv.each do |path|\n s...
ruby
chosen
[ { "from": "system", "value": "Fix command to ignore exception rasied when no IPs are found. Behavior changed in Diablo4 release.\n" }, { "from": "human", "value": "module HP\n module Cloud\n class CLI < Thor\n\n map %w(servers:delete servers:del) => 'servers:remove'\n\n desc \"serv...
ruby
chosen
[ { "from": "system", "value": "Fix markup language in post fabricator\n" }, { "from": "human", "value": "Fabricator(:post) do\n content { Faker::Lorem.paragraphs.join(\"\\n\\n\") }\n markup_language { Post::MARKUP_LANGUAGES.sample }\n author{ User.all.sample }\nend\n" }, { "from": "gpt...
ruby
chosen
[ { "from": "system", "value": "Test custom mappings for particular indices.\n" }, { "from": "human", "value": "require \"test_helper\"\nrequire \"multi_json\"\nrequire \"elasticsearch/search_server\"\nrequire \"elasticsearch/index_group\"\n\nclass IndexGroupTest < MiniTest::Unit::TestCase\n\n de...
ruby
chosen
[ { "from": "system", "value": "Add cyclid to the bindir\n" }, { "from": "human", "value": "# rubocop:disable Metrics/LineLength\nGem::Specification.new do |s|\n s.name = 'cyclid-client'\n s.version = '0.2.0'\n s.licenses = ['Apache-2.0']\n s.summary = 'Cyclid command line cl...
ruby
chosen
[ { "from": "system", "value": "Refactor simplify file lists in gemspec\n\nThese lists of files are not modified often, and the Git versions\nare cryptic enough to allow useless files to be added to the gem.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FIL...
ruby
chosen
[ { "from": "system", "value": "Create worker directory. Bundle into sub-dir.\n" }, { "from": "human", "value": "git \"#{node[:travis][:worker][:home]}\" do\n repository node[:travis][:worker][:repository]\n reference node[:travis][:worker][:ref]\n action :sync\n user \"travis\"\n user \"trav...
ruby
chosen
[ { "from": "human", "value": "Add RiakDTSetStrategy persistence api test\n" }, { "from": "gpt", "value": "## ------------------------------------------------------------------- \n## \n## Copyright (c) \"2014\" Dmitri Zagidulin\n##\n## This file is provided to you under the Apache License,\n## Ver...
ruby
chosen
[ { "from": "system", "value": "Fix require statements for util test\n" }, { "from": "human", "value": "require 'test_helper'\nrequire 'thermite/util'\n\nmodule Thermite\n class UtilTest < Minitest::Test\n include Thermite::ModuleTester\n\n class Tester\n include Thermite::TestHelper\n...
ruby
chosen
[ { "from": "system", "value": "Add rate var for blink example.\n" }, { "from": "human", "value": "require 'bundler/setup'\nrequire 'firmata'\n\nboard = Firmata::Board.new('/dev/tty.usbmodemfd13131')\n\nboard.connect\n\npin_number = 3\n\n10.times do\n board.digital_write pin_number, Firmata::Boar...
ruby
chosen
[ { "from": "system", "value": "Update R version for default\n" }, { "from": "human", "value": "require \"minitest/autorun\"\nrequire \"minitest/reporters\"\nMinitest::Reporters.use! [Minitest::Reporters::JUnitReporter.new(reports_dir=\"/tmp/result/junit\")]\n\ndescribe 'check R version' do\n\n i...
ruby
chosen
[ { "from": "system", "value": " Expand paths for compiler flags\n Don't build libstemmer.o on windows - should be build manually\n" }, { "from": "human", "value": "ENV['RC_ARCHS'] = '' if RUBY_PLATFORM =~ /darwin/\nrequire \"mkmf\"\n\nROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'...
ruby
chosen
[ { "from": "human", "value": "Add code wars (7) - is valid identifier\n" }, { "from": "gpt", "value": "# http://www.codewars.com/kata/563a8656d52a79f06c00001f/train/\n# --- iteration 1 ---\ndef is_valid(idn)\n return false if idn.size < 1\n return false unless /[a-z_$]/i === idn[0] \n return f...
ruby
chosen
[ { "from": "system", "value": "Add more specs for Action.reset.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Ethon::Easies::Http::Action do\n let(:easy) { Ethon::Easy.new }\n\n describe \".reset\" do\n let(:action) { Ethon::Easies::Http::Action }\n before { action...
ruby
chosen
[ { "from": "human", "value": "Add spec for opening the ArticleGraphs component\n\nThis exercises a request that is being converted from jquery.ajax to `request`.\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nrequire 'rails_helper'\n\ndescribe 'Articles Edited view', type: :fea...
ruby
chosen