conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add full username of the deployer" }, { "from": "human", "value": "require 'capistrano'\nrequire 'cap-git-deploy/version'\n\nrequire 'etc'\n\nmodule Cap\n module Git\n module Deploy\n # utility functions\n\n # The name of the branch we are deploying\n ...
ruby
chosen
[ { "from": "system", "value": "Fix issue with dispatcher extensions not working with Rails 3.x\n" }, { "from": "human", "value": "module ActionDispatch\n module Routing\n class RouteSet\n class Dispatcher\n\n def controller(params, default_controller=true)\n if params && ...
ruby
chosen
[ { "from": "system", "value": "Deal with Proc subclass problems\n" }, { "from": "human", "value": "module Propr\n class Property < Proc\n\n # @return [String]\n attr_reader :name\n\n # @return [Propr::Base]\n attr_reader :rand\n\n def initialize(name, rand, body)\n super(&bod...
ruby
chosen
[ { "from": "system", "value": "Move object copying code to initialize_copy method.\n" }, { "from": "human", "value": "module Rake\n # ##########################################################################\n # Mixin for creating easily cloned objects.\n #\n module Cloneable\n # Clone an...
ruby
chosen
[ { "from": "system", "value": "Add a settable logger to the module\n" }, { "from": "human", "value": "require 'her'\nrequire 'cloudera-manager/middleware/url_prefix'\nrequire 'cloudera-manager/middleware/json_parser'\nrequire 'cloudera-manager/middleware/json_serializer'\n\nmodule ClouderaManager...
ruby
chosen
[ { "from": "system", "value": "Allow for >1 caching type\n" }, { "from": "human", "value": "module ContentfulRails\n class Engine < ::Rails::Engine\n\n isolate_namespace ContentfulRails\n\n #Iterate through all models which inherit from ContentfulModel::Base\n #and add an entry mapping ...
ruby
chosen
[ { "from": "system", "value": "Include error information on superadmin responses\n" }, { "from": "human", "value": "class Superadmin::SuperadminController < ActionController::Base\n include SslRequirement\n before_filter :authenticate\n\n # this disables SSL requirement in non-production envir...
ruby
chosen
[ { "from": "system", "value": "Add Randomness to ID generation\n" }, { "from": "human", "value": "module InlineSvg\n class IdGenerator\n def self.generate(base, salt)\n bytes = Digest::SHA1.digest(\"#{base}-#{salt}\")\n Digest.hexencode(bytes).to_i(16).to_s(36)\n end\n end\nend\...
ruby
chosen
[ { "from": "system", "value": "Fix: Return JSON not a Hash\n" }, { "from": "human", "value": "module Kongkit\n class Client\n class Resource\n include Enumerable\n\n def initialize(client, data, status_code)\n @client = client\n @data = data\n @statu...
ruby
chosen
[ { "from": "system", "value": "Move logging attr to top of class for better organization.\n" }, { "from": "human", "value": "module SQLite3\n class Database\n def initialize(filename)\n @handle = Pointer.new(::Sqlite3.type)\n @logging = false\n\n result = sqlite3_open(filename,...
ruby
chosen
[ { "from": "system", "value": "Kill a pair of redundant parens\n" }, { "from": "human", "value": "unless String.method_defined? :format\n class String\n # A nicer alternative to Kernel#sprintf and String#%.\n #\n # @return [String] the formatted string\n #\n # @example\n # 'T...
ruby
chosen
[ { "from": "system", "value": "Make sure we're using the same hooks as Rails.\n" }, { "from": "human", "value": "module RailsDevelopmentBoost\n ActiveSupport.on_load(:after_initialize) do\n ReferencePatch.apply!\n DependenciesPatch.apply!\n DescendantsTrackerPatch.apply!\n end\n \n A...
ruby
chosen
[ { "from": "system", "value": "Add reflection file for 4.3\n" }, { "from": "human", "value": "puts 'Hello there, what\\'s your first name?'\nfirst_name = gets.chomp\nputs 'And your middle name?'\nmiddle_name = gets.chomp\nputs 'Wonderful, and finally, what is your last name?'\nlast_name = gets.ch...
ruby
chosen
[ { "from": "system", "value": "Use all Rails 5.1 defaults\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n#\n# This file contains migration options to ease your Rails 5.1 upgrade.\n#\n# Once upgraded flip defaults one by one to migrate to the new de...
ruby
chosen
[ { "from": "system", "value": "Add \"tar.xz\" to list of artifacts to push to s3\n" }, { "from": "human", "value": "# encoding: utf-8\n\nclass S3DependencyUploader\n def initialize(dependency, bucket_name, artifacts_dir)\n @dependency = dependency\n @bucket_name = bucket_name\n @artifac...
ruby
chosen
[ { "from": "system", "value": "Call rake task to create default data.\n\n- Call a rake task to create default data.\n" }, { "from": "human", "value": "namespace :db do\n namespace :test do\n \n desc 'after completing db:test:prepare load probe configurations'\n task :prepare do\n A...
ruby
chosen
[ { "from": "system", "value": "Test Welcome controllers index action\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass WelcomeControllerTest < ActionDispatch::IntegrationTest\n # test \"the truth\" do\n # assert true\n # end\nend\n" }, { "from": "gpt", "value": "r...
ruby
chosen
[ { "from": "system", "value": "Use hook scope names of rspec v2\n" }, { "from": "human", "value": "require_relative 'generator'\n\nmodule DeltaTest\n module SpecHelpers\n\n ###\n # Setup generator and hook analyzer on contexts\n ###\n def use_delta_test(example)\n $delta_test_ge...
ruby
chosen
[ { "from": "system", "value": "Add unit test on packages install\n" }, { "from": "human", "value": "#\n# Cookbook Name:: universe_ubuntu\n# Spec:: default\n#\n# Copyright (c) 2016 The Authors, All Rights Reserved.\n\nrequire 'spec_helper'\n\ndescribe 'universe_ubuntu::default' do\n context 'When...
ruby
chosen
[ { "from": "system", "value": "Correct env['SERVER_NAME'] check in call\n" }, { "from": "human", "value": "require 'rack'\nrequire 'uri'\nclass FakeBraintreeRedirect\n def initialize(app)\n @app = app\n end\n\n def call(env)\n request = Rack::Request.new(env)\n if env['SERVER_NAME'] =...
ruby
chosen
[ { "from": "system", "value": "Rewrite to use a simple worker pool\n" }, { "from": "human", "value": "module Harvestman\n module Crawler\n class Fast < Base\n def crawl(&block)\n if @pages.nil?\n crawl_url(@base_url, &block)\n else\n threads = []\n ...
ruby
chosen
[ { "from": "system", "value": "Fix warning about block and default value\n\nRuby's Array#fetch accepts either a default value or a block, but not\nboth. If both are passed in, then it uses the block and outputs this\nwarning:\n\n```\nlib/liquid/static_registers.rb:34: warning: block supersedes default value ...
ruby
chosen
[ { "from": "system", "value": "Add limit args to Paginator\n" }, { "from": "human", "value": "class NationBuilder::Paginator\n attr_reader :body\n\n def initialize(client, body)\n @client = client\n @body = body\n end\n\n [:next, :prev].each do |page_type|\n define_method(:\"#{page_t...
ruby
chosen
[ { "from": "system", "value": "Add NoMethodError rescue to SolrDataconfig\n" }, { "from": "human", "value": "module Vcsmap\n module Plugin\n class SolrDataconfig < Vcsmap::Plugin::BasePlugin\n def initialize\n @search_string = 'filename:dataConfig.xml+dataSource+JdbcDataSource+pas...
ruby
chosen
[ { "from": "system", "value": "Add the two different item requests as well\n" }, { "from": "human", "value": "require_relative 'api_method'\n\nmodule Scrapinghub\n class Scrapinghub\n METHODS = {\n projects: ApiMethod.new('scrapyd/listprojects', []),\n spiders: ApiMethod.new('s...
ruby
chosen
[ { "from": "system", "value": "Support generating gems.yml for development and cucumber environments.\n" }, { "from": "human", "value": "namespace :moonshine do\n task :apply_ci_manifest do\n sh \"sudo RAILS_ENV=#{RAILS_ENV} shadow_puppet app/manifests/ci_manifest.rb\"\n end\nend\n\nnamespac...
ruby
chosen
[ { "from": "system", "value": "Fix the spec using the right return authorization\n\nSolidus EasyPost extension uses a custom\nreturn authorization class that wrap the Solidus one.\n" }, { "from": "human", "value": "RSpec.describe SolidusEasypost::ShipmentBuilder do\n describe '.from_package', vc...
ruby
chosen
[ { "from": "system", "value": "Update for Bunto 2 support" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'bunto-paginate/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "human", "value": "Add feature specs for Search.\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\nfeature \"Search\", :truncate => true, :js => true do\n background do\n FactoryGirl.create :transaction, :name => 'Foobar Something'\n FactoryGirl.create :transaction, :na...
ruby
chosen
[ { "from": "human", "value": "Add script to remove non-necessary indexes on a database.\n\nCurrently, non-necessary indexes are either:\n _id\n metaData.tenantId, _id\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\nrequire 'mongo'\n\nDB = ARGV[0]\n\nif (ARGV.size != 1)\n puts \"ruby rmv-...
ruby
chosen
[ { "from": "system", "value": "Make Chef Zero lowercase in validation (conforms to other keys)\n" }, { "from": "human", "value": "require_relative \"chef_solo\"\n\nmodule VagrantPlugins\n module Chef\n module Config\n class ChefZero < ChefSolo\n attr_accessor :nodes_path\n\n ...
ruby
chosen
[ { "from": "system", "value": "Add private method and after_create\n" }, { "from": "human", "value": "class User < ActiveRecord::Base\n # Include default devise modules. Others available are:\n # :confirmable, :lockable, :timeoutable and :omniauthable\n devise :database_authenticatable, :regis...
ruby
chosen
[ { "from": "system", "value": "Add license and ruby version to comale.gemspec\n" }, { "from": "human", "value": "version = File.read(File.expand_path('../COMABLE_VERSION', __FILE__)).strip\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |s|\n s.name = 'coma...
ruby
chosen
[ { "from": "system", "value": "Fix acceptance tests on port\n" }, { "from": "human", "value": "require 'spec_helper_acceptance'\n\ndescribe 'freeradius' do\n context 'when running puppet code' do\n pp = \"class { 'freeradius': }\"\n\n it 'should apply with no errors' do\n apply_manife...
ruby
chosen
[ { "from": "system", "value": "Add column to test table definition\n" }, { "from": "human", "value": "class CreateUsers < ActiveRecord::Migration\n def change\n create_table :users do |t|\n t.string :name\n\n t.timestamps null: false\n end\n end\nend\n" }, { "from": "gpt...
ruby
chosen
[ { "from": "system", "value": "Fix failing version string test\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'puppet-debugger/plugin_test_helper'\n\ndescribe :help do\n include_examples \"plugin_tests\"\n let(:args) { [] }\n\n let(:help_output) do\n plugin.run(args)\n e...
ruby
chosen
[ { "from": "system", "value": "Change Name of Module To \"Trustbadge\"\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"trustbadge_iOS\"\n s.version = \"0.1.0-alpha.1\"\n s.summary = \"Trustbadge for iOS\"\n s.description = <<-DESC\n ...
ruby
chosen
[ { "from": "system", "value": "Update gemspec for mongoid 3.0+" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"mongoid-rspec/version\"\n\nGem::Specification.new do |s|\n s.name = \"mongoid-rspec\"\n s.version = Mon...
ruby
chosen
[ { "from": "human", "value": "Add spec for figfile object\n" }, { "from": "gpt", "value": "require \"spec_helper\"\n\ndescribe Figs::Figfile do\n subject (:path_figfile) { Figs::Figfile.new(\"a\",\"b\",\"c\") }\n subject (:git_figfile) { Figs::Figfile.new(\"a.git\",\"b\",\"c\") }\n \n it { sh...
ruby
chosen
[ { "from": "human", "value": "Add model tests for Phones (Contact phone numbers)\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Phone do\n it \"does not allow duplicate phone numbers per contact\" do\n contact = Contact.create(\n firstname: \"John\",\n lastname: ...
ruby
chosen
[ { "from": "system", "value": "Fix platform version in suse spec\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'build-essential::_suse' do\n let(:chef_run) do\n ChefSpec::Runner.new(platform: 'suse', version: '11.03')\n .converge(described_recipe)\n end\n\n it 'i...
ruby
chosen
[ { "from": "system", "value": "Remove spec.binaries; there are none\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'faker/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Set revision attribute on tarsnap package\n" }, { "from": "human", "value": "class Tarsnap < FPM::Cookery::Recipe\n source \"https://www.tarsnap.com/download/tarsnap-autoconf-1.0.36.1.tgz\"\n homepage \"https://www.tarsnap.com/\"\n sha256 \"a2909e01e2f983179d63ef...
ruby
chosen
[ { "from": "system", "value": "Switch from Dir.foreach to Dir.glob (assumes no hidden root directories will ever be desirable)\n" }, { "from": "human", "value": "require 'packager/version'\n\nrequire 'pathname'\n\nclass Packager\n class Executor\n def self.execute_on(items)\n items = [it...
ruby
chosen
[ { "from": "system", "value": "Add if exists to drop command\n" }, { "from": "human", "value": "namespace :gitlab do\n namespace :db do\n desc 'GitLab | Manually insert schema migration version'\n task :mark_migration_complete, [:version] => :environment do |_, args|\n unless args[:ve...
ruby
chosen
[ { "from": "system", "value": "Use DistributedLock when writing to content store\n\nThis is to ensure that we don't make writes to the content store\nconcurrently. When this happens we can end up with the content store\nbeing out of sync as it doesn't perform any locking.\n\nYou might wonder why this is bein...
ruby
chosen
[ { "from": "system", "value": "Create instance variable to refer to the correct individual when on a show page\n" }, { "from": "human", "value": "class UsersController < ApplicationController\n def new\n @user = User.new\n end\n\n def create\n user_params\n @user = User.new(user_param...
ruby
chosen
[ { "from": "human", "value": "Add Chef::Provisioning::FogDriver::Providers::SoftLayer class to support provisioning in SoftLayer (already supported in fog).\n" }, { "from": "gpt", "value": "class Chef\n module Provisioning\n module FogDriver\n module Providers\n class SoftLayer < ...
ruby
chosen
[ { "from": "system", "value": "Fix correct name for \"drop rails_admin\" migration file" }, { "from": "human", "value": "require 'rails/generators'\nrequire File.expand_path('../utils', __FILE__)\n\nmodule RailsAdmin\n class UninstallGenerator < Rails::Generators::Base\n include Rails::Genera...
ruby
chosen
[ { "from": "system", "value": "fix: Add Accept header to requests in NetworkLoader\n\nThis allows development servers to serve the correct file type.\r\n\r\nFor more information see https://github.com/ElMassimo/vite_ruby/pull/93#issuecomment-865426710" }, { "from": "human", "value": "class Premai...
ruby
chosen
[ { "from": "system", "value": "Revert \"prevent find_method test running on MRI 1.8\"\n\nThis reverts commit 88580c0731cbc41e053b2277aaec912394f31598.\n" }, { "from": "human", "value": "require 'helper'\n\n# we turn off the test for MRI 1.8 because our source_location hack\n# for C methods actual...
ruby
chosen
[ { "from": "system", "value": "Revert \"Break gem test to test Hudson.\"\n\nThis reverts commit 955aefe2f9bf5b0016d1bbadf9aaebafecd846e6.\n" }, { "from": "human", "value": "require 'helper'\n\nclass TestDeprecations < Test::Unit::TestCase\n context \"with Gelf object\" do\n should \"fail\" do...
ruby
chosen
[ { "from": "system", "value": "Replace evil sleep with Time.new stub.\n" }, { "from": "human", "value": "# encoding: UTF-8\n\nrequire 'test_helper'\n\ndescribe Vines::TokenBucket do\n subject { Vines::TokenBucket.new(10, 1) }\n\n it 'raises with invalid capacity and rate values' do\n -> { Vi...
ruby
chosen
[ { "from": "system", "value": "Add dependency on application_dotnet in test cookbook\n" }, { "from": "human", "value": "name 'webapp_test'\nmaintainer 'The Authors'\nmaintainer_email 'you@example.com'\nlicense 'all_rights'\ndescription 'Installs/Configures webapp_test'\nlong_description 'Installs...
ruby
chosen
[ { "from": "system", "value": "Update podspec file to version 0.2\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'SPLocalizedString'\n s.version = '0.1'\n s.license = 'MIT'\n s.summary = 'An easy way to localize iOS apps.'\n s.homepage = 'https://github.com/sergiou...
ruby
chosen
[ { "from": "human", "value": "Set up basic relativize_paths spec\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\ndescribe Nanoc::Filters::RelativizePaths do\n subject(:filter) { described_class.new(assigns) }\n\n let(:assigns) do\n { item_rep: item_rep }\n end\n\n let(:it...
ruby
chosen
[ { "from": "system", "value": "Use paginate total entries to get a consistent count for awards\n" }, { "from": "human", "value": "module Hovercard\n class UsersController < ApplicationController\n before_filter :find_user\n\n def hovercard\n @challenges_count = @user.supported_challen...
ruby
chosen
[ { "from": "system", "value": "Set minimum Ruby version in the gemspec" }, { "from": "human", "value": "lib = File.expand_path('../lib/', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'jwe/version'\n\nGem::Specification.new do |s|\n s.name = 'jwe'\n s.versio...
ruby
chosen
[ { "from": "system", "value": "Update Heredoc to support single quotes without escaping\n" }, { "from": "human", "value": "module AE\n\n module ConsolePlugin\n\n class Feature\n\n # @!method initialize(app)\n # The constructor of the feature is passed an struct giving access to \n ...
ruby
chosen
[ { "from": "human", "value": "Add test coverage for the deprecated connection setup.\n\nEnsure it raises the deprecation warning.\n" }, { "from": "gpt", "value": "require 'test_helper'\n\nmodule Spyke\n class ConfigConnectionWarnTest < MiniTest::Test\n\n def test_config_connection_warn\n ...
ruby
chosen
[ { "from": "system", "value": "Change ' -> \" in podspec for uniformity\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n\n s.name = \"SPTPersistentCache\"\n s.version = \"1.0.0\"\n s.summary = \"SPTPersistentCache is a fast, binary, LRU cache used in the Spotif...
ruby
chosen
[ { "from": "system", "value": "Fix logger test to match improved logging\n" }, { "from": "human", "value": "require 'spec_helper'\ndescribe Upsert do\n describe \"logger\" do\n it \"logs where you tell it\" do\n begin\n old_logger = Upsert.logger\n io = StringIO.new\n ...
ruby
chosen
[ { "from": "system", "value": "Enable rails-controller-testing Modules in rspec\n" }, { "from": "human", "value": "$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))\n$LOAD_PATH.unshift(File.dirname(__FILE__))\n# load Rails first\nrequire 'rails'\nrequire 'active_record'\nrequire ...
ruby
chosen
[ { "from": "system", "value": "Remove pride since it causes a couple of weird chars in travis-ci\n" }, { "from": "human", "value": "require 'minitest/autorun'\nrequire 'minitest/pride'\n\nrequire \"mocha\"\n\nrequire \"#{File.dirname(__FILE__)}/../lib/micro_kanren\"\n\nrequire \"#{File.dirname(__...
ruby
chosen
[ { "from": "system", "value": "Move back setting for test ES server" }, { "from": "human", "value": "require 'bundler'\nBundler.require\n\nrequire 'active_record'\nrequire 'database_cleaner'\n\nrequire 'support/fail_helpers'\nrequire 'support/class_helpers'\n\nrequire 'chewy/rspec'\n\nActiveRecor...
ruby
chosen
[ { "from": "system", "value": "Remove the unused method in the chefspec helper\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "require 'chefspec'\nrequire 'chefspec/berkshelf'\n\nRSpec.configure do |config|\n config.formatter = :d...
ruby
chosen
[ { "from": "system", "value": "Configure Mongoid before requiring models" }, { "from": "human", "value": "require \"rubygems\"\nrequire \"bundler\"\nBundler.require(:default)\n\nrequire File.expand_path(\"../../lib/mongoid_slug\", __FILE__)\nDir[\"#{File.dirname(__FILE__)}/models/*.rb\"].each { |...
ruby
chosen
[ { "from": "system", "value": "Use Ubuntu 18.04 in the specs not 16.04\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "require 'chefspec'\nrequire 'chefspec/berkshelf'\n\nRSpec.configure do |config|\n config.color = true ...
ruby
chosen
[ { "from": "system", "value": "Fix specs on ruby >= 2.1\n" }, { "from": "human", "value": "require 'parallel'\nrequire 'benchmark'\n\nRSpec.configure do |config|\n config.expect_with(:rspec) { |c| c.syntax = :should }\n config.mock_with(:rspec) { |c| c.syntax = :should }\n config.around { |exa...
ruby
chosen
[ { "from": "system", "value": "Stop manipulating load path ourselves\n\nRSpec already puts lib and spec in path\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/..')\n$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')\n\nrequir...
ruby
chosen
[ { "from": "system", "value": "Use .to_f instead of .match while determining Ruby version\n" }, { "from": "human", "value": "if RUBY_VERSION.match(/^1\\.9\\.\\d?$/)\n begin\n require 'simplecov'\n SimpleCov.start 'rails'\n rescue LoadError\n # not finding simplecov is no reason to fail...
ruby
chosen
[ { "from": "system", "value": "Revert \"Need to pass through a content-type when using upload_image to appease paperclip\"\n\nThis reverts commit b04d57cd7ed194fcf59c4ed67e844c832bdbcc2d.\n" }, { "from": "human", "value": "module Spree\n module Api\n module TestingSupport\n module Helper...
ruby
chosen
[ { "from": "system", "value": "Move methods into correct scope" }, { "from": "human", "value": "require_dependency \"renalware/feeds\"\n\nmodule Renalware\n module Feeds\n class MessageProcessor\n def call(raw_message)\n begin\n message_payload = parse_message(raw_messag...
ruby
chosen
[ { "from": "system", "value": "Add user vcs_type query param\n" }, { "from": "human", "value": "require 'travis/api/v3/services/repository/deactivate'\n\nmodule Travis::API::V3\n class Services::Repository::Activate < Service\n def run!\n repository = check_login_and_find(:repository)\n ...
ruby
chosen
[ { "from": "system", "value": "Change libvirt method for creating storage pool\n\nWe should use define_storage pool_xml instead of create_storage_pool_xml\nso that\n\n* the pool is permanent\n* pool creation succeeds if the directory does not already exist\n" }, { "from": "human", "value": "requi...
ruby
chosen
[ { "from": "system", "value": "Add jquery-rails as a gem 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 'imageframer/rails/version'\n\nGem::Specification.new do |spec|\n s...
ruby
chosen
[ { "from": "system", "value": "Handle soft deleted products when refreshing cache\n\nSince cd3add960e Spree soft-deletes products and as such the models not\ndestroyed but updated setting a value for the `deleted_at` field.\n\nThis turns what used to be deletes into updates thus triggering AR's\nupdate callb...
ruby
chosen
[ { "from": "human", "value": "Add Tailor-Xcode integration ruby script\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\nrequire 'xcodeproj'\n\n# verify input\nbegin\n project = Xcodeproj::Project.open(ARGV[0])\nrescue\n abort(\"Integration Error: Invalid .xcodeproj file\")\nend\n\n# add bu...
ruby
chosen
[ { "from": "system", "value": "Fix DM timeline failing to load from database\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass DirectFeed < Feed\n include Redisable\n\n def initialize(account)\n @type = :direct\n @id = account.id\n @account = account\n ...
ruby
chosen
[ { "from": "system", "value": "Test that we can handle multiple nodes with the same label\n" }, { "from": "human", "value": "require File.expand_path '../test_helper', __FILE__\n\ncontext 'Parser' do\n test 'parses nodes' do\n text = <<-EOF\n A---B---C topic\n /\nD---E---F---G master...
ruby
chosen
[ { "from": "system", "value": "Switch to more Ruby-like style of if statement.\n" }, { "from": "human", "value": "# This class fetches pageview data by sending GET requests to stats.grok.se\n\nclass Grok\n\n # Given an article title and a date, return the number of page views for every\n # day ...
ruby
chosen
[ { "from": "system", "value": "Set the test order to random\n" }, { "from": "human", "value": "require 'bundler/setup'\nrequire 'minitest/autorun'\nrequire 'mocha/api'\nrequire 'rails'\n" }, { "from": "gpt", "value": "require 'bundler/setup'\nrequire 'minitest/autorun'\nrequire 'mocha...
ruby
chosen
[ { "from": "system", "value": "Initialize without .env for Travis-CI\n" }, { "from": "human", "value": "#-------------------------------------------------------------------------\n# # Copyright (c) Microsoft and contributors. All rights reserved.\n#\n# Licensed under the Apache License, Version 2...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary class Test::Unit::TestCase from the test helper\n\nI'm not sure what the purpose of this was meant to be.\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'bundler'\nbegin\n Bundler.setup(:default, :development)\nrescue Bundler::Bun...
ruby
chosen
[ { "from": "system", "value": "Fix VCR conflict with CodeClimate\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\nrequire \"simplecov\"\nSimpleCov.start\nrequire \"codeclimate-test-reporter\"\nCodeClimate::TestReporter.start\nrequire 'minly'\nrequire ...
ruby
chosen
[ { "from": "system", "value": "Use simplecov to do coverage reports\n" }, { "from": "human", "value": "require 'test/unit'\nrequire 'tmpdir'\nrequire File.dirname(__FILE__) + '/../lib/xmlcodec'\nrequire File.dirname(__FILE__) + '/simple_objects'\n\n\nclass Test::Unit::TestCase\n def with_temp_fi...
ruby
chosen
[ { "from": "system", "value": "Fix typo in variable name\n" }, { "from": "human", "value": "class SuggestedAnswersController < ApplicationController\n\n before_action :load_room_question\n after_action :push_room_questions\n\n def create\n @suggested_answer = @room_question.suggested_answer...
ruby
chosen
[ { "from": "human", "value": "Return the last email matching a subject\n\nThis can be used to pull out the email that PVB sends\nto the prison or the visitor.\n\nA filter has been added to ensure the email has been sent\nsince the the test started - we could have any number of\nsmoke tests running on a singl...
ruby
chosen
[ { "from": "system", "value": "Move to a array.map instead of foreach\n" }, { "from": "human", "value": "require \"rlrw/version\"\nrequire \"murmurhash3\"\n\nmodule Rlrw\n module LRW\n MOD = 2147483648\n def self.all(key, nodes)\n res = []\n nodes.each do |node|\n res << {...
ruby
chosen
[ { "from": "system", "value": "Fix the family member test\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :member do\n first_name \"Mario\"\n end\nend\n" }, { "from": "gpt", "value": "FactoryGirl.define do\n factory :member do\n first_name 'Mario'\n ...
ruby
chosen
[ { "from": "system", "value": "Fix invitation email from address\n\n* Remove trailing double quote\n" }, { "from": "human", "value": "class UserMailer < ActionMailer::Base\n default from: %{\"Sched.do\" <no-reply@sched.do>}\n\n def vote_confirmation(vote)\n @user = vote.voter\n @event = v...
ruby
chosen
[ { "from": "system", "value": "Remove row_sep (default) in headers according to feedback\n" }, { "from": "human", "value": "class ProvidedPoi < ActiveRecord::Base\n belongs_to :poi\n belongs_to :provider\n\n validates :poi_id, :provider, :provider_id, presence: true\n validates_uniqueness_of ...
ruby
chosen
[ { "from": "system", "value": "Move slips to bottom in list.\n" }, { "from": "human", "value": "Deface::Override.new(virtual_path: 'spree/admin/shared/_order_tabs',\n name: 'print_invoice_order_tab_links',\n insert_top: '[data-hook=\"admin_order_t...
ruby
chosen
[ { "from": "system", "value": "Add a test to make sure that the group can be created & saved if an\nstreet_suffix is provided.\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe Group do\n context \"validations\" do\n it { should validate_presence_of :primary_number }\n ...
ruby
chosen
[ { "from": "system", "value": "Update spec to new gem version number\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Oboe do\n it 'should return correct version string' do\n Oboe::Version::STRING.should == \"1.4.0.1\"\n end\nend\n" }, { "from": "gpt", "value"...
ruby
chosen
[ { "from": "human", "value": "Add expectation for locale loading\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe 'locales' do\n it 'adds our locales to the load path' do\n project_root = File.expand_path('../..', File.dirname(__FILE__))\n english_path = File.join(project...
ruby
chosen
[ { "from": "system", "value": "Add test for search without case insensitive\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe Project do\n let!(:project) { FactoryGirl.create(:project) }\n\n describe '#rate=' do\n it 'returns Money' do\n project.update_attributes!(ra...
ruby
chosen
[ { "from": "system", "value": "Fix HTML layout on sinatra test site\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'sinatra/base'\nrequire 'autoforme'\nrequire 'sinatra/flash'\nrequire 'rack/csrf'\n\nclass AutoFormeSpec::App < Sinatra::Base\n disable :run\n enable :sessions\n e...
ruby
chosen
[ { "from": "system", "value": "Make all objc headers private in swift spec\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"SafeRealmObject\"\n s.version = \"0.7.1\"\n s.summary = \"Thread-safe representation of a Realm Swift Object\"\n s.description = <...
ruby
chosen
[ { "from": "system", "value": "Fix Selenium deprecation suppressor in Selenium 3.x with specific ruby versions\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Capybara\n module Selenium\n module DeprecationSuppressor\n def initialize(*)\n @suppress_for_c...
ruby
chosen