conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Reduce char length so Rubocop settles down\n" }, { "from": "human", "value": "require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))\n\ndescribe AlchemyAPI, 'combined_call' do\n before do\n AlchemyAPI::Config.apikey = API_KEY\n end\n\n subj...
ruby
chosen
[ { "from": "system", "value": "Update gems, using Capybara 2.1.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'masque/version'\n\nGem::Specification.new do |gem|\n gem.na...
ruby
chosen
[ { "from": "system", "value": "Make the load profile spec title more descriptive\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'Load profiles' do\n Atlas::Dataset.all.each do |dataset|\n describe \"for #{ dataset.key.upcase }\" do\n Pathname.glob(dataset.dataset_di...
ruby
chosen
[ { "from": "human", "value": "Test code for list() and match() method in Sisimai::Rhost\n" }, { "from": "gpt", "value": "require 'spec_helper'\nrequire 'sisimai/rhost'\n\ndescribe 'Sisimai::Rhost' do\n describe 'Sisimai::Rhost.list() method' do\n v = Sisimai::Rhost.list()\n it 'list() retu...
ruby
chosen
[ { "from": "system", "value": "Fix user page and show useful dashboard page\n" }, { "from": "human", "value": "#replace all redirects to \"/user/#{session[:user_id]}\" to \"/timeslots\"\nget '/' do\n if session[:user_id]\n redirect \"/user/#{session[:user_id]}\"\n else\n erb :\"/auth/logi...
ruby
chosen
[ { "from": "system", "value": "Add header controls to API\n" }, { "from": "human", "value": "require 'sinatra/base'\nrequire 'sinatra/respond_with'\nrequire 'sinatra/json'\nrequire 'json'\nrequire 'llt/form_builder'\n\nclass Api < Sinatra::Base\n register Sinatra::RespondWith\n\n post '/generat...
ruby
chosen
[ { "from": "system", "value": "Add a generic followup factory\n" }, { "from": "human", "value": "# -*- encoding : utf-8 -*-\nFactoryGirl.define do\n\n factory :outgoing_message do\n info_request\n\n factory :initial_request do\n ignore do\n status 'ready'\n message_type ...
ruby
chosen
[ { "from": "human", "value": "Add spec for getting rates when order completed\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Spree::Stock::Estimator do\n context \"complete order\" do\n it \"uses existing rates\" do\n order = create(:completed_order_with_totals)\n ...
ruby
chosen
[ { "from": "system", "value": "Fix typo 'Return' -> 'Returns'\n" }, { "from": "human", "value": "# encoding: utf-8\n# Core extensions on Hash\nclass Hash\n unless method_defined?(:symbolize_keys)\n # Returns a duplicate of self with symbolized keys\n # Defined IFF not already defined elsew...
ruby
chosen
[ { "from": "system", "value": "Change asset url to match carrierwave asset host\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe CoverImageUploader do\n\n def fixture_image\n File.open(File.join(Rails.root, '/spec/fixtures/images/transparent.png'))\n end\n\n let(:cover_i...
ruby
chosen
[ { "from": "human", "value": "Add View Spec for Learn More View\n\nAdd a view spec to account for a user being logged in/logged out for the\nLearn More view.\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe \"home/learn_more.html.erb\" do\n include Warden::Test::Helpers\n Ward...
ruby
chosen
[ { "from": "system", "value": "Make sure values are stripped\n\nThere's an issue at the moment where the data in the CSV file comes with\nspaces which messes up the import.\n" }, { "from": "human", "value": "namespace :bulk_imports do\n desc \"Import and publish Protected Food and Drink names.\\...
ruby
chosen
[ { "from": "system", "value": "Revert \"Allow passing the logbook file path/name as an URL param.\"\n\nDecided to undo this. It's a security risk if future people come across this and unknowingly run this as publicly accessible (would allow reading of arbitrary files on the file system via URL param). I don'...
ruby
chosen
[ { "from": "system", "value": "Handle salary validation problem gracefully.\n" }, { "from": "human", "value": "class SalariesController < AuthorizedController\n # Filter/Search\n # =============\n has_scope :by_state\n has_scope :by_value_period, :using => [:from, :to], :default => proc { |c|...
ruby
chosen
[ { "from": "system", "value": "Fix redirect for invalid logins\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n\n def new\n @user = User.new\n render :new, layout: false\n end\n\n def create\n @user = User.find_by(username: params[:user][:username]...
ruby
chosen
[ { "from": "system", "value": "Fix if statement so a succesful login takes the user to their own user profile\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n def new\n end\n\n def create\n user = User.find_by(username: params[:session][:username])\n ...
ruby
chosen
[ { "from": "system", "value": "Allow load_tasks to specify a directory\n" }, { "from": "human", "value": "module Bun\n module Bot\n class Base < Thor\n def self.calling_file\n call_stack = caller.map{|c| [c[/^(.*):\\d+/,1],c[/in\\s+`(.*)'/,1]]}\n called_from = call_stack.fi...
ruby
chosen
[ { "from": "human", "value": "Add GitRepositoryService in preparation for extracting logic\n\nhttps://bugzilla.redhat.com/show_bug.cgi?id=1393982\n(transferred from ManageIQ/manageiq@436969b205dc85db451136c2d19c302714c2820d)\n" }, { "from": "gpt", "value": "class GitRepositoryService\n def setup...
ruby
chosen
[ { "from": "system", "value": "Fix relation/array handling in OrderCycles List\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n# Lists available order cycles for a given customer in a given distributor\nmodule Shop\n class OrderCyclesList\n def initialize(distributor, cust...
ruby
chosen
[ { "from": "system", "value": "Add question_id to Answer creation in seed file\n" }, { "from": "human", "value": "\n10.times do\n User.create(name: TubularFaker.name, password: '123')\nend\n\n10.times do\n question = Question.create(title: TubularFaker.company, content: TubularFaker.lingo, user...
ruby
chosen
[ { "from": "system", "value": "Add support for h4, h5 and h6.\n" }, { "from": "human", "value": "module Watir\r\n class Ul < NonControlElement\r\n TAG = 'UL'\r\n end\r\n \r\n module Container\r\n def ul(how, what)\r\n return Ul.new(self, how, what)\r\n end\r\n end\r\n \r\n cl...
ruby
chosen
[ { "from": "system", "value": "Resolve and toggle action added\n" }, { "from": "human", "value": "require_dependency \"rscratch/application_controller\"\nmodule Rscratch\n class ExceptionsController < ApplicationController\n include SmartListing::Helper::ControllerExtensions\n helper Smar...
ruby
chosen
[ { "from": "system", "value": "Remove bcrypt require from BaseUser\n" }, { "from": "human", "value": "require 'bcrypt'\n\nmodule Authem::BaseUser\n extend ::ActiveSupport::Concern\n\n included do\n validates_uniqueness_of :email\n validates_format_of :email, with: /\\A\\S+@\\S+\\z/\n v...
ruby
chosen
[ { "from": "system", "value": "Break engine isolation a bit.\n\nAllow application route helpers to be accessed if they dont match\nanything in the engine first. Needed to embed pages in app layout\n" }, { "from": "human", "value": "module PatternLibrary\n module ApplicationHelper\n end\nend\n" ...
ruby
chosen
[ { "from": "system", "value": "Remove protected visibility from constraint\n" }, { "from": "human", "value": "# encoding: utf-8\n\nmodule Axiom\n module Types\n\n # Abstract base class for every type\n class Type\n extend Options, DescendantsTracker\n\n accept_options :constraint...
ruby
chosen
[ { "from": "system", "value": "Disable real cost by purchases\n" }, { "from": "human", "value": "module Interventions\n module Costs\n class InputService\n attr_reader :product\n\n def initialize(product: nil)\n @product = product\n end\n\n def perform(quantity: 0, ...
ruby
chosen
[ { "from": "system", "value": "Make excon only a development dependency\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"wikidata/version\"\n\nGem::Specification.new do |s|\n s.name = \"wikidata-client\"\n s.version = Wikidata::VERSION.dup\...
ruby
chosen
[ { "from": "system", "value": "Apply a patch by Martin Zdrahal to no longer use the output variable\n" }, { "from": "human", "value": "# Copyright 2014 SysEleven GmbH\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance wi...
ruby
chosen
[ { "from": "system", "value": "Add @cwrw as an author\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'fieldhand'\n s.version = '0.7.0'\n s.summary = 'An OAI-PMH harvester'\n s.description = <<-EOF\n A library to harvest metadata from OAI-PMH repositories.\n EO...
ruby
chosen
[ { "from": "system", "value": "Fix array style representation of Seed data\n" }, { "from": "human", "value": "require 'open-uri'\nrequire 'active_record/fixtures'\n\nrelated_identifier_types = [\n [ \"DOI\" ]\n [ \"URL\" ]\n [\" arXiv \"]\n [\" PMID \"]\n [\" ARK \"]\n [\" Handle \"]\n [\"...
ruby
chosen
[ { "from": "system", "value": "Add url to seed file for easy rails console testing\n" }, { "from": "human", "value": "# This file should contain all the record creation needed to seed the database with its default values.\n# The data can then be loaded with the rails db:seed command (or created a...
ruby
chosen
[ { "from": "system", "value": "Change db/seed.rb to have input date per South Bend raw data\n" }, { "from": "human", "value": "# This file should contain all the record creation needed to seed the database with its default values.\n# The data can then be loaded with the rake db:seed (or created a...
ruby
chosen
[ { "from": "system", "value": "[STABLE] Remove some abiguity from bot status messages.\n" }, { "from": "human", "value": "require 'mutations'\n\nmodule FBPi\n # This class reads bot status information that has been cached by the Pi. This\n # should not be confused with FetchBotStatus, which act...
ruby
chosen
[ { "from": "system", "value": "Refactor inject runner dependency in EventsHandler\n" }, { "from": "human", "value": "require 'dredd_hooks/runner'\n\nmodule DreddHooks\n class Server\n class EventsHandler\n\n attr_reader :runner\n private :runner\n\n def initialize\n @run...
ruby
chosen
[ { "from": "system", "value": "Revert \"Move current_user from protection section so it can be used in a controller\"\n\nDoing this for now until James/i386 can confirm that the current_user needs to be in the public scope.\n\nThis reverts commit cca77744a6ac29b387ad24d0afd2ec892f29671e.\n" }, { "fro...
ruby
chosen
[ { "from": "human", "value": "Add fact to display the current user's full name\n\nI'm using this fact to display the current user's full name by using your 'mac_current_user' fact as a variable. As an example:\r\n\r\n'mac_current_user' = paulgalow\r\n'mac_current_user_full_name' = Paul Galow\r\n\r\nAs I'm us...
ruby
chosen
[ { "from": "system", "value": "Add some debug logging for FindVirtualHost, which seems to be crapping out on 2019.beconlarp.com\n" }, { "from": "human", "value": "module Intercode\n class VirtualHostConstraint\n def matches?(request)\n request.env['intercode.convention']\n end\n end\...
ruby
chosen
[ { "from": "system", "value": "Make message for SeventyTwoCharLimit rule more specific\n" }, { "from": "human", "value": "module Poper\n module Rule\n class SeventyTwoCharLimit < Rule\n MSG = 'Every line should be 72 chars or less'\n\n def check(message)\n MSG if message.line...
ruby
chosen
[ { "from": "system", "value": "Allow customization of config location.\n" }, { "from": "human", "value": "require 'yaml'\n\nclass Rack::Webtranslateit::Configuration\n attr_accessor :api_key, :files, :master_locale, :password\n\n def initialize\n root = defined?(RAILS_ROOT) && RAILS_ROOT\n ...
ruby
chosen
[ { "from": "human", "value": "Create comment spec test file.\n" }, { "from": "gpt", "value": "require 'yaml'\nrequire 'minitest/autorun'\nrequire_relative '../lib/taaze.rb'\n\nURL = ''\ncomments_from_file = YAML.load(File.read('./spec/testfiles/comments.yml'))\ncomments_found = Taaze.new(url).com...
ruby
chosen
[ { "from": "system", "value": "Clarify behavior for capital letters in tags\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'markdo/task'\n\nmodule Markdo\n describe Task do\n describe 'given no tags' do\n describe '#tags' do\n it 'is empty' do\n expect(...
ruby
chosen
[ { "from": "system", "value": "Remove extraneous empty SCG class def.\n" }, { "from": "human", "value": "module CaTissue\n # Declares the classes modified for migration.\n shims Participant, SpecimenCollectionGroup\n\n class Participant::Clinical::Duration\n # Makes a non-PHI date field fro...
ruby
chosen
[ { "from": "system", "value": "Add integration test for successful signup\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass UsersSignupTest < ActionDispatch::IntegrationTest\n\n test 'invalid signup information does not create new user' do\n get signup_path\n assert_no_diff...
ruby
chosen
[ { "from": "system", "value": "Add uninstall stanza for Jawbone Updater\n" }, { "from": "human", "value": "class JawboneUpdater < Cask\n url 'http://content.jawbone.com/store/dashboard/Jawbone_Updater-2.2.3.pkg'\n homepage 'http://jawbone.com/'\n version '2.2.3'\n sha256 '3085edf935347e455734...
ruby
chosen
[ { "from": "system", "value": "Revert \"Remove unused sprockets-helpers dependency\"\n\nGuess we do need it...\n\nThis reverts commit 5edc902c47efc7b00c016216017d52a035fcc330.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"m...
ruby
chosen
[ { "from": "system", "value": "Use local fixture for Image factory.\n\n * faster tests\n * no internet connection needed\n\nFixes #6342\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :image, class: Spree::Image do\n attachment URI.parse('http://upload.wikimedia.org/wikip...
ruby
chosen
[ { "from": "system", "value": "Load different sequel extensions at global and conn level\n\ndepending on database type\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'logger'\n\nrequire 'sequel'\nrequire 'sequel/model'\n\nmodule JobBoard\n module Models\n autoload...
ruby
chosen
[ { "from": "system", "value": "Use class methods in generated migration.\n" }, { "from": "human", "value": "class Create<%= class_name.pluralize %> < ActiveRecord::Migration\n\n def self.up\n create_table :refinery_<%= table_name %> do |t|\n<%\n attributes.each do |attribute|\n # turn ima...
ruby
chosen
[ { "from": "system", "value": "Allow multiple reviews of Message Dispatch state\n" }, { "from": "human", "value": "require 'plezi/websockets/message_dispatch' unless defined?(::Plezi::Base::MessageDispatch)\n\nmodule Plezi\n protected\n\n @plezi_finalize = nil\n def plezi_finalize\n if @ple...
ruby
chosen
[ { "from": "system", "value": "Remove Linter superclass from LinterRegistry\n\nThe superclass `Linter` was incorrectly being returned in the list of\nregistered linters. Remove the inclusion of the `LinterRegistry` module\nto remove it.\n\nThis didn't previously have any negative effect because the `Linter`\...
ruby
chosen
[ { "from": "system", "value": "Create a new instance for the exception/exit warning\n" }, { "from": "human", "value": "require 'sensu-plugin'\nrequire 'mixlib/cli'\n\nmodule Sensu\n module Plugin\n class CLI\n include Mixlib::CLI\n\n # Implementing classes should override this to pr...
ruby
chosen
[ { "from": "human", "value": "Set neutral feedback value to default 0\n" }, { "from": "gpt", "value": "class SetNeutralFeedbackToZero < ActiveRecord::Migration\n def self.up\n change_table :reputation_ratings do |t|\n t.change :neutral_feedback, :integer, :default => 0\n end\n peop...
ruby
chosen
[ { "from": "system", "value": "Apply fix editing gists in for admin controller\n" }, { "from": "human", "value": "class Admin::GistsController < ApplicationController\n layout 'admin/layout'\n\n def create\n @gist = Gist.create(gist_params[:gist])\n redirect_to admin_gists_path\n end\n\n...
ruby
chosen
[ { "from": "system", "value": "Allow admin to receive reply_to field\n" }, { "from": "human", "value": "module Admin\n class PostsController < AdminController\n def index\n render locals: {\n posts: Post.all\n }\n end\n\n def new\n post = Post.new\n post.build...
ruby
chosen
[ { "from": "system", "value": "Include user's id for paper_trail\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n require \"error_handler\"\n include ErrorHandler\n\n if Rails.application.secrets[:basic_auth_user] && Rails.application.secrets[:basic_aut...
ruby
chosen
[ { "from": "human", "value": "Add show Action for SalesPages Controller\n\nUpdate the SalesPages controller to include a show action.\n" }, { "from": "gpt", "value": "class SalesPagesController < ApplicationController\n def show\n @sales_page = SalesPage.find params[:id]\n @club = @s...
ruby
chosen
[ { "from": "system", "value": "Use erb, not erubis explicitly.\n" }, { "from": "human", "value": "require 'sinatra'\n\n# from https://gist.github.com/119874\n# stolen from http://github.com/cschneid/irclogger/blob/master/lib/partials.rb\n# and made a lot more robust by me\n# this implementation...
ruby
chosen
[ { "from": "system", "value": "Add requirement to generator source folder.\n" }, { "from": "human", "value": "require 'logging'\nrequire 'optparse'\nrequire 'raml_parser'\nrequire 'json'\n\nmodule RamlPoliglota\n module Support\n\n class SourceLoader\n\n def initialize\n @ignorabl...
ruby
chosen
[ { "from": "system", "value": "Fix PRERELEASE to match branch\n\nMSP-9881\n" }, { "from": "human", "value": "module Metasploit\n module Credential\n # Holds components of {VERSION} as defined by {http://semver.org/spec/v2.0.0.html semantic versioning v2.0.0}.\n module Version\n # The ...
ruby
chosen
[ { "from": "system", "value": "Revert \"Fix problem with autoload path resetting\"\n\nThis reverts commit 94f110167400016e4429e8506091c65b3a97db6f.\n" }, { "from": "human", "value": "require 'rails'\n\nclass MetasploitDataModels::Engine < Rails::Engine\n # @see http://viget.com/extend/rails-engi...
ruby
chosen
[ { "from": "system", "value": "Fix bug in if / else\n" }, { "from": "human", "value": "require 'pipeline/mounters/base_mounter'\n\nclass Pipeline::URLMounter < Pipeline::BaseMounter\n Pipeline::Mounters.add self\n \n def initialize trigger, options\n super(trigger)\n @options = options\n...
ruby
chosen
[ { "from": "system", "value": "Make empty? available on `Pushing::Base.deliveries`\n" }, { "from": "human", "value": "require 'active_support/core_ext/module/attribute_accessors'\n\nmodule Pushing\n module Adapters\n class TestAdapter\n class Deliveries\n include Enumerable\n\n ...
ruby
chosen
[ { "from": "system", "value": "Make sure to take into account the same availability checks for global functions\n" }, { "from": "human", "value": "module RbPlusPlus\n module Builders\n\n # Extension node.\n # There is only ever one of these in a project as this is\n # the top level node...
ruby
chosen
[ { "from": "system", "value": "Add lib/* to packaged files\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path('../lib', __FILE__)\n\nrequire 'kraken-io/version'\n\nGem::Specification.new do |s|\n s.name = 'kraken-io'\n s.version = Kraken::API::VERS...
ruby
chosen
[ { "from": "human", "value": "Add hour counter variable to product natures\n" }, { "from": "gpt", "value": "class AddHourCounterToProductCategories < ActiveRecord::Migration\n def up\n varieties = [:tractor,\n :heavy_equipment,\n :handling_equipment]\n\n pro...
ruby
chosen
[ { "from": "system", "value": "Update view helper. There was no need for them to call the param validation logic.\n" }, { "from": "human", "value": "module SortableColumns\n module ActionViewExtension\n extend ActiveSupport::Concern\n \n module InstanceMethods\n def sortable(column...
ruby
chosen
[ { "from": "system", "value": "Make actionpack-3.0.0.beta4 a standard dependency\n" }, { "from": "human", "value": "require File.expand_path('../lib/formatize/version', __FILE__)\n\nGem::Specification.new do |s|\n s.name = 'formatize'\n s.version = Formatize::VERSION\n\n s.author = 'David H...
ruby
chosen
[ { "from": "human", "value": "Add implementation of seventh rule of disambiguator prefix\n" }, { "from": "gpt", "value": "module Sastrawi\n module Morphology\n module Disambiguator\n class DisambiguatorPrefixRule7\n def disambiguate(word)\n contains = /^ter([bcdfghjklmnpq...
ruby
chosen
[ { "from": "system", "value": "Fix bug and actually iterate through the project members\n" }, { "from": "human", "value": "class ProjectMembersAdmins < ActiveRecord::Migration\n def self.up\n ProjectMember.all do |m|\n m.administrator = true\n m.save\n end\n end\n\n def self.do...
ruby
chosen
[ { "from": "system", "value": "Add upstream CMake bootstrap patch.\n" }, { "from": "human", "value": "require 'formula'\n\nclass Cmake <Formula\n url 'http://www.cmake.org/files/v2.8/cmake-2.8.3.tar.gz'\n md5 'a76a44b93acf5e3badda9de111385921'\n homepage 'http://www.cmake.org/'\n\n def instal...
ruby
chosen
[ { "from": "system", "value": "Change the version to 0.0.1\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'SLFlexibleButton'\n s.version = '0.1.0'\n s.summary = 'A button library which able to draw it self with bezel defined by relative locatio...
ruby
chosen
[ { "from": "system", "value": "Remove methods because it's not needed to generate json report and in old rspec 3.6.5 it fails due to lack of seed method\n" }, { "from": "human", "value": "RSpec::Support.require_rspec_core('formatters/json_formatter')\n\n# based on https://github.com/rspec/rspec-c...
ruby
chosen
[ { "from": "system", "value": "Fix -- [!] Usage of the `.swift_version` file has been deprecated! Please delete the file and use the `swift_versions` attribute within your podspec instead.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"RSBarcodes_Swift\"\n s.versio...
ruby
chosen
[ { "from": "system", "value": "Add more estates to the trial\n\nAdds North East, Yorkshire, Humberside, Kent and Sussex estates, except\nWealstun, Full Sutton, Lewes and Askham Grange.\n\nNeeds to be deployed by 30th of September.\n" }, { "from": "human", "value": "# The dashboard trial enforces ...
ruby
chosen
[ { "from": "system", "value": "Add fenced code blocks in markdown\n" }, { "from": "human", "value": "module ApplicationHelper\n\n def gravatar_image_url(email, size = 16)\n hash = Digest::MD5.hexdigest(email.strip.downcase)\n \"https://secure.gravatar.com/avatar/#{hash}?s=#{size}&d=identic...
ruby
chosen
[ { "from": "system", "value": "Fix field name so not overloading\n" }, { "from": "human", "value": "require_relative '../resource_property'\n\nmodule Convection\n module Model\n class Template\n class ResourceProperty\n # Represents an {http://docs.aws.amazon.com/AWSCloudFormation...
ruby
chosen
[ { "from": "system", "value": "Make sure collection is created with sharding by default\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe command('mongo testdb --quiet --host localhost --port 27017 --eval \"db.getCollection(\\'mycollection\\').stats()\"') do\n its(:stdout) { s...
ruby
chosen
[ { "from": "system", "value": "Increase Delayed::Worker.max_run_time to 20 minutes\n" }, { "from": "human", "value": "Delayed::Worker.sleep_delay = 5\nDelayed::Worker.max_attempts = 1\nDelayed::Worker.max_run_time = 10.minutes\n" }, { "from": "gpt", "value": "Delayed::Worker.sleep_del...
ruby
chosen
[ { "from": "system", "value": "Disable passive login attempt on dev for multiple controllers\n" }, { "from": "human", "value": "ApplicationController.class_eval do\n skip_before_filter :passive_login, if: -> { Rails.env.development? || Rails.env.test? }\nend\n" }, { "from": "gpt", "v...
ruby
chosen
[ { "from": "system", "value": "Use lib path actually linked into mongod executable\n" }, { "from": "human", "value": "require \"formula\"\n\nclass Tokumx < Formula\n homepage \"http://www.tokutek.com/products/tokumx-for-mongodb\"\n version \"1.5.0-boxen1\"\n conflicts_with \"mongodb\"\n url \...
ruby
chosen
[ { "from": "system", "value": "Use allowed slack team name.\n" }, { "from": "human", "value": "# == Schema Information\n#\n# Table name: services\n#\n# id :integer not null, primary key\n# type :string(255)\n# title :string(255)\n# project_id :integer not ...
ruby
chosen
[ { "from": "system", "value": "[Brightbox] Add ServerGroup attribute in CloudIP model\n" }, { "from": "human", "value": "require 'fog/core/model'\n\nmodule Fog\n module Compute\n class Brightbox\n\n class CloudIp < Fog::Model\n\n identity :id\n attribute :url\n attri...
ruby
chosen
[ { "from": "system", "value": "Set cucumber/webrat config to not open browser\n" }, { "from": "human", "value": "# Sets up the Rails environment for Cucumber\nENV[\"RAILS_ENV\"] = \"test\"\nrequire File.expand_path(File.dirname(__FILE__) + '/../../config/environment')\nrequire 'cucumber/rails/wor...
ruby
chosen
[ { "from": "system", "value": "Allow rackspace connections further up the chain\n" }, { "from": "human", "value": "require 'vcr'\nrequire 'webmock/cucumber'\n\nVCR.configure do |c|\n # Automatically filter all secure details that are stored in the environment\n ignore_env = %w(\n SHLVL RUNLE...
ruby
chosen
[ { "from": "system", "value": "Set fetched data into cache\n" }, { "from": "human", "value": "require \"ruboty/zoi/version\"\nrequire \"open-uri\"\nrequire \"json\"\n\nmodule Ruboty\n module Handlers\n class Zoi < Base\n\n ZOI_DATA_URI = \"http://zoi.herokuapp.com/js/services.js\"\n\n ...
ruby
chosen
[ { "from": "human", "value": "Create Ear class to dispatch receive event\n" }, { "from": "gpt", "value": "require \"util/string_ex\"\n\nmodule Slatan\n using StringEx\n\n class Ear\n def initialize(mouth)\n @concerns = []\n Dir[File.expand_path('../../../concerns', __FILE__) << '/*...
ruby
chosen
[ { "from": "system", "value": "Add UTF-8 encoding directive to gemspec\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"queue_classic\"\n s.email = \"ryan@heroku.com\"\n s.version = \"2.0.0\"\n s.date = \"2012-02-29\"\n s.descripti...
ruby
chosen
[ { "from": "system", "value": "Send uploaded images with inline disposition, and the rest with attachment\n" }, { "from": "human", "value": "class PaperclipDatabaseStorage::AttachmentsController < ApplicationController\n def get_attachment\n conditions = {}\n conditions[:attached_type] = p...
ruby
chosen
[ { "from": "system", "value": "Clean up gemspec a bit\n" }, { "from": "human", "value": "Gem::Specification.new do |gem|\n gem.authors = [\"Pedro Belo\"]\n gem.email = [\"pedro@heroku.com\"]\n gem.description = %q{OmniAuth strategy for Heroku.}\n gem.summary = %q{OmniAut...
ruby
chosen
[ { "from": "system", "value": "Update oauth2 gem to 1.4\n" }, { "from": "human", "value": "lib = File.expand_path(\"../lib\", __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire \"omniauth-oauth2/version\"\n\nGem::Specification.new do |gem|\n gem.add_dependency \"oauth2\"...
ruby
chosen
[ { "from": "system", "value": "Add the code to make previous spec commit pass\n" }, { "from": "human", "value": "require 'Cinderella/version'\nrequire 'Cinderella/data_store'\nrequire 'crimp'\n\nmodule Cinderella\n def self.transforms(data, till_midnight = 60)\n identifier = Crimp.signature(...
ruby
chosen
[ { "from": "system", "value": "Move STAR importers lists out of constant\n\n+ The thor task tries to load up SomervilleStarImporters, which then tries to load the constant\n+ But that fails because the Thor task doesn't automatically include the Rails environment\n" }, { "from": "human", "value":...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.6.1.0 to 0.6.1.1\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'evt-schema'\n s.summary = \"Primitives for schema and structure\"\n s.version = '0.6.1.0'\n s.description...
ruby
chosen
[ { "from": "system", "value": "Add date to coupons (event)\n" }, { "from": "human", "value": "require 'facilethings/base'\n\nmodule Facilethings\t\n\tclass CouponsData < Facilethings::Base\n\t\tattr_reader :user, :status, :coupon\n attr_accessor :currency, :income, :commission, :cleared\n\n ...
ruby
chosen
[ { "from": "system", "value": "Remove to_s since interpolation already does it implicitly\n" }, { "from": "human", "value": "module LightService\n class ExpectedKeysNotInContextError < StandardError; end\n class PromisedKeysNotInContextError < StandardError; end\n\n class ContextKeyVerifier\n ...
ruby
chosen
[ { "from": "system", "value": "Revert \"Use HTTPS in all connections\"\n" }, { "from": "human", "value": "require 'mechanize'\n\nmodule DMMCrawler\n BASE_URL = 'https://www.dmm.co.jp'.freeze\nend\n\nrequire 'dmm-crawler/agent'\nrequire 'dmm-crawler/attributes'\nrequire 'dmm-crawler/ranking'\nreq...
ruby
chosen
[ { "from": "system", "value": "Print debug info at the beginning of the /update process\n" }, { "from": "human", "value": "require 'sinatra/base'\nrequire 'hide'\n\nmodule Hide\n\n class Server < Sinatra::Base\n\n enable :logging, :show_exceptions\n\n configure :production, :development do...
ruby
chosen
[ { "from": "system", "value": "Allow ENV['HLB_XML_ENDPOINT'] to override URL\n" }, { "from": "human", "value": "require \"library_hlb/version\"\nrequire 'library_hlb/db'\nrequire 'httpclient'\nrequire 'stringio'\n\n\n\nmodule Library::HLB\n class IllegalLC < ArgumentError;end\n\n SOURCE_URL = '...
ruby
chosen
[ { "from": "system", "value": "Remove unused constant alias for `JoinBase`\n\n`JoinBase#active_record` no longer exist since Rails 4.0.\n\nSee https://github.com/rails/rails/pull/10151\n" }, { "from": "human", "value": "if defined?(::ActiveRecord)\n module Polyamorous\n InnerJoin = Arel::Node...
ruby
chosen
[ { "from": "system", "value": "Check against RbReadline been defined\n\nSince other projects might have readline.rb files loaded before.\nThat check was stupid. (I need to stop coding late at night)\n" }, { "from": "human", "value": "# Stub file to conform gem name (rb-readline)\n# It forces requ...
ruby
chosen