conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix test helper for previously moved lib\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'test/unit'\nrequire 'shoulda'\n\n$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))\n$LOAD_PATH.unshift(File.dirname(__FILE__))\nrequire 'uri-met...
ruby
chosen
[ { "from": "system", "value": "Add method comments to `Production::Expression`\n" }, { "from": "human", "value": "module Calyx\n module Production\n class Expression\n def initialize(production, methods, registry)\n @production = production\n @methods = methods.map { |m| m....
ruby
chosen
[ { "from": "system", "value": "Remove rubyforge_project to fix deprecation warning\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\n$:.push File.expand_path('../lib', __FILE__)\nrequire 'mt940/version'\n\nGem::Specification.new do |s|\n s.name = 'mt940'\n s.version = M...
ruby
chosen
[ { "from": "system", "value": "Remove errant call to Sinatra.helpers in fixture\n" }, { "from": "human", "value": "module Nesta\n module Plugin\n module Test\n module Helpers\n helpers do\n # If your plugin needs any helper methods, add them here...\n end\n en...
ruby
chosen
[ { "from": "system", "value": "Add opens/closes to output JSON.\n" }, { "from": "human", "value": "class Swarm < ActiveRecord::Base\n serialize :fields\n\n def as_json(options={})\n {:name => self.name,\n :description => self.description,\n :fields => self.fields\n }\n end\n\n d...
ruby
chosen
[ { "from": "human", "value": "Add formula for pecl inclued\n" }, { "from": "gpt", "value": "require 'formula'\n\nclass Php53Inclued < Formula\n homepage 'http://pecl.php.net/package/inclued'\n url 'http://pecl.php.net/get/inclued-0.1.3.tgz'\n md5 '303f6ddba800be23d0e06a7259b75a2e'\n version '...
ruby
chosen
[ { "from": "system", "value": "Increase version in order to push right prev version to rubygems\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\n\nGem::Specification.new do |s|\n s.name = \"capistrano-multiconfig\"\n s.version ...
ruby
chosen
[ { "from": "human", "value": "Add spec for refine Apex::Class.new\n" }, { "from": "gpt", "value": "# coding : utf-8\n\nrequire File.dirname(__FILE__) + '/spec_helper.rb'\n\ndescribe \"\", Apex::Class do\n before do\n @apex_class = Apex::Class.new(<<-\"END\")\n /**\n *\n */\n pub...
ruby
chosen
[ { "from": "system", "value": "Test for passing a source\n" }, { "from": "human", "value": "require 'test_helper'\nrequire 'metriks_server/config'\nrequire 'metriks_server_reporter'\nrequire 'metriks'\n\nclass MetriksServerReporterTest < Test::Unit::TestCase\n def test_working_config\n @port ...
ruby
chosen
[ { "from": "system", "value": "Update podspec to Swift 3 compatible version\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n\n s.name = \"CSVImporter\"\n s.version = \"1.2.0\"\n s.summary = \"Import CSV files line by line with ease.\"\n\n s.description = <<-DESC\n ...
ruby
chosen
[ { "from": "system", "value": "Add zap stanza for AppCleaner\n" }, { "from": "human", "value": "cask :v1 => 'appcleaner' do\n version '2.3'\n sha256 '69da212e2972e23e361c93049e4b4505d7f226aff8652192125f078be7eecf7f'\n\n url \"http://www.freemacsoft.net/downloads/AppCleaner_#{version}.zip\"\n ...
ruby
chosen
[ { "from": "system", "value": "Update cask to latest version.\n\nSee https://twitter.com/pornelski/status/336639773382950913\n" }, { "from": "human", "value": "class Imagealpha < Cask\n url 'http://pngmini.com/ImageAlpha1.2.5.1.tar.bz2'\n homepage 'http://pngmini.com/'\n version '1.2.5.1'\n s...
ruby
chosen
[ { "from": "system", "value": "Add auto_updates flag to ImageOptim\n" }, { "from": "human", "value": "cask 'imageoptim' do\n version '1.6.1'\n sha256 'cfa43f7d9dbd3f231a95feb534c8862ed6770920a6f03a713a1a5556a26a9978'\n\n url \"https://imageoptim.com/ImageOptim#{version}.tar.bz2\"\n appcast 'h...
ruby
chosen
[ { "from": "system", "value": "Move wrappers to wrapper folder\n" }, { "from": "human", "value": "require 'active_model'\n\nmodule Danica\n autoload :Builder, 'danica/builder'\n autoload :BaseOperations, 'danica/base_operations'\n autoload :VariablesHolder, 'danica/variables_holder...
ruby
chosen
[ { "from": "human", "value": "Bring Bugsnag initializer from ofn-install\n\nThis copies ofn-install's `roles/app/templates/bugsnag.rb.j2` to\n`config/initializers/bugsnag.rb`. All tasks and templates\nregarding Bugsnag can then be :fire: from ofn-install.\n\nAs a result, it'll fix the issue that both Katuma ...
ruby
chosen
[ { "from": "system", "value": "Remove Twitter secrets. First of many bumps in the road to open sourcing...\n" }, { "from": "human", "value": "Twitter.configure do |config|\n config.consumer_key = 'mg3EWK2nqZHwmoXU88xyA'\n config.consumer_secret = 'iEdf8Sc9O7gINMTrOP57slpLBWeqxEtkhTZa4AJwn4Y'\n...
ruby
chosen
[ { "from": "system", "value": "Fix punctuation in podspec summary\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"CIOAPIClient\"\n s.version = \"0.8.6\"\n s.summary = \"API Client for Context.IO\"\n s.homepage = \"https://github.com/contextio/context...
ruby
chosen
[ { "from": "system", "value": "Update WD Security to 2.0.0.30\n" }, { "from": "human", "value": "cask :v1 => 'wd-security' do\n version '1.0.8.2'\n sha256 '1a82e8cd9d8e7d23b8201c6460c75cd6c388f8c588b6608caf2c31394b3fd37a'\n\n url \"http://download.wdc.com/wdapp/WD_Security_For_Web_Mac_#{versio...
ruby
chosen
[ { "from": "system", "value": "Add rake as development dependency\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"parsr\"\n\nGem::Specification.new do |s|\n s.name = \"parsr\"\n s.version = Parsr::VERSION\n s.au...
ruby
chosen
[ { "from": "system", "value": "Add spec and untag test for `Rational.new`.\n" }, { "from": "human", "value": "require_relative '../../spec_helper'\n\ndescribe \"Rational\" do\n it \"includes Comparable\" do\n Rational.include?(Comparable).should == true\n end\nend\n" }, { "from": "gp...
ruby
chosen
[ { "from": "system", "value": "Change to stop limiting dev deps\n" }, { "from": "human", "value": "lib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'necromancer/version'\n\nGem::Specification.new do |spec|\n spec.name = 'necrom...
ruby
chosen
[ { "from": "system", "value": "Add license (MIT) to gemspec.\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n# vim: et ts=2 sw=2\n\nrequire File.expand_path(\"../lib/forkreadme/version\", __FILE__)\n\nGem::Specification.new do |gem|\n gem.name = \"forkreadme\"\n gem.version ...
ruby
chosen
[ { "from": "system", "value": "Add Steven as author since we're pairing!" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'freemle/client/version'\n\nGem::Specification.new do |spec|\n s...
ruby
chosen
[ { "from": "system", "value": "Stop sending errors via Sidekiq\n\nThe Sentry client can do this for us.\n" }, { "from": "human", "value": "redis_config = {\n host: ENV[\"REDIS_HOST\"] || \"127.0.0.1\",\n port: ENV[\"REDIS_PORT\"] || 6379,\n namespace: \"manuals-publisher\",\n}\n\nSidekiq.confi...
ruby
chosen
[ { "from": "system", "value": "Use after if style in check_admin\n" }, { "from": "human", "value": "class AdminController < ApplicationController\n\tinclude AdminHelper\n helper_method :current_user\n before_action :active_booking, :check_admin\n rescue_from SecurityError, with: :not_sig...
ruby
chosen
[ { "from": "system", "value": "Fix the openssl mail problem. This works for actionmailer but it's not a real\nfix. The real fix should be forthcoming in jruby 1.6.6.\n" }, { "from": "human", "value": "class AdminController < ApplicationController\n before_filter :authenticate_user!\n authorize_...
ruby
chosen
[ { "from": "system", "value": "Move code from comfortable mexican sofa to our cms application\n" }, { "from": "human", "value": "class PagesController < Comfy::Admin::Cms::PagesController\n before_action :build_file, only: [:new, :edit]\n before_action :set_categories, only: [:new, :edit]\n...
ruby
chosen
[ { "from": "system", "value": "Create private method for user_params\n" }, { "from": "human", "value": "class UsersController < ApplicationController\n\n def create\n @user = User.new(user_params)\n if @user.save\n sesssion[:user_id] = @user.user_id\n redirect_to user_show_path(@...
ruby
chosen
[ { "from": "system", "value": "Add password confirmation to user params\n" }, { "from": "human", "value": "class UsersController < ApplicationController\n\n def new\n @user = User.new\n end\n\n def create\n @user = User.new(user_params)\n if @user.save\n session[:user_id] = @user...
ruby
chosen
[ { "from": "system", "value": "Fix for delayed_job to disable asynchronous jobs when testing\n" }, { "from": "human", "value": "require 'active_support/basic_object'\n\nmodule Delayed\n class DelayProxy < ActiveSupport::BasicObject\n def initialize(target, options)\n @target = target\n ...
ruby
chosen
[ { "from": "system", "value": "fix: Convert sensor device registration parameters to integer\n" }, { "from": "human", "value": "# == Schema Information\n#\n# Table name: sensor_devices\n#\n# id :integer not null, primary key\n# sensors :text\n#\n\nclass SensorDevice < ActiveRecord...
ruby
chosen
[ { "from": "system", "value": "Refactor mdTranslator html writer module 'entityForeignKey'\n" }, { "from": "human", "value": "# HTML writer\n# entity foreign key\n\n# History:\n# Stan Smith 2017-04-05 original script\n\nmodule ADIWG\n module Mdtranslator\n module Writers\n module ...
ruby
chosen
[ { "from": "system", "value": "Rename document to soap because it was earlier changed in the superclass\n" }, { "from": "human", "value": "module Sepa\n class DanskeResponse < Response\n attr_reader :encryption_cert, :bank_signing_cert, :bank_root_cert, :own_encryption_cert,\n ...
ruby
chosen
[ { "from": "system", "value": "Add STDOUT support for debugging\n" }, { "from": "human", "value": "require File.join(File.dirname(__FILE__), 'http/github_routes.rb')\n\nrun Http::GithubRoutes.new\n" }, { "from": "gpt", "value": "require File.join(File.dirname(__FILE__), 'http/github_r...
ruby
chosen
[ { "from": "system", "value": "Update SDK version to 2.4-beta2\n\n" }, { "from": "human", "value": "require \"json\"\n\n package = JSON.parse(File.read(File.join(__dir__, \"package.json\")))\n\n Pod::Spec.new do |s|\n s.name = \"notificare-push-lib-react-native\"\n s.version = pack...
ruby
chosen
[ { "from": "system", "value": "Rename global percentages columns and remove land and marine\n" }, { "from": "human", "value": "class AddWellConnectedAndImportanceToCountryStatistic < ActiveRecord::Migration\n def change\n add_column :country_statistics, :percentage_land_well_connected, :float...
ruby
chosen
[ { "from": "system", "value": "Add AWS S3 setup code" }, { "from": "human", "value": "require 'aws-sdk'\nrequire 'yaml'\nrequire 'pp'\nrequire 'filesize'\n\nclass S3Backup\n attr_reader :targets\n attr_reader :include_targets, :targets\n\n def initialize\n load_config\n @targets = []\n ...
ruby
chosen
[ { "from": "system", "value": "Add 50+ and 60+ to Blind Date overall\n" }, { "from": "human", "value": "module Competitions\n class BlindDateAtTheDairyOverall < Overall\n def self.parent_event_name\n \"Blind Date at the Dairy\"\n end\n\n def category_names\n [\n \"Begin...
ruby
chosen
[ { "from": "system", "value": "Add dependency to version-specific gems\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'ghpreview/instant_markdown_d/version'\n\nGem::Specification.new ...
ruby
chosen
[ { "from": "system", "value": "Fix integrations tests for device-tree\n\nSigned-off-by: Dieter Reuter <554783fc552b5b2a46dd3d7d7b9b2cce9a82c122@me.com>\n" }, { "from": "human", "value": "require 'spec_helper'\n\n# /proc/device-tree is only present if device-tree works\ndescribe file('/proc/device...
ruby
chosen
[ { "from": "system", "value": "Fix typo in a test description\n" }, { "from": "human", "value": "require 'minitest/autorun'\nrequire 'rack/mock'\nrequire 'vienna'\n\ndescribe Vienna do\n before do\n app = Rack::Builder.new do\n use Rack::Lint\n run Vienna\n end\n @request = Ra...
ruby
chosen
[ { "from": "system", "value": "Add gemspec summary, description, and homepage for release\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/beso/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Jeremy Ruppel\"]\n gem.em...
ruby
chosen
[ { "from": "system", "value": "Add faker requirement to fix test failing.\n" }, { "from": "human", "value": "require 'simplecov'\nSimpleCov.start do\n add_filter '/test/'\nend\n\nFaker::Config.locale = 'en-GB'\n\nENV['RAILS_ENV'] ||= 'test'\nrequire File.expand_path('../../config/environment', _...
ruby
chosen
[ { "from": "system", "value": "Comment at what it's actually describing\n" }, { "from": "human", "value": "# frozen_string_literal: true\nmodule Kaminari\n module ActiveRecordRelationMethods\n def entry_name(options = {})\n default = options[:count] == 1 ? model_name.human : model_name.h...
ruby
chosen
[ { "from": "system", "value": "Fix Faraday with default (Net::HTTP) adapter\n\nBesides ca_file Faraday seems to set a `cert_store` to `Net::HTTP`, and it seems to override the setting from ca_file." }, { "from": "human", "value": "require 'net/https'\n\nNet::HTTP.class_eval do\n alias _use_ssl= ...
ruby
chosen
[ { "from": "system", "value": "Add rspec as development 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 'sloc/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Add code documentation for Skroutz::PaginatedCollection\n" }, { "from": "human", "value": "class Skroutz::PaginatedCollection < Array\n include Skroutz::Parsing\n\n delegate :model_name, :client, to: :context\n\n attr_reader :response, :context\n\n def initializ...
ruby
chosen
[ { "from": "system", "value": "Add rails_helper to AuthToken spec\n\nThis should fix the failing spec on CI.\n" }, { "from": "human", "value": "RSpec.describe AuthToken do\n it 'encodes and decodes tokens' do\n token = AuthToken.encode(foo: 'bar')\n\n expect(AuthToken.decode(token)[:foo])....
ruby
chosen
[ { "from": "system", "value": "Add status of pending to failing test\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe User do\n it \"should be associated with picks\" do\n user = User.create(\n username:\"lemons\",\n password_digest: \"peelinglemons\",\n em...
ruby
chosen
[ { "from": "system", "value": "Remove .once, as we don't need to specify this\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'compo'\n\n# Mock implementation of UrlReferenceable.\nclass MockUrlReferenceable\n include Compo::UrlReferenceable\nend\n\ndescribe MockUrlReferenceabl...
ruby
chosen
[ { "from": "system", "value": "Add download_pdf to summary view for infrastructure providers\n" }, { "from": "human", "value": "class ApplicationHelper::Toolbar::DashboardSummaryToggleView < ApplicationHelper::Toolbar::Basic\n button_group('ems_container_dashboard', [\n twostate(\n :view...
ruby
chosen
[ { "from": "system", "value": "Use `total_items` variable name for consistency\n" }, { "from": "human", "value": "class ActiveModel::PaginationSerializer < ActiveModel::ArraySerializer\n\n def initialize_with_pagination(object, opts={})\n per_page = object.limit_value\n offset = object.off...
ruby
chosen
[ { "from": "system", "value": "Update Rails version to match Refinery\n" }, { "from": "human", "value": "require File.expand_path('lib/refinery/testimonials/version', __dir__)\nversion = Refinery::Testimonials::Version.to_s\nGem::Specification.new do |s|\n s.platform = Gem::Platform::RU...
ruby
chosen
[ { "from": "system", "value": "Return the history of the model if the other model is nil\n" }, { "from": "human", "value": "require \"./lib/collection_merger\"\n\nmodule Historical\n extend ActiveSupport::Concern\n\n included do\n has_paper_trail\n end\n\n def has_history?\n !history.em...
ruby
chosen
[ { "from": "system", "value": "Delete inquiries and offers when delete member\n" }, { "from": "human", "value": "class MembersController < ApplicationController\n before_filter :authenticate_user!\n\n def destroy\n current_organization.members.find(params[:id]).destroy\n\n redirect_to use...
ruby
chosen
[ { "from": "system", "value": "Use the more readable if syntax for this\n" }, { "from": "human", "value": "class SessionController < ApplicationController\n skip_before_action :should_authenticate?, only: [:create]\n skip_before_action :fetch_subscriptions, :init_props\n\n if Rails.env.develop...
ruby
chosen
[ { "from": "system", "value": "Add TODO for crash when balance is called with no by_value_period.from.\n" }, { "from": "human", "value": "class TenantsController < AuthorizedController\n # Actions\n def current\n redirect_to current_user.tenant\n end\n\n def profit_sheet\n @company = cu...
ruby
chosen
[ { "from": "system", "value": "Fix issue in Marionette scraper\n\nFixes #532.\n" }, { "from": "human", "value": "module Docs\n class Marionette\n class CleanHtmlFilter < Filter\n def call\n root_page? ? root : other\n doc\n end\n\n def root\n at_css('p').re...
ruby
chosen
[ { "from": "system", "value": "Remove default for locale param in LocalizeRoute\n" }, { "from": "human", "value": "module MortgageCalculator\n class LocalizeRoute\n attr_reader :route, :locale, :controller\n\n def initialize(route, locale = :en, controller)\n @route = route\n @lo...
ruby
chosen
[ { "from": "system", "value": "Add authors for type groups\n" }, { "from": "human", "value": "# @see https://developers.podio.com/doc/stream\nclass Podio::StreamActivityGroup < ActivePodio::Base\n\n property :kind, :string\n property :type, :string\n property :created_on, :datetime\n property...
ruby
chosen
[ { "from": "system", "value": "Fix redirect upon unsuccessful comment submission, rescope @question.\n" }, { "from": "human", "value": "class CommentsController < ApplicationController\n include AuthsHelper\n\n def create\n @comment = Comment.new(comment_params)\n if @comment.save\n ...
ruby
chosen
[ { "from": "human", "value": "Add base object NetoworkStorageCredential for API entity SoftLayer_Network_Storage_Credential\n" }, { "from": "gpt", "value": "#--\n# Copyright (c) 2014 SoftLayer Technologies, Inc. All rights reserved.\n#\n# For licensing information see the LICENSE.md file in the p...
ruby
chosen
[ { "from": "system", "value": "Refactor because measures will be always true, because it's a \"Sequel::Postgres::Dataset\"\n" }, { "from": "human", "value": "TradeTariffBackend::DataMigrator.migration do\n name 'End measure 425 for commodity 2103909080.'\n\n MEASURE_TYPE = 'DBE'\n COMMODITY = ...
ruby
chosen
[ { "from": "system", "value": "Remove write statement used in testing\n" }, { "from": "human", "value": "# html 2.0 writer tests - document\n\n# History:\n# Stan Smith 2017-03-22 original script\n\nrequire 'minitest/autorun'\nrequire 'json'\nrequire 'adiwg-mdtranslator'\n\nclass TestHtmlDocumen...
ruby
chosen
[ { "from": "human", "value": "Add trad_reporting_unpermitted bool field to organisations\n" }, { "from": "gpt", "value": "class AddTradeReportingUnpermittedFieldToOrganisations < ActiveRecord::Migration[5.0]\n def change\n add_column :organisations, :trade_reporting_unpermitted, :boolean, def...
ruby
chosen
[ { "from": "system", "value": "Add more vars in config to use capifony\n" }, { "from": "human", "value": "set :application, \"municipales2015.listabierta.com\"\nset :deploy_user, \"muni\"\nset :domain, \"#{application}\"\nset :deploy_to, \"/home/#{deploy_user}/public\"\nset :app_path, \...
ruby
chosen
[ { "from": "system", "value": "Add associations and validations to Answer model\n" }, { "from": "human", "value": "class Answer < ActiveRecord::Base\nend\n" }, { "from": "gpt", "value": "class Answer < ActiveRecord::Base\n has_many :votes, as: :votable\n has_many :responses, as: :re...
ruby
chosen
[ { "from": "system", "value": "Add gemspec files to allow bundler to run from the gem" }, { "from": "human", "value": "$:.unshift(File.dirname(__FILE__) + '/lib')\nrequire 'chef/provisioning/vagrant_driver/version'\n\nGem::Specification.new do |s|\n s.name = 'chef-provisioning-vagrant'\n s.vers...
ruby
chosen
[ { "from": "system", "value": "Remove ancestry from dev gems(0)\n" }, { "from": "human", "value": "$:.push File.expand_path('../lib', __FILE__)\n\n# Maintain your gem's version:\nrequire 'seo_cms/version'\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |s|\n s.nam...
ruby
chosen
[ { "from": "system", "value": "Remove duplicate factory names for transam assets.\n" }, { "from": "human", "value": "# Read about factories at https://github.com/thoughtbot/factory_girl\n\nFactoryBot.define do\n\n sequence :asset_tag do |n|\n \"ABS_TAG#{n}\"\n end\n\n trait :basic_asset_att...
ruby
chosen
[ { "from": "system", "value": "Make some search test failures more informative." }, { "from": "human", "value": "# encoding: utf-8\nrequire \"integration_test_helper\"\n\nclass AdvancedSearchTest < IntegrationTest\n def setup\n super\n stub_elasticsearch_settings\n end\n\n def test_retur...
ruby
chosen
[ { "from": "system", "value": "Add class method back in." }, { "from": "human", "value": "module Ctrlo\n class Input\n def initialize(id = nil)\n @id = id\n end\n\n def get\n system [ENV['EDITOR'], path].join(\" \")\n input\n end\n\n private\n attr_reader :id\n\n...
ruby
chosen
[ { "from": "system", "value": "Set encoding explicitly to UTF-8\n" }, { "from": "human", "value": "module Graf\n\n\tclass Source\n\n\t\tclass << self\n\n\t\t\tdef count_of_commits(log, author)\n\t\t\t\tlog.grep(author).size\n\t\t\tend\n\n\t\t\tTICK = '▇'\n\n\t\t\tdef authors()\n\t\t\t\tfreq = Has...
ruby
chosen
[ { "from": "system", "value": "Set system keyspace in rspec teardown\n" }, { "from": "human", "value": "require 'bundler/setup'\nrequire 'simplecov'\nSimpleCov.start\n\nrequire 'rspec'\nrequire 'virsandra'\n\n\nTEST_KEYSPACE = \"virtest\"\n\nRSpec.configure do |config|\n config.treat_symbols_as_...
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\n# run the specs with dm-validations, if available\nbegin\n gem 'dm-validations', '0.10.0'\n requi...
ruby
chosen
[ { "from": "system", "value": "Include paperclip matchers and disable warnings on specs\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path(\"../../lib\", __FILE__)\n\n# Code coverage\nrequire \"simplecov\"\nSimpleCov.start\n\n# Development dependencies\nrequire \"byebug\"\nreq...
ruby
chosen
[ { "from": "system", "value": "Add expect support to specs\n\n* Eventually the :should argument should be removed once the specs\n have been refactored.\n" }, { "from": "human", "value": "# encoding: utf-8\n\nif ENV['COVERAGE'] == 'true'\n require 'simplecov'\n require 'coveralls'\n\n SimpleC...
ruby
chosen
[ { "from": "system", "value": "Revert \"only do coverage reporting in CI for master\"\n\nThis reverts commit 3ed4ecdc2c86bb1fe34662e35ea7ec74260aa549.\n" }, { "from": "human", "value": "if !ENV['BUNDLE_GEMFILE'] || ENV['BUNDLE_GEMFILE'] =~ /default.gemfile\\z/\n if !ENV['TRAVIS']\n require 's...
ruby
chosen
[ { "from": "system", "value": "Configure SimpleCov to ignore .bundle files\n" }, { "from": "human", "value": "require 'simplecov'\nSimpleCov.start\n\n#####\n\n$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\n\nrequire 'exception_notification'\nrequire 'exception_notifier/squash_notifie...
ruby
chosen
[ { "from": "system", "value": "Add Capybara to spec suite\n" }, { "from": "human", "value": "# This file is copied to spec/ when you run 'rails generate rspec:install'\nENV[\"RAILS_ENV\"] ||= 'test'\nrequire File.expand_path(\"../../config/environment\", __FILE__)\nrequire 'rspec/rails'\nrequire ...
ruby
chosen
[ { "from": "system", "value": "Remove SchemaMigration descendents from spec deletion\n\nThe `spec_helper.rb` file includes an after hook that runs on each spec\nwhich takes every descendant of `ActiveRecord::Base` and calls\n`delete_all` on it.\n\nIn ActiveRecord 6, there are two classes that are returned as...
ruby
chosen
[ { "from": "system", "value": "Change dev key in RSpec helper\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'simplecov'\n\nSimpleCov.start do\n\tadd_filter '/spec/'\nend\n\nrequire 'cb'\n\nCb.configure do | config |\n\tconfig.use_json \t= true #################...
ruby
chosen
[ { "from": "system", "value": "Remove attr_accessor as it's not needed\n" }, { "from": "human", "value": "require 'open3'\n\nclass DocumentParser\n attr_accessor :title, :body\n\n def initialize(filename)\n @filename = filename\n to_hash\n end\n\n def tika_path\n Rails.root.join('ven...
ruby
chosen
[ { "from": "system", "value": "Revert \"use beta.fct.li to deploy the new server\"\n\nThis reverts commit b0979501d7488bd22509e4f8038d7d0794915747.\n" }, { "from": "human", "value": "server 'beta.fct.li', :app, :web, :primary => true\n\nset :deploy_env, 'production'\n\nrole :web, \"beta.fct.li\" ...
ruby
chosen
[ { "from": "system", "value": "Rename repo and library files.\n" }, { "from": "human", "value": "require '../lib/RubyEDS.rb'\nrequire '../lib/config_module.rb'\nrequire 'pp'\n\ninclude RubyEDS\ninclude ConfigModule\n\nargs = get_vars('../lib/util.conf')\nusername = args['username']\npassword = ar...
ruby
chosen
[ { "from": "human", "value": "Add example for infinite input timeout\n" }, { "from": "gpt", "value": "# encoding: utf-8\n\nrequire 'tty-command'\n\ncmd = TTY::Command.new\n\npath = File.expand_path(\"../spec/fixtures/infinite_input\", __dir__)\n\nrange = 1..Float::INFINITY\ninfinite_input = range...
ruby
chosen
[ { "from": "system", "value": "Fix correct path for expiring cached pages, oops\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n self.page_cache_directory = \"#{Rails.root}/public/cached_pages\"\n protect_from_forgery with: :exception\n\n def self.expir...
ruby
chosen
[ { "from": "system", "value": "Add comment for pushing to heroku\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n protect_from_forgery with: :exception\nend\n" }, { "from": "gpt", "value": "class ApplicationController < ActionController::Base\...
ruby
chosen
[ { "from": "system", "value": "Increase image proxy timeouts a bit.\n" }, { "from": "human", "value": "class ApplicationController < ActionController::API\n\n protected \n def proxy(url)\n logger.debug \"Proxying to #{url}\"\n\n proxy_response = HTTP.timeout(:per_operation, :connect => 3,...
ruby
chosen
[ { "from": "system", "value": "FIX: Make `Jobs::MigrateUploadScheme` a scheduled job.\n\nThis reverts https://github.com/discourse/discourse/commit/9d8db11c\n\nIf the job fails during execution or if `SiteSetting.migrate_to_new_scheme`\nhas been set to `false`, the job will be considered as executed even\nth...
ruby
chosen
[ { "from": "system", "value": "Drop development dependency to rdoc\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/rpxem/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.name = 'rpxem'\n gem.version = RPxem::VERSION\n ge...
ruby
chosen
[ { "from": "system", "value": "Fix bug - Env.fetch returns a string\n" }, { "from": "human", "value": "# Delete old logs automatically when the server or console are started. For the\n# test environment, this is done in a before(:suite) hook.\nif Rails.env.development? && ENV.fetch('AUTO_CLEAR_LO...
ruby
chosen
[ { "from": "human", "value": "Add initial test for ActionView::LogSubscriber\n" }, { "from": "gpt", "value": "require \"spec_helper\"\nrequire \"sapience/extensions/action_view/log_subscriber\"\n\ndescribe Sapience::Extensions::ActionView::LogSubscriber do\n describe \"#info\" do\n let(:messa...
ruby
chosen
[ { "from": "system", "value": "Simplify `clj` script and fix some quoting.\n\nSigned-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>\n" }, { "from": "human", "value": "require 'formula'\n\nclass Clojure <Formula\n url 'http://github.com/downloads/clojure/clojure/cloj...
ruby
chosen
[ { "from": "system", "value": "Correct sortable table dependancy in gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path(\"../lib/noodall/ui/version\", __FILE__)\n\nGem::Specification.new do |s|\n s.name = \"noodall-ui\"\n s.version = Noodall::UI::VERSI...
ruby
chosen
[ { "from": "system", "value": "Return early if server is down\n" }, { "from": "human", "value": "class ServersController < ApplicationController\n def show\n ip = Rails.env.production? ? 'localhost' : 'de.qlrace.com'\n ips = [ip, 'tx.qlrace.com']\n ports = [27960, 27961]\n @servers =...
ruby
chosen
[ { "from": "system", "value": "Update round to default spree rounding\n" }, { "from": "human", "value": "module Spree\n Variant.class_eval do\n scope :sale_off, -> { where('sale_rate > 0').where.not(sale_date: nil).where('sale_date < ?', DateTime.now) }\n\n alias_method :orig_price_in, :pr...
ruby
chosen
[ { "from": "system", "value": "Fix books attributes to work properly\n" }, { "from": "human", "value": "class Collection < ActiveRecord::Base\n belongs_to :user\n has_many :book_collections, dependent: :destroy\n has_many :books, :through => :book_collections\n validates :name, :presence => t...
ruby
chosen
[ { "from": "system", "value": "Fix to issues with grouping and rails/blacklight upgrade\n" }, { "from": "human", "value": "# -*- encoding : utf-8 -*-\nclass SolrGroup \n extend ActiveModel::Naming\n include RSolr::Ext::Doc\n\n @@source_type_priority = {\n 'research' => 1,\n 'publisher' =...
ruby
chosen
[ { "from": "system", "value": "Add new data to project serializer\n" }, { "from": "human", "value": "class ProjectSerializer < ActiveModel::Serializer\n attributes :id\nend\n" }, { "from": "gpt", "value": "class ProjectSerializer < ActiveModel::Serializer\n attributes :id, :title, :...
ruby
chosen