conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Create the phrase if it's missing\n" }, { "from": "human", "value": "module Tolk\n module Import\n def self.included(base)\n base.send :extend, ClassMethods\n end\n\n module ClassMethods\n\n def import_secondary_locales\n locales = Dir.ent...
ruby
chosen
[ { "from": "system", "value": "Move location of ContentDocument::Navigation::Nav definition\n" }, { "from": "human", "value": "require 'epub/content_document/navigation/nav'\n\nmodule EPUB\n module ContentDocument\n class Navigation\n attr_accessor :navs\n alias navigations navs\n ...
ruby
chosen
[ { "from": "system", "value": "Add argument to install generator to specify model\n" }, { "from": "human", "value": "module Tok\n module Generators\n class InstallGenerator < Rails::Generators::Base\n source_root File.expand_path(\"../templates\", __FILE__)\n\n def copy_initializer\...
ruby
chosen
[ { "from": "system", "value": "Remove wildcard domains because of TransIP API bug\n\nDue to an unknown bug in either the Ruby client, or the TransIP API, DNS entries\nwith wildcards (*) in them, will fail the request:\n\n Transip::ApiError: Invalid API signature, signature does not match the\n request. (ti...
ruby
chosen
[ { "from": "system", "value": "Add a new action to the Groups Controller to prompt a user to provide\ntheir building location.\n" }, { "from": "human", "value": "class GroupsController < ApplicationController\n def assign\n user = current_user\n user.group_id = find_group(params[:address])...
ruby
chosen
[ { "from": "system", "value": "Drop fileicon from embedded authentication decorator\n" }, { "from": "human", "value": "module ManageIQ::Providers\n class EmbeddedAutomationManager::AuthenticationDecorator < MiqDecorator\n def self.fonticon\n 'fa fa-lock'\n end\n\n def self.fileicon...
ruby
chosen
[ { "from": "system", "value": "Remove foreign key constraint on 'compiled_packages' table for MySQL in migration script\n\nfixes:\n\n```\nMysql2::Error: Cannot drop index 'stemcell_id': needed in a foreign key constraint (Sequel::DatabaseError)\n```\n\n[#113954017](https://www.pivotaltracker.com/story/show/1...
ruby
chosen
[ { "from": "system", "value": "Fix the vending machine example\n" }, { "from": "human", "value": "\n$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))\n\nrequire 'minx'\n\nCOIN_SLOT = Minx.channel\nCOKE_TRAY = Minx.channel\nCHANGE_TRAY = Minx.channel\n\nVM = Minx.spawn do\n cokes_lef...
ruby
chosen
[ { "from": "system", "value": "Update rake requirement from ~> 10.0 to ~> 13.0\n\nUpdates the requirements on [rake](https://github.com/ruby/rake) to permit the latest version.\n- [Release notes](https://github.com/ruby/rake/releases)\n- [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc)\n- [...
ruby
chosen
[ { "from": "system", "value": "Fix syntax error from last commit (:\n" }, { "from": "human", "value": "require \"wptemplates/version\"\nrequire \"wptemplates/parser\"\n\nmodule Wptemplates\n \n def self.parse text\n parser.parse(text)\n \n def self.parser\n @parser ||= Parser.new\n end...
ruby
chosen
[ { "from": "system", "value": "Fix i18n deprecation warning when running tests\n" }, { "from": "human", "value": "require 'bundler'\nBundler.setup\n\nbegin\n require 'coveralls'\n Coveralls.wear!\nrescue LoadError\nend\n\nrequire 'with_model'\nRSpec.configure do |config|\n config.extend WithMo...
ruby
chosen
[ { "from": "system", "value": "Load ActiveModel for the specs.\n" }, { "from": "human", "value": "$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))\n$LOAD_PATH.unshift(File.dirname(__FILE__))\nrequire 'rspec'\nrequire 'subset_validator'\n\n# Requires supporting files with custom ...
ruby
chosen
[ { "from": "system", "value": "Change specs config to stop truncating output comparison\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nif ENV['COVERAGE'] || ENV['TRAVIS']\n require 'simplecov'\n require 'coveralls'\n\n SimpleCov.formatter = SimpleCov::Formatter::MultiForma...
ruby
chosen
[ { "from": "system", "value": "Add api group to SimpleCov\n" }, { "from": "human", "value": "require 'linkedin2'\n\nrequire 'rspec'\nrequire 'vcr'\nrequire 'pry'\nrequire 'byebug'\n\nrequire 'simplecov'\nSimpleCov.start do\n add_group \"API\", \"lib/evertrue/api\"\nend\n\nVCR.configure do |c|\n ...
ruby
chosen
[ { "from": "system", "value": "Fix code to use better variable names\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'veritas'\nrequire 'spec'\nrequire 'spec/autorun'\n\ninclude Veritas\n\n# require spec support files and shared behavior\nDir[File.expand_path('../{support,shared}/...
ruby
chosen
[ { "from": "system", "value": "Add webmock methods to rspec examples\n" }, { "from": "human", "value": "require 'asana'\nrequire 'vcr'\nrequire 'active_resource'\n\nVCR.configure do |c|\n c.cassette_library_dir = 'spec/fixtures/cassettes'\n c.hook_into :webmock\n c.default_cassette_options = {...
ruby
chosen
[ { "from": "system", "value": "Use RSpec >= 1.1.12 so 1.2 can be used as well\n" }, { "from": "human", "value": "require 'pathname'\nrequire 'rubygems'\n\ngem 'rspec', '~>1.1.12'\nrequire 'spec'\n\nrequire Pathname(__FILE__).dirname.expand_path.parent + 'lib/dm-is-searchable'\n\ndef load_driver(n...
ruby
chosen
[ { "from": "system", "value": "Fix Rubocop trailing / bug\n" }, { "from": "human", "value": "# typed: true\n# frozen_string_literal: true\n\nrequire \"forwardable\"\nrequire \"uri\"\n\nmodule RuboCop\n module Cop\n module Cask\n # This cop checks that a cask's homepage ends with a slash\...
ruby
chosen
[ { "from": "system", "value": "Split on guaranteed string param\n" }, { "from": "human", "value": "class CategoryService\n attr_reader :category, :category_params, :sub_category_params\n\n def initialize(category, category_params, sub_category_params)\n @category = category\n @category_pa...
ruby
chosen
[ { "from": "system", "value": "Use simpler singleton pattern in Metrics recorder\n" }, { "from": "human", "value": "require 'prometheus/client'\nrequire 'singleton'\n\nclass MetricsRecorder\n include Singleton\n\n attr_reader :revisions_submitted\n\n def initialize\n @prometheus = Prometheu...
ruby
chosen
[ { "from": "system", "value": "Remove boilerplate comment from podspec\n" }, { "from": "human", "value": "#\n# Be sure to run `pod lib lint NAME.podspec' to ensure this is a\n# valid spec and remove all comments before submitting the spec.\n#\n# Any lines starting with a # are optional, but encou...
ruby
chosen
[ { "from": "system", "value": "Update puma on solo instances\n" }, { "from": "human", "value": "if ['app_master', 'app', 'util', 'solo'].include?(node[:instance_role])\n node[:applications].each do |app, data|\n template \"/data/#{app}/shared/config/env.custom\"do\n source \"env.custom\"...
ruby
chosen
[ { "from": "human", "value": "Add OpenStack Liberty keystone v3 specs\n\nAdd OpenStack Liberty keystone v3 specs\n" }, { "from": "gpt", "value": "require_relative \"refresh_spec_common\"\n\ndescribe ManageIQ::Providers::Openstack::CloudManager::Refresher do\n include Openstack::RefreshSpecCommon...
ruby
chosen
[ { "from": "system", "value": "Change BatchEntry error_message to be text" }, { "from": "human", "value": "class CreateBatchEntries < ActiveRecord::Migration\n def change\n create_table :batch_entries do |t|\n t.belongs_to :batch_registries, index: true\n t.text 'payload', limit: 1_...
ruby
chosen
[ { "from": "system", "value": "Fix homepage url in gemspec\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'kong/version'\n\nGem::Specification.new do |spec|\n spec.name = \"...
ruby
chosen
[ { "from": "system", "value": "Add create and new to images controller\n" }, { "from": "human", "value": "class ImagesController < ApplicationController\n include ActionController::Live\n\n def new\n @image = Image.new\n end\n\n def create\n end\n\n def show\n end\n\n private\n\n def ...
ruby
chosen
[ { "from": "system", "value": "Make sure to always find a default template. TODO: fix if all templates have been deleted.\n" }, { "from": "human", "value": "class OrdersController < ApplicationController\n \n around_filter :shopify_session\n \n def index\n @orders = ShopifyAPI::Order.find(...
ruby
chosen
[ { "from": "system", "value": "Update Paul's email in gemspec\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path(\"../lib\", __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'authem/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Update account migrations to latest Rails datatypes\n\n" }, { "from": "human", "value": "class Install3accounts < ActiveRecord::Migration\r\n def self.up\r\n create_table \"accounts\", :force => true do |t|\r\n \tt.column \"name\", :string\r\n end\r\n\r\n ...
ruby
chosen
[ { "from": "system", "value": "Add FileUtils.chmod to the Node.js adapter" }, { "from": "human", "value": "module FileUtils\n extend self\n `var __fs__ = #{File}.__fs__`\n\n def cp source, target\n target = File.join(target, File.basename(source)) if File.directory? target\n `__fs__.writ...
ruby
chosen
[ { "from": "system", "value": "Clean up the test a bit.\n" }, { "from": "human", "value": "require 'spec_helper'\n\nif sequel_present?\n require 'sequel'\n\n describe \"Sequel integration\" do\n let(:file) { File.expand_path('lib/appsignal/integrations/sequel.rb') }\n let(:db) { Sequel....
ruby
chosen
[ { "from": "system", "value": "Update Club Model for Formatting\n\nFix formatting of some code within the Club model.\n" }, { "from": "human", "value": "class Club < ActiveRecord::Base\n attr_accessible :name, :description, :price_cents, :logo\n\n monetize :price_cents\n\n validates :name, ...
ruby
chosen
[ { "from": "system", "value": "Remove cron to send suspension reminders\n\nwe'll revert this change when we have\napproved the change to actually suspend\nuser accounts. both these changes need\nto go hand-in-hand.\n" }, { "from": "human", "value": "# default cron env is \"/usr/bin:/bin\" which i...
ruby
chosen
[ { "from": "system", "value": "Support action format from Skyshaper Wiki quotes\n" }, { "from": "human", "value": "class Line < ActiveRecord::Base\n belongs_to :person\n belongs_to :quote\n \n validates :person, :body, presence: true\n \n PATTERNS = [\n [ /<\\s*([^>]+)\\s*>\\s*(.*)$/, fa...
ruby
chosen
[ { "from": "system", "value": "Remove attr_accessible from Plan model\n\nThe 'protected_attributes' gem is removed from master, then 'attr_accessible' cannot be used anymore\n" }, { "from": "human", "value": "class Plan < ActiveRecord::Base\n attr_accessible :plan_code, :name, :amount, :payment_...
ruby
chosen
[ { "from": "system", "value": "Fix bug with scoping hosts/visitors\n" }, { "from": "human", "value": "class Role < ActiveRecord::Base\n after_create :create_availabilities # add to spec\n\n belongs_to :person\n belongs_to :event\n\n accepts_nested_attributes_for :person, :update_only => true\...
ruby
chosen
[ { "from": "human", "value": "Replace customisations with explicit patch in an initializer\n\nSee previous commit.\n\nThis isn't nice, but it does the same job as the gem did. We can also update this code now as Rails changes (the gem was incompatible with Rails 7).\n" }, { "from": "gpt", "value"...
ruby
chosen
[ { "from": "system", "value": "Mark session cookie as secure\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\nLabdb::Application.config.session_store :cookie_store, key: '_straightlabdb_session'\n\n# Use the database for sessions instead of the coo...
ruby
chosen
[ { "from": "system", "value": "Use full path in require to allow load from crons\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\n# Your secret key for verifying cookie session data integrity.\n# If you change this key, all old sessions will become...
ruby
chosen
[ { "from": "system", "value": "Fix session store bug on development\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\nif Configuration[:base_domain]\n Catarse::Application.config.session_store :active_record_store, domain: Configuration[:base_domai...
ruby
chosen
[ { "from": "system", "value": "Fix for issue number 208\n" }, { "from": "human", "value": "#\n# Cookbook Name:: kafka-bcpc\n# Recipe: setattr\n\n# Override JAVA related node attributee\nnode.override['java']['jdk_version'] = '7'\nnode.override['java']['jdk']['7']['x86_64']['url'] = get_binary_ser...
ruby
chosen
[ { "from": "human", "value": "Add configuration file for watchr.\n" }, { "from": "gpt", "value": "# Time notification will be displayed before disappearing automatically\nEXPIRATION_IN_SECONDS = 2\nERROR_STOCK_ICON = \"gtk-dialog-error\"\nSUCCESS_STOCK_ICON = \"gtk-dialog-info\"\n\n# Convenience ...
ruby
chosen
[ { "from": "system", "value": "Disable warden intercept when returning 401\n" }, { "from": "human", "value": "require 'bundler'\nBundler.require\nrequire 'yaml'\n\nrequire_relative 'lib/warden'\nrequire_relative 'lib/auth_helpers'\nrequire_relative 'lib/models/setup'\n\n# Load Configuration\nset ...
ruby
chosen
[ { "from": "human", "value": "Update events missing a calendar year\n" }, { "from": "gpt", "value": "namespace :after_party do\n desc 'Deployment task: update_academic_years_for_events'\n task update_academic_years_for_events: :environment do\n puts \"Running deploy task 'update_academic_yea...
ruby
chosen
[ { "from": "system", "value": "Change the path the stand-alone sidekiq admin runs on to /sidekiq\n\nChanging this path is easier than messing around with lots of nginx\nrules\n" }, { "from": "human", "value": "require 'sidekiq'\n\nSidekiq.configure_client do |config|\n config.redis = { :size => ...
ruby
chosen
[ { "from": "system", "value": "Add correct path for executables and bindir\n" }, { "from": "human", "value": "# coding: utf-8\n\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'mako/version'\n\nGem::Specification.new do |spec|\n spec....
ruby
chosen
[ { "from": "system", "value": "Add explanatory note for \"off-session\" payment processing\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule OrderManagement\n module Order\n class StripeScaPaymentAuthorize\n include FullUrlHelper\n\n def initialize(order, of...
ruby
chosen
[ { "from": "system", "value": "Update location of system tests screenshots\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire \"test_helper\"\n\n# Set up ApplicationSystemTestCase system tests.\nclass ApplicationSystemTestCase < ActionDispatch::SystemTestCase\n driven_by...
ruby
chosen
[ { "from": "system", "value": "Add indication to see if program is running and change date to run test\n" }, { "from": "human", "value": "require 'nokogiri'\nrequire 'open-uri'\nrequire 'mongo'\n\ninclude Mongo\n\nmongo_client = MongoClient.new(\"localhost\", 27017)\ndb = mongo_client.db(\"kexp\"...
ruby
chosen
[ { "from": "system", "value": "Implement abstract `root_directory` method in ViewHelpers\n\nFrom Practical Object-Oriented Design In Ruby, page 151, by Sandi Metz:\n\n\"Even if there were no reasonable application default for [the foo\nmethod], the [bar] module must still implement the [foo] method. The\nrul...
ruby
chosen
[ { "from": "system", "value": "Install forever globally with npm and start a specific script\n" }, { "from": "human", "value": "\r\n\r\nbash \"install_forever\" do\r\n\tcode <<-EOH\r\n\t\tsudo npm install forever -g\r\n\t\tEOH\r\n\tnot_if \"type -p forever\"\r\nend" }, { "from": "gpt", ...
ruby
chosen
[ { "from": "system", "value": "Call up previously defined service resource to avoid cloning\n" }, { "from": "human", "value": "#\n# Cookbook Name:: nginx\n# Recipe:: default\n#\n# Author:: AJ Christensen <aj@junglist.gen.nz>\n#\n# Copyright 2008-2013, Opscode, Inc.\n#\n# Licensed under the Apache...
ruby
chosen
[ { "from": "system", "value": "Set system locale to en_US.UTF-8\n" }, { "from": "human", "value": "#\n# Cookbook Name:: archlinux\n# Recipe:: default\n#\n# Copyright (C) 2013 Logan Koester\n# \n# All rights reserved - Do Not Redistribute\n#\n\n# Chef's SystemD provider is hardcoded to /bin, which...
ruby
chosen
[ { "from": "system", "value": "Load secret token from environment variable for Heroku use\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\n# Your secret key for verifying the integrity of signed cookies.\n# If you change this key, all old signed co...
ruby
chosen
[ { "from": "system", "value": "Update gemspec with description and summary\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/ringleader/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Nathan Witmer\"]\n gem.email ...
ruby
chosen
[ { "from": "system", "value": "Fix typo in Rack::Profiler spec\n\n(At least I think it's just a typo.)\n" }, { "from": "human", "value": "require 'rack/mock'\nrequire 'rack/profiler'\n\ncontext 'Rack::Profiler' do\n \n app = lambda { |env| [200, {'Content-Type' => 'text/plain'}, 'Oh hai der'] }...
ruby
chosen
[ { "from": "human", "value": "Add a script to test the server under load.\n\n\ngit-svn-id: 0b34dac3a39d255f46ac888f3fd4ecac3c863f70@176 b2217739-5cbd-4580-87d5-f689c6e5027b\n" }, { "from": "gpt", "value": "require 'socket'\nrequire 'optparse'\n\nclass Hurt\n def initialize(argv)\n @argv ...
ruby
chosen
[ { "from": "system", "value": "Use default test design with colors\n" }, { "from": "human", "value": "ENV['RAILS_ENV'] ||= 'test'\nrequire File.expand_path('../../config/environment', __FILE__)\nrequire 'rails/test_help'\nrequire 'minitest/reporters'\n\n#\n# == ActiveSupport namespace\n#\nmodule ...
ruby
chosen
[ { "from": "system", "value": "Allow bin/testunit to activate spring\n" }, { "from": "human", "value": "require \"test_launcher/utils/path\"\n\nmodule TestLauncher\n module Search\n class TestCase\n attr_reader :file, :example\n\n def self.from_search(file:, query: nil)\n new...
ruby
chosen
[ { "from": "system", "value": "Add documentation of public Adapter.new interface\n" }, { "from": "human", "value": "module Veritas\n module Adapter\n module Arango\n\n # Adapter to read tuples from remote elasticsearch database\n class Adapter\n include Adamantium::Flat, Comp...
ruby
chosen
[ { "from": "system", "value": "Add log file for hackers.txt\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'mqtt'\nrequire 'openssl'\n\n# Subscribe example\n client = MQTT::Client.connect(\n :host => 'www.techministry.gr',\n :port => 1883,\n :ssl => true,\n :ca_file => 'path_t...
ruby
chosen
[ { "from": "system", "value": "Add settings of timezone, locale and generators\n" }, { "from": "human", "value": "require_relative 'boot'\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.require(*...
ruby
chosen
[ { "from": "system", "value": "Use factory_girl on locking_optimistic spec\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe ActiveRecord::Turntable::ActiveRecordExt::LockingOptimistic do\n before do\n ActiveRecord::Base.turntable_config.instance_variable_get(:@config)[:r...
ruby
chosen
[ { "from": "system", "value": "Define max attempts for elasticsearch background job (to not endless queue not indexable items).\n" }, { "from": "human", "value": "# Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/\nclass BackgroundJobSearchIndex\n def initialize(object, o...
ruby
chosen
[ { "from": "system", "value": "Add support for running migrations in Rails 5.2.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass Combustion::Database::Migrate\n def self.call\n new.call\n end\n\n def call\n if ActiveRecord::VERSION::STRING >= \"3.1.0\"\n mig...
ruby
chosen
[ { "from": "system", "value": "Add case for rack::lint body input wrapper\n" }, { "from": "human", "value": "module AuthenticatedApi\n\n # Namespace for server related classes and methods\n module Server\n autoload :Middleware, 'authenticated_api/server/middleware'\n\n # Tells if the sign...
ruby
chosen
[ { "from": "system", "value": "Fix permitted params usage following CVE-2014-3514\n" }, { "from": "human", "value": "module BookingSync::Engine::Model\n extend ActiveSupport::Concern\n\n module ClassMethods\n def from_omniauth(auth)\n where(auth.slice(:provider, :uid)).first_or_initiali...
ruby
chosen
[ { "from": "system", "value": "Allow us to specify which test files to run\n" }, { "from": "human", "value": "require_relative './helper'\n\ndescribe ConceptQL::Operators do\n\n Dir['./test/statements/**/*'].each do |f|\n next if File.directory? f\n f.slice! './test/statements/'\n basen...
ruby
chosen
[ { "from": "system", "value": "Check for missing 'version' param.\n" }, { "from": "human", "value": "require 'sinatra'\nrequire 'json'\nrequire_relative 'lib/converter'\n\nconfigure do\n set :public_folder, Proc.new { File.join(root, \"static\") }\n set :raise_errors, false\n set :show_excepti...
ruby
chosen
[ { "from": "system", "value": "Change HwErratum Class to no longer extend BaseErratum, all variables except id are options\n" }, { "from": "human", "value": "module Origen\n module Errata\n class HwErratum < BaseErratum\n\n attr_accessor :hw_workaround_description, :disposition, :impact,...
ruby
chosen
[ { "from": "system", "value": "Revert previous changes, use a special pdef for audit trace\n" }, { "from": "human", "value": "module Ruote\n module Synchronize\n\n class Broker\n\n include ReceiverMixin\n\n def initialize(context)\n @context = context\n @context.storag...
ruby
chosen
[ { "from": "system", "value": "Use 'on_worker_boot' to disconnect forked workers\n" }, { "from": "human", "value": "workers Integer(ENV['WEB_CONCURRENCY'] || 2)\nthreads_count = Integer(ENV['MAX_THREADS'] || 5)\nthreads threads_count, threads_count\n\npreload_app!\n\nrackup DefaultRackup\npo...
ruby
chosen
[ { "from": "system", "value": "Fix config spec not describing the right tracking module\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Tracking::CLI do\n\n\tbefore(:all) { backup_data }\n\tafter(:all) { restore_data }\n\n\tit 'reads a value from the config file' do\n\t\tTra...
ruby
chosen
[ { "from": "system", "value": "Clean up the test guards\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'spec'\n\nrequire File.dirname(__FILE__) + '/../lib/github'\n\n# prevent the use of `` in tests\nSpec::Runner.configure do |configuration|\n # load this here so it's covered by ...
ruby
chosen
[ { "from": "system", "value": "Call simplecov before requiring dimples\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'dimples'\nrequire 'simplecov'\n\nSimpleCov.start\n\nRSpec.configure do |config|\n config.expect_with :rspec do |expectations|\n expectations.incl...
ruby
chosen
[ { "from": "system", "value": "Allow code climate reports from tests\n" }, { "from": "human", "value": "if ENV[\"CI\"]\n require \"codeclimate-test-reporter\"\n CodeClimate::TestReporter.start\nend\n\nrequire \"dotenv\"\nrequire \"webmock/rspec\"\nrequire \"vcr\"\nrequire \"uri\"\n\nDotenv.load...
ruby
chosen
[ { "from": "system", "value": "Check if RUBY_ENGINE is defined (1.8.7 doesn't support it)\n" }, { "from": "human", "value": "require 'pry'\nrequire './lib/parsable_hash'\n\nif ENV['CI'] && RUBY_ENGINE == 'ruby'\n require 'coveralls'\n Coveralls.wear!\nend\n\n# This file was generated by the `rs...
ruby
chosen
[ { "from": "system", "value": "Disable all RSpec monkey patching" }, { "from": "human", "value": "require 'codeclimate-test-reporter'\nCodeClimate::TestReporter.start\n\nENV['RAILS_ENV'] = 'test'\n\nbegin\n require 'pry'\nrescue LoadError\nend\n\nrequire_relative '../config/environment'\nrequire...
ruby
chosen
[ { "from": "system", "value": "Disable Lita v3 compatibility mode.\n" }, { "from": "human", "value": "require \"simplecov\"\nrequire \"coveralls\"\nSimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[\n SimpleCov::Formatter::HTMLFormatter,\n Coveralls::SimpleCov::Formatter\n]\nSimpleCov....
ruby
chosen
[ { "from": "system", "value": "Kill the test node when we're done\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'bundler'\nBundler.setup\n\nrequire 'dcell'\nDir['./spec/support/*.rb'].map { |f| require f }\n\nRSpec.configure do |config|\n config.before(:suite) do\n DCell.setu...
ruby
chosen
[ { "from": "system", "value": "Fix codeclimate test coverage report\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\n\nrequire \"codeclimate-test-reporter\"\nrequire 'ostruct'\nrequire 'pry-byebug'\n\nrequire 'julia'\n\nCodeClimate::TestReporter.start...
ruby
chosen
[ { "from": "system", "value": "Change rspec formatter to documentation style\n" }, { "from": "human", "value": "require 'puppetlabs_spec_helper/module_spec_helper'\n" }, { "from": "gpt", "value": "require 'puppetlabs_spec_helper/module_spec_helper'\n\nRSpec.configure do |c|\n c.forma...
ruby
chosen
[ { "from": "system", "value": "Change to use double-quotes and new formatter api\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nif ENV['COVERAGE'] || ENV['TRAVIS']\n require 'simplecov'\n require 'coveralls'\n\n SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[\n...
ruby
chosen
[ { "from": "system", "value": "Drop Mingo's collection before the spec run starts.\n" }, { "from": "human", "value": "ENV[\"RAILS_ENV\"] = \"test\"\n\nrequire 'rails_app/config/environment'\n\n# Requires supporting files with custom matchers and macros, etc,\n# in ./support/ and its subdirectorie...
ruby
chosen
[ { "from": "system", "value": "Add '<APPBOY_SCHEDULE_ID>' to VCR placeholders\n" }, { "from": "human", "value": "require 'vcr'\n\nVCR.configure do |config|\n config.filter_sensitive_data('<APPBOY_GROUP_ID>') { appboy_group_id }\n config.filter_sensitive_data('<APPBOY_TEST_SEGMENT>') { appboy_te...
ruby
chosen
[ { "from": "system", "value": "Remove version dependencies from gemspec\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"nopassword/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new ...
ruby
chosen
[ { "from": "system", "value": "Increase version to 1.0.1 and gem date\n" }, { "from": "human", "value": "require 'rake'\n\nGem::Specification.new do |s|\n s.name = 'udooneorest'\n s.version = '1.0.0'\n s.date = '2015-12-07'\n s.summary = 'Rest API for interacting with UD...
ruby
chosen
[ { "from": "system", "value": "Use correct asset host for uploaded images\n\nThis still doesn't work because we're missing a prefix for the images.\n" }, { "from": "human", "value": "Whitehall::Application.configure do\n # Settings specified here will take precedence over those in config/applica...
ruby
chosen
[ { "from": "system", "value": "Fix user ID lookup for guests.\n" }, { "from": "human", "value": "MessageBus.long_polling_enabled = true\nMessageBus.long_polling_interval = 15000\n\nMessageBus.redis_config = {\n host: ENV['REDIS_HOST']\n}\n\nMessageBus.user_id_lookup do |env|\n auth_token = Rack...
ruby
chosen
[ { "from": "system", "value": "Add total field to cash refund\n" }, { "from": "human", "value": "module NetSuite\n module Records\n class CashRefund\n include Support::Fields\n include Support::RecordRefs\n include Support::Records\n include Support::Actions\n include...
ruby
chosen
[ { "from": "human", "value": "Add a simple sinatra HTTP server\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\n\nrequire 'sinatra'\n\n# curl -X DELETE http://localhost:4567/some/path\ndelete %r{^/([\\w\\-/]+)} do |c|\n system \"git rest delete #{c}\"\n [ 204, {}, %q{} ]\nend\n\n# curl htt...
ruby
chosen
[ { "from": "system", "value": "Rename master branch to main\n\n" }, { "from": "human", "value": "#!/usr/bin/ruby\n#\n# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not\n# distributed with this file, You can obtain one at http://mozi...
ruby
chosen
[ { "from": "system", "value": "Add own method for generating a random 'alnum' character\n" }, { "from": "human", "value": "# To change this template, choose Tools | Templates\n# and open the template in the editor.\n\n# Ruby 1.8 does not contains sample() function\nclass Array\n def sample()\n ...
ruby
chosen
[ { "from": "system", "value": "Add an option to use upsert instead of insert.\n" }, { "from": "human", "value": "module Metacrunch\n class Db::Writer\n\n def initialize(database_connection_or_url, dataset_proc, options = {})\n @db = if database_connection_or_url.is_a?(String)\n Se...
ruby
chosen
[ { "from": "system", "value": "Reimplement shared() without using let()\n" }, { "from": "human", "value": "# RSpecShared, written by Justin Ko <jko170@gmail.com>\n# Original at https://github.com/justinko/rspec-shared\n\nmodule RSpecShared\n module Methods\n def shared(name, &block)\n # ...
ruby
chosen
[ { "from": "system", "value": "Use `Addressable` gem for URI.escape (fix deprecation warning)\n" }, { "from": "human", "value": "module S3Relay\n class PrivateUrl < S3Relay::Base\n\n attr_reader :expires, :path\n\n def initialize(uuid, file, options={})\n filename = URI.encode(file).g...
ruby
chosen
[ { "from": "system", "value": "Change temp dirs to point at Rails default tmp\n" }, { "from": "human", "value": "namespace :enki do\n desc \"Generate AST files\"\n task :generate_ast => :environment do\n Enki::Snowcrasher.compile_dir(src_dir: \"doc\", dst_dir: \"doc_ast\")\n end\n\n desc \...
ruby
chosen
[ { "from": "system", "value": "Fix app termination when query is empty, not nil\n" }, { "from": "human", "value": "require 'nehm/tracks_view_command'\n\nmodule Nehm\n\n class SearchCommand < TracksViewCommand\n\n def initialize\n super\n end\n\n def execute\n @query = @options...
ruby
chosen
[ { "from": "system", "value": "Use 'named' for automatic disable handling and tidy up ordering\n" }, { "from": "human", "value": "# encoding: utf-8\nrequire 'new_relic/agent/method_tracer'\n\nDependencyDetection.defer do\n @name = :cql\n\n executes do\n ::NewRelic::Agent.logger.info 'Install...
ruby
chosen
[ { "from": "system", "value": "Fix Ruby 3.0 keyword argument passing in DeliverHookJob\n" }, { "from": "human", "value": "# frozen_string_literal: true\nmodule Shipit\n class DeliverHookJob < BackgroundJob\n queue_as :hooks\n\n def perform(delivery)\n delivery = Hook::DeliverySpec.new...
ruby
chosen