conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Use active record error attribute_names intead errors.keys if available\n" }, { "from": "human", "value": "module JSONAPI\n module Rails\n # @private\n class SerializableActiveModelError < Serializable::Error\n title do\n \"Invalid #{@field}\" unl...
ruby
chosen
[ { "from": "system", "value": "Write summary and description of 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 'peeek/version'\n\nGem::Specification.new do |spec|\n spec.name...
ruby
chosen
[ { "from": "human", "value": "Test code for reverse and upcase string - 0 failures\n" }, { "from": "gpt", "value": "# Solution Below\n\n# RSpec Tests. They are included in this file because the local variables you are creating are not accessible across files. If we try to run these files as a sep...
ruby
chosen
[ { "from": "human", "value": "Set up skeleton for board specs\n" }, { "from": "gpt", "value": "require_relative 'board'\n\ndescribe 'ChessBoard' do\n\n it 'should instantiate a new ChessBoard' do\n board = ChessBoard.new\n expect(board).to be_a ChessBoard\n end\n\n it 'should print out ...
ruby
chosen
[ { "from": "system", "value": "Print a message to standard output indicating that Exlibris::Aleph has completed initialization\n" }, { "from": "human", "value": "begin\n # Load all the sub libraries when the application starts\n Exlibris::Aleph::TablesManager.instance.sub_libraries.all\n # Loa...
ruby
chosen
[ { "from": "system", "value": "Add method for getting overdue days\n" }, { "from": "human", "value": "module CandyCheck\n module AppStore\n # Store multiple {Receipt}s in order to perform collective operation on them\n class ReceiptCollection\n # @return [Array<Receipt>]\n attr_r...
ruby
chosen
[ { "from": "system", "value": "Fix for non-browser after event.\n" }, { "from": "human", "value": "AfterConfiguration do |config|\r\n puts(\"Specs are being executed from: #{config.spec_location}\")\r\nend\r\n\r\nBefore('~@practice') do\r\n @browser = Symbiont::Browser.start\r\nend\r\n\r\nAfter...
ruby
chosen
[ { "from": "system", "value": "Downgrade Aptana Studio to version 3.4.2\n\nThe previous version 3.5.0 is no longer available, and the url\nis dead. Perhaps it was a pre-release.\n" }, { "from": "human", "value": "class AptanaStudio < Cask\n url 'http://download.aptana.com/studio3/standalone/3.5...
ruby
chosen
[ { "from": "human", "value": "Add simple spec for module_say\n\nSigned-off-by: Aki Saarinen <278bc57fbbff6b7b38435aea0f9d37e3d879167e@akisaarinen.fi>\n" }, { "from": "gpt", "value": "require 'rubygems'\nrequire 'mocha'\nrequire 'rspec'\nrequire 'module_say'\n\ndescribe Module_Say, \"#privmsg\" do...
ruby
chosen
[ { "from": "system", "value": "Send notification to the queue after term removal only when the record deletion in database was successfull\n" }, { "from": "human", "value": "require 'torquebox'\nrequire 'sinatra'\nrequire 'sinatra/reloader'\nrequire 'haml'\n\nrequire 'models/url'\nrequire 'models...
ruby
chosen
[ { "from": "system", "value": "Fix get :index call - add missing event id. Passing tests.\n" }, { "from": "human", "value": "require 'rails_helper'\n\n# describe LocalitiesController, type: :controller do\n# before(:example) do\n# sign_in_user(double('user', role?: 'admin'))\n# end\n# \n#...
ruby
chosen
[ { "from": "system", "value": "Deal with odd 1.9.2 warning on Travis.\n\nSee this build:\n\nhttps://travis-ci.org/rspec/rspec-rails/jobs/23480818#L471\n" }, { "from": "human", "value": "require \"spec_helper\"\n\nmodule RSpec::Rails\n describe MailerExampleGroup do\n module ::Rails; end\n ...
ruby
chosen
[ { "from": "human", "value": "Add mutation covering unit spec for Morpher::Evaluator::Transformer::Block\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Morpher::Evaluator::Transformer::Block do\n\n let(:body_a) do\n s(:key_fetch, 'foo')\n end\n\n let(:body_b) do\n s(:...
ruby
chosen
[ { "from": "system", "value": "Fix formula for new qt" }, { "from": "human", "value": "require \"formula\"\n\nclass Qwtplot3d < Formula\n homepage \"http://qwtplot3d.sourceforge.net\"\n url \"https://github.com/mantidproject/homebrew-mantid/raw/master/kits/qwtplot3d-0.2.7.tgz\"\n sha256 \"8ed5...
ruby
chosen
[ { "from": "system", "value": "Remove todo from gemspec description\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/rain/version', __FILE__)\n\nGem::Specification.new do |s|\n s.authors = [\"Vaughn Draughon\"]\n s.email = [\"vaughn@ro...
ruby
chosen
[ { "from": "human", "value": "Add basic specs for `ProxyingConnectionPool`\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe ActiveReplicas::ProxyingConnectionPool do\n subject { ActiveReplicas::ProxyingConnectionPool }\n\n before do\n @primary_pool = double 'primary connect...
ruby
chosen
[ { "from": "system", "value": "Fix class name in the documentation [ci skip]\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire \"active_job\"\n\nmodule ActionMailer\n # The <tt>ActionMailer::NewDeliveryJob</tt> class is used when you\n # want to send emails outside of ...
ruby
chosen
[ { "from": "system", "value": ":white_check_mark: Add test of source_file for rails integration\n" }, { "from": "human", "value": "require File.expand_path(\"../rails_helper\", __FILE__)\n\ndescribe EasySettings do\n subject { described_class }\n its(:namespace) { is_expected.to eq Rails.env }\...
ruby
chosen
[ { "from": "system", "value": "Add with rating helper method\n" }, { "from": "human", "value": "module ActsAsReviewable\n # The named scopes are:\n # in_order: Returns reviews in the order they were created (created_at ASC).\n # recent: Returns reviews by how recently they were created (create...
ruby
chosen
[ { "from": "system", "value": "Fix | Destroy callback for non active-models\n" }, { "from": "human", "value": "module Setup\n class Deletion < Setup::Task\n include BulkableTask\n\n build_in_data_type\n\n def run(message)\n if (model = data_type_from(message).records_model)\n ...
ruby
chosen
[ { "from": "system", "value": "Switch to alias_method from alias to fix non-tty method aliasing.\n" }, { "from": "human", "value": "# Copyright (c) 2010 Michael Dvorkin\n#\n# Awesome Print is freely distributable under the terms of MIT license.\n# See LICENSE file or http://www.opensource.org/lic...
ruby
chosen
[ { "from": "system", "value": "Add backslash escape to sql escape method\n" }, { "from": "human", "value": "module Bricolage\n\n module SQLUtils\n\n private\n\n def sql_string_literal(s)\n %Q('#{escape_sql_string s}')\n end\n\n alias s sql_string_literal\n\n def escape_sql_st...
ruby
chosen
[ { "from": "system", "value": "Add scope when getting an oauth token\n" }, { "from": "human", "value": "require \"oauth2\"\n\nclass Creatubbles::Client\n attr_writer :api_url, :username, :password\n\n def initialize(client_id: nil, client_secret: nil, username: nil, password: nil, api_url: Crea...
ruby
chosen
[ { "from": "system", "value": "Switch to rake spec to support both RubyMotion iOS and OSX\n" }, { "from": "human", "value": "# include rake task spec:specific only if included in a rake file\nif Kernel.const_defined?(:Rake)\n desc \"Run a specific list of motion specs\"\n namespace :spec do\n ...
ruby
chosen
[ { "from": "system", "value": "drop-webapp: Fix Mongoid::References for Mongoid 3+\n" }, { "from": "human", "value": "module Mongoid\n module References\n module ClassMethods\n def references(fields, opts={})\n raise ArgumentError, \":type option is missing\" if not opts[:type]\n ...
ruby
chosen
[ { "from": "system", "value": "Create file for port numbers\n" }, { "from": "human", "value": "require 'spork/test_framework/qspec'\n\nmodule Qspec\n module SporkHelper\n PORT = ::Spork::TestFramework::Qspec::DEFAULT_PORT\n\n def start_spork_workers\n @qspec_opts[:count].times do |i|\...
ruby
chosen
[ { "from": "system", "value": "Refactor update loop and handle interrupts in Monitor\n" }, { "from": "human", "value": "require \"listen\"\nrequire \"rspec-live/key_handler\"\nrequire \"rspec-live/result_detail\"\n\nmodule RSpecLive\n class Monitor\n def initialize(suite, runner, display, det...
ruby
chosen
[ { "from": "system", "value": "Remove extra inspect method from Example\n" }, { "from": "human", "value": "module Swagger\n module V2\n # A class to represent example objects in the Swagger schema.\n # Usually used to represent example request or responses.\n # Provides access to both t...
ruby
chosen
[ { "from": "system", "value": "Add \"detailed-exitcode\" as default to plan\n\nThis is a useful flag that should be included when we run a plan, so we\ncan use the exitcode to determine if an apply needs to happen upon a\nproject.\n\nUpdate the error checking so we do not overwrite the exitcode, as the\nabor...
ruby
chosen
[ { "from": "system", "value": "Update .podspec to reference latest tag\n" }, { "from": "human", "value": "#\n# Be sure to run `pod lib lint SetNeedsReadable.podspec' to ensure this is a\n# valid spec before submitting.\n#\n# Any lines starting with a # are optional, but their use is encouraged\n#...
ruby
chosen
[ { "from": "system", "value": "Add rake task to create null records.\n" }, { "from": "human", "value": "require 'rake/tasklib'\n\nmodule Chicago\n # Rake tasks for a Chicago project.\n class RakeTasks < Rake::TaskLib\n def initialize(db)\n @migration_dir = \"db/migrate\"\n @db = db...
ruby
chosen
[ { "from": "system", "value": "Update Node.js documentation (6.0.0, 4.4.3)\n" }, { "from": "human", "value": "module Docs\n class Node < UrlScraper\n self.name = 'Node.js'\n self.slug = 'node'\n self.type = 'node'\n self.links = {\n home: 'https://nodejs.org/',\n code: 'htt...
ruby
chosen
[ { "from": "system", "value": "Set verify mode to none for https\n" }, { "from": "human", "value": "require 'net/https'\n\nmodule ActionSms #:nodoc:\n module ConnectionAdapters #:nodoc:\n # All the concrete gateway adapters follow the interface laid down in this\n # class. You can use thi...
ruby
chosen
[ { "from": "system", "value": "Remove empty and not used initializer\n" }, { "from": "human", "value": "# encoding: UTF-8\n\nrequire 'gooddata'\n\nrequire File.join(File.dirname(__FILE__), 'base_middleware')\n\nmodule GoodData::Bricks\n class RestForceMiddleware < GoodData::Bricks::Middleware\n ...
ruby
chosen
[ { "from": "system", "value": "Add pry as dev 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 'civil/version'\n\nGem::Specification.new do |spec|\n spec.name = \"c...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary “before_add” association option\n" }, { "from": "human", "value": "module Parole\n module Commentable\n extend ActiveSupport::Concern\n\n included do\n # Default options for all comments associations\n association_options = { clas...
ruby
chosen
[ { "from": "system", "value": "Use inline unless to make code more readable\n" }, { "from": "human", "value": "class Router\n # Graph of server connections. \n # It's a Hash of Arrays, which contains strings. Keys are server names with\n # a connection to other servers. Each of these servers i...
ruby
chosen
[ { "from": "system", "value": "Add the rake task to actually copy the files... let's see if this works\n" }, { "from": "human", "value": "namespace :turf do\n desc \"Create classes\"\n task :create_classes do\n root = File.expand_path(\"../../\", File.dirname(__FILE__))\n target = Rake.or...
ruby
chosen
[ { "from": "system", "value": "Rename rake task to republish tags\n\n`rake panopticon:republish_tags` is more descriptive and won't\ninterfere with the pattern of running `panopticon:register` on each\ndeploy.\n" }, { "from": "human", "value": "namespace :panopticon do\n desc \"Register applicat...
ruby
chosen
[ { "from": "system", "value": "Fix previous 30 days stat\n" }, { "from": "human", "value": "class Meeting < ActiveRecord::Base\n default_scope { order(\"met DESC\") }\n\n scope :met_between, ->(start_time, end_time) { where(\"met >= ? AND met < ?\", start_time, end_time) }\n scope :met_after, ...
ruby
chosen
[ { "from": "system", "value": "Add full errors string message\n" }, { "from": "human", "value": "class Project < ApplicationRecord\n belongs_to :user\n has_many :progress_updates, dependent: :destroy\n\n belongs_to :type\n has_many :project_genres, dependent: :destroy\n has_many :genres, thr...
ruby
chosen
[ { "from": "system", "value": "Add userstream gem to dependency.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'agharta/version'\n\nGem::Specification.new do |gem|\n gem.n...
ruby
chosen
[ { "from": "system", "value": "Use inclusion rather than numericality validators\n" }, { "from": "human", "value": "require 'reform/form/coercion'\n\nclass OptionsForm < Reform::Form\n feature Coercion\n property :toc, type: Types::Form::Int,\n validates: {\n numericalit...
ruby
chosen
[ { "from": "system", "value": "Fix some machinist errors by deferring shamming.\n" }, { "from": "human", "value": "require 'machinist/active_record'\nrequire 'sham'\nrequire 'faker'\n\nSham.name { Faker::Name.name }\nSham.email { Faker::Internet.email }\nSham.password { Faker::Name.first_n...
ruby
chosen
[ { "from": "system", "value": "Put the ResolrizeJob on the default queue\n" }, { "from": "human", "value": "class ResolrizeJob < ActiveJob::Base\n queue_as :resolrize\n\n def perform\n ActiveFedora::Base.reindex_everything\n end\nend\n" }, { "from": "gpt", "value": "class Resolr...
ruby
chosen
[ { "from": "system", "value": "Add comment about retry mechanism\n" }, { "from": "human", "value": "class Lit::Base < ActiveRecord::Base\n self.abstract_class = true\n\n before_save :mark_for_retry\n\n attr_accessor :retried_created, :retried_updated\n\n def mark_for_retry\n @will_retry_cr...
ruby
chosen
[ { "from": "system", "value": "Add validation to avoid errors when there are nil values for Location.\n" }, { "from": "human", "value": "class Location < ActiveRecord::Base\n\tCities.data_path = Rails.root.join('config', 'extras', 'cities')\n\n\tattr_accessor :city\n attr_accessor :base_address\...
ruby
chosen
[ { "from": "human", "value": "Add Filter - used by searches\n" }, { "from": "gpt", "value": "module Pano\n class Filter\n\n attr_accessor :dimension, :selected, :url\n\n def initialize(dimension, selected, url)\n self.dimension = dimension\n self.selected = selected\n self....
ruby
chosen
[ { "from": "system", "value": "Verify that /etc/hosts.equiv and ~/.rhosts don't exist\n\nStig: V-38491\n\n[Finishes #98327690](https://www.pivotaltracker.com/story/show/98327690)\n\nSigned-off-by: Maria Shaldibina <dc03896a0185453e5852a5e0f0fab6cbd2e026ff@pivotal.io>\n" }, { "from": "human", "val...
ruby
chosen
[ { "from": "system", "value": "Add summary to gem file\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"rails-i18nterface/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |s|\n ...
ruby
chosen
[ { "from": "human", "value": "Add progress on 6.6 Bingo Solo Challenge Assignment\n" }, { "from": "gpt", "value": "# A Nested Array to Model a Bingo Board SOLO CHALLENGE\n\n# I spent [2] hours on this challenge.\n\n\n# Release 0: Pseudocode\n\n=begin\nOutline: \n\nCreate a method to generate a le...
ruby
chosen
[ { "from": "system", "value": "Use new_action.before callback to cleanup controller.\n" }, { "from": "human", "value": "module Spree\n module Admin\n class StockLocationsController < ResourceController\n\n def new\n if Spree::Config[:default_country_id].present?\n @stock_...
ruby
chosen
[ { "from": "system", "value": "Load the new VERSION;\nAdd LICENSE;\nFix 'files';\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'rusen'\n s.version = '0.0.2'\n s.date = '2012-01-25'\n s.platform = Gem::Platform::RUBY\n s.autho...
ruby
chosen
[ { "from": "system", "value": "Allow custom config and mappings\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'pivotal-tracker'\nrequire 'yaml'\n\nconfig = YAML.load(open(File.join(File.dirname(__FILE__), 'config.yml')))\nmappings = YAML.load(open(File.join(File.dirname(__FILE__)...
ruby
chosen
[ { "from": "system", "value": "Refactor current scope to play nice with joins\n" }, { "from": "human", "value": "# frozen_string_literal: true\nclass Forecast < ApplicationRecord\n extend ApiMethods\n self.abstract_class = true\n\n belongs_to :api_request\n belongs_to :spot\n\n class << self...
ruby
chosen
[ { "from": "system", "value": "Use one list of attr_accessors.\n" }, { "from": "human", "value": "module CiInACan\n\n class Build\n params_constructor\n\n attr_accessor :git_ssh, :local_location, :repo, :sha\n attr_accessor :id\n\n def self.parse content\n GithubBuildParser.new....
ruby
chosen
[ { "from": "system", "value": "Add a test to make sure that pygmentize is there\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe Blogit::Parsers::MarkdownParser do\n\n let(:parser) { Blogit::Parsers::MarkdownParser.new(\"## Some textile\\n\\nA paragraph\") }\n let(:desired...
ruby
chosen
[ { "from": "system", "value": "Refactor Rover class after adding module calculations\n" }, { "from": "human", "value": "module MarsPhotos\n class Rover\n attr_accessor :name\n def initialize(name)\n @name = name\n end\n\n def get(parameter = {})\n response = HTTParty.get(bu...
ruby
chosen
[ { "from": "system", "value": "Throw a named exception when the socket fails to connect.\n" }, { "from": "human", "value": "require 'thread' \n\nmodule Noam\n class Player\n def initialize(con_host,con_port)\n @socket = TCPSocket.new(con_host, con_port)\n @queue = Queue.new\n @...
ruby
chosen
[ { "from": "system", "value": "Check for catkey prior to building solr doc\n" }, { "from": "human", "value": "class SwIndexerEngine < BaseIndexer::MainIndexerEngine\n # It allows the consumer to modify the targets list before doing the final writing\n # to the solr core. Default behavior retur...
ruby
chosen
[ { "from": "system", "value": "Disable single registration for snapshotting task.\n\nThis makes the process much faster and less fragile.\n" }, { "from": "human", "value": "namespace :actions do\n task :create_snapshots => :environment do\n success_count = failure_count = skip_count = 0\n ...
ruby
chosen
[ { "from": "human", "value": "Fix tests for device controller\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Api::DevicesController do\n\n include Devise::Test::ControllerHelpers\n let(:user) { FactoryBot.create(:user) }\n EXPECTED = [:device,\n :images,\n ...
ruby
chosen
[ { "from": "system", "value": "Add rspec as dev 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 'benchmark/perf/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Work around Minitest and FakeFS collision issues\n\nSee https://github.com/defunkt/fakefs/issues/143\n" }, { "from": "human", "value": "require 'minitest/autorun'\nrequire 'mocha/setup'\nrequire 'support/matchers'\nrequire 'celluloid/test'\nrequire 'fakefs/safe'\n\n...
ruby
chosen
[ { "from": "system", "value": "Configure additional assets to precompile\n\nFixes #4" }, { "from": "human", "value": "require_relative 'boot'\n\nrequire 'action_controller/railtie'\nrequire 'action_view/railtie'\nrequire 'active_model/railtie'\nrequire 'sprockets/railtie'\n\nBundler.require(*Rail...
ruby
chosen
[ { "from": "system", "value": "Remove adding services to assets as this is not needed\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire File.expand_path('../boot', __FILE__)\n\nrequire 'rails'\n# Pick the frameworks you want:\nrequire 'active_model/railtie'\nrequire 'act...
ruby
chosen
[ { "from": "system", "value": "Update based on PR review" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule RuboCop\n module Cop\n class Generator\n # A class that injects a require directive into the root RuboCop file.\n # It looks for other directives that re...
ruby
chosen
[ { "from": "system", "value": "Append message to history after handling command\n" }, { "from": "human", "value": "module Grunt\n module Responses\n module Messages\n include Concerns::Matching\n \n def on_privmsg\n Grunt.history << response\n \n if respons...
ruby
chosen
[ { "from": "system", "value": "Make NIO categories migration idempotent\n" }, { "from": "human", "value": "categories = [\n {\n title: \"Gun and weapon controls in Northern Ireland\",\n description: \"Administration of firearm licensing and authorisation for prohibited weapons in Northern ...
ruby
chosen
[ { "from": "human", "value": "Add BDB 4.8.30 to core\n\nSome software still requires this version and will not build against\nBDB 5.x.\n\nCloses #15725.\n" }, { "from": "gpt", "value": "require 'formula'\n\nclass BerkeleyDb4 < Formula\n homepage 'http://www.oracle.com/technology/products/berkele...
ruby
chosen
[ { "from": "system", "value": "Synchronize the gemspecs since CHANGELOG has been renamed to CHANGELOG.md\n" }, { "from": "human", "value": "version = File.read(File.expand_path(\"../../RAILS_VERSION\", __FILE__)).strip\n\nGem::Specification.new do |s|\n s.platform = Gem::Platform::RUBY\n s.n...
ruby
chosen
[ { "from": "system", "value": "Put symbol instead of string\n" }, { "from": "human", "value": "#!/usr/bin/ruby\n\nrequire 'json'\n\nif Dir.exist? 'resources/images/' and File.file? 'appinfo.json'\n json = JSON.parse(File.read('appinfo.json'))\n if !(json.respond_to? :resources)\n json[:resou...
ruby
chosen
[ { "from": "system", "value": "Print Request-Id when HEROKU_DEBUG is on.\n" }, { "from": "human", "value": "class HTTPInstrumentor\n class << self\n def filter_parameter(parameter)\n @filter_parameters ||= []\n @filter_parameters << parameter\n end\n\n def instrument(name, par...
ruby
chosen
[ { "from": "system", "value": "Add initializer, missing from last commit\n" }, { "from": "human", "value": "require 'periscope'\nrequire \"#{Rails.root}/lib/extensions/periscope\"\n\nrequire 'jsonapi-resources'\nrequire \"#{Rails.root}/lib/extensions/jsonapi\"\n" }, { "from": "gpt", "...
ruby
chosen
[ { "from": "system", "value": "Set locals to nil on default.\n" }, { "from": "human", "value": "require 'haml'\nrequire 'erb'\n\n# This module provides a selection of template rendering methods.\n#\n# They are used like in Sinatra in the following way:\n#\n# get '/hello' do\n# haml :index, :bod...
ruby
chosen
[ { "from": "system", "value": "Make it clear that we intent to use | over ||\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n# We're patching `ActionDispatch::Routing::Mapper` in\n# config/initializers/routing_draw.rb\nmodule Gitlab\n module Patch\n module DrawRoute\n ...
ruby
chosen
[ { "from": "human", "value": "Add a rake task to wrap flattening utility\n" }, { "from": "gpt", "value": "namespace :marriage_abroad do\n desc \"Flatten a set of outcomes for a given country\"\n task :flatten_outcomes, [:country] => [:environment] do |_, args|\n MarriageAbroadOutcomeFlattene...
ruby
chosen
[ { "from": "system", "value": "Upgrade batchyscaphe to v2.5.1 and homepage\n" }, { "from": "human", "value": "cask :v1 => 'bathyscaphe' do\n version '2.5.0'\n sha256 '16c9c7c2ade802f735e3e10f8330f548bd8ea2192e65f5c187618603af1a7422'\n\n url \"http://dl.sourceforge.jp/bathyscaphe/62963/BathySca...
ruby
chosen
[ { "from": "system", "value": "Rebuild package with properly built release.\n" }, { "from": "human", "value": "class Sifter < FPM::Cookery::Recipe\n name 'sifter'\n\n version '0.7'\n revision '4'\n description 'sifter'\n\n homepage 'https://github.com/darron/sifter'\n source \"https://githu...
ruby
chosen
[ { "from": "human", "value": "Add part of test done by E1570.\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\ndescribe TreeDisplayController do\n\n describe \"#list\" do\n it \"should not redirect to student_task controller if current user is an instructor\" do\n allow(session...
ruby
chosen
[ { "from": "system", "value": "Allow country to be null.\n" }, { "from": "human", "value": "class CreateAddresses < ActiveRecord::Migration\n def change\n create_table :addresses do |t|\n t.integer :preference_order, :null => false, :default => 1 \n t.integer :address_preference_ord...
ruby
chosen
[ { "from": "system", "value": "Use .new that is compatible with 2.0\n" }, { "from": "human", "value": "# Copyright (c) 2010 Thiago Arrais\n#\n# This file is part of rODF.\n#\n# rODF is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Lesser General Public Lice...
ruby
chosen
[ { "from": "human", "value": "Test current support for buildpack setting\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Owner do\n describe \"#buildpacks\" do\n context \"new owner\" do\n let(:owner) { Owner.new }\n it { expect(owner.buildpacks).to be_falsy }\n\n...
ruby
chosen
[ { "from": "system", "value": "Remove right after test block is run\n" }, { "from": "human", "value": "# == Schema Information\n#\n# Table name: rights\n#\n# id :integer not null, primary key\n# resource :string(255)\n# operation :string(255)\n# created_at :datetime ...
ruby
chosen
[ { "from": "system", "value": "Add logger of exception to Slatan\n" }, { "from": "human", "value": "require \"slatan/version\"\nrequire \"slatan/spirit\"\nrequire \"slatan/heart\"\nrequire \"slatan/mouth\"\nrequire \"slatan/ear\"\nrequire \"utils/string_ex\"\n\nmodule Slatan\n using StringEx\n ...
ruby
chosen
[ { "from": "system", "value": "[aphrodite] Remove project related unused tests\n" }, { "from": "human", "value": "require 'test_helper'\n\ndescribe ProjectsController do\n context \"Display information about a single project\" do\n before do\n @user = FactoryGirl.create :user\n @doc...
ruby
chosen
[ { "from": "system", "value": "Add required Paperclip 4 validations\n" }, { "from": "human", "value": "module Spree\n class HomePageFeature < ActiveRecord::Base\n\n validates :title,\n presence: true,\n length: { minimum: 1 }\n\n validates :body,\n presence: true,\n len...
ruby
chosen
[ { "from": "system", "value": "Acceptance: Fix ssh hostname for in-house runs\n" }, { "from": "human", "value": "\nstep \"Create artifacts directory\" do\n unless File.directory?('artifacts')\n Dir.mkdir(\"artifacts\")\n end\nend\nstep \"Collect puppetdb log file\" do\n # Would like to do t...
ruby
chosen
[ { "from": "system", "value": "Add missing DOWNTIME constant to the AddTimestampsToMembersAgain migration\n" }, { "from": "human", "value": "# rubocop:disable all\n# 20141121133009_add_timestamps_to_members.rb was meant to ensure that all\n# rows in the members table had created_at and updated_at...
ruby
chosen
[ { "from": "system", "value": "Remove hotfix not storing default platform\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass TraceConsumer\n include Hutch::Consumer\n\n consume '#'\n\n if ENV['QUEUE_IDENT'].present?\n queue_name \"mnemosyne.server.#{ENV['QUEUE_IDENT']...
ruby
chosen
[ { "from": "system", "value": "Allow radio buttons to display hint text\n" }, { "from": "human", "value": "module ChecklistHelper\n def format_criteria_list(criteria)\n criteria.map { |criterion| { readable_text: criterion.text } }\n end\n\n def format_action_audiences(actions)\n action_...
ruby
chosen
[ { "from": "system", "value": "Add a --dummy option to calagator:install generator\n\nThe dummy app in spec/dummy shouldn't copy migrations from db/migrate,\nsince this will cause migration name exceptions when using the rake\ntasks provided by the engine-level Rakefile.\n" }, { "from": "human", ...
ruby
chosen
[ { "from": "system", "value": "[ENHANCEMENT] Add taxes to line item model\n" }, { "from": "human", "value": "require \"woocommerce_api/resources/meta_datum\"\nmodule WoocommerceAPI\n module V2\n class LineItem < Resource\n attribute :id , Integer\n attribute :product_id , ...
ruby
chosen
[ { "from": "system", "value": "Rename id to uuid to avoid confusion\n" }, { "from": "human", "value": "module Georgia\n class MetaPage < Georgia::Page\n\n validates :slug, uniqueness: {scope: :ancestry, message: 'has already been taken'}\n\n def to_param\n self.uuid\n end\n\n cl...
ruby
chosen
[ { "from": "system", "value": "Check only a merge ability for protected actions\n" }, { "from": "human", "value": "module Ci\n class BuildPolicy < CommitStatusPolicy\n alias_method :build, :subject\n\n def rules\n super\n\n # If we can't read build we should also not have that\n ...
ruby
chosen
[ { "from": "system", "value": "Include hidden exercises for other teachers of the same study group\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass ExercisePolicy < AdminOrAuthorPolicy\n def batch_update?\n admin?\n end\n\n %i[show? feedback? statistics? rfcs_for_ex...
ruby
chosen
[ { "from": "system", "value": "Include the error code in exception messages" }, { "from": "human", "value": "module Keychain\n\n##\n# Properly extracts error messages based on error codes.\nclass KeychainException < Exception\n\n ##\n # @param [#to_s] message_prefix an indicator of where the ex...
ruby
chosen
[ { "from": "system", "value": "Support for Ruby 1.8.7 failing due new Hash syntax\n" }, { "from": "human", "value": "if defined?(Delayed)\n require 'delayed_job'\n\n module Delayed\n module Plugins\n\n class Raven < ::Delayed::Plugin\n callbacks do |lifecycle|\n lifecycl...
ruby
chosen
[ { "from": "system", "value": "Switch from process to call for failure state\n" }, { "from": "human", "value": "module Strumbar\n module Instrumentation\n module Redis\n def self.load\n Strumbar.subscribe 'query.redis' do |client, event|\n client.increment 'query.redis'\n...
ruby
chosen
[ { "from": "system", "value": "Add homepage link to gemspec\n" }, { "from": "human", "value": "# encoding: utf-8\nrequire File.expand_path('../lib/codeclimate_ci/version', __FILE__)\n\nGem::Specification.new do |spec|\n spec.name = 'codeclimate_ci'\n spec.version = CodeclimateCi:...
ruby
chosen