conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix specs for ruby 1.9." }, { "from": "human", "value": "require 'acceptance_helper'\n\nfeature 'Managing comments' do\n given(:user) { Fabricate(:confirmed_user) }\n given(:admin) { Fabricate(:admin) }\n given!(:comment) { Fabricate(:album_comment, user: us...
ruby
chosen
[ { "from": "human", "value": "Add missing tests to DataProcessor\n" }, { "from": "gpt", "value": "require 'spec_helper_lite'\nrequire 'processor/data_processor'\n\ndescribe Processor::DataProcessor do\n it \"should have a name equals to underscored class name\" do\n subject.name.should eq \"p...
ruby
chosen
[ { "from": "human", "value": "Add gSOAP formula, version 2.8.6\n\nCloses Homebrew/homebrew#6210.\n\nSigned-off-by: Mike McQuaid <a17fed27eaa842282862ff7c1b9c8395a26ac320@mikemcquaid.com>\n" }, { "from": "gpt", "value": "require 'formula'\n\nclass Gsoap < Formula\n url 'http://downloads.sourcefor...
ruby
chosen
[ { "from": "system", "value": "[hephaestus] Add indexer task to cli tasks\n" }, { "from": "human", "value": "require \"resque/tasks\"\nrequire 'ruby-progressbar'\nrequire 'active_support/all'\n\ntask \"resque:setup\" => :environment\n\ndef process(task)\n documents = Document.all\n pbar = Progr...
ruby
chosen
[ { "from": "system", "value": "Fix the spec name again\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'puppet_url_without_modules' do\n let(:msg) { 'puppet:// URL without modules/ found' }\n\n context 'puppet:// url with modules' do\n let(:code) { \"'puppet:///modules/f...
ruby
chosen
[ { "from": "system", "value": "Convert specs to RSpec 3.4.4 syntax with Transpec\n\nThis conversion is done by Transpec 3.2.1 with the following command:\n transpec\n\n* 1 conversion\n from: failure_message_for_should { }\n to: failure_message { }\n\n* 1 conversion\n from: failure_message_for_s...
ruby
chosen
[ { "from": "system", "value": "Package version increased from 0.4.1.1 to 0.5.0.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'messaging'\n s.version = '0.4.1.1'\n s.summary = 'Messaging primitives for Eventide'\n s.description = ' '\n...
ruby
chosen
[ { "from": "system", "value": "Increase the batch size of admin URL data migration.\n\nIncreasing from 50 to 1000 increases the transient\nmemory usage from 350MB to 550MB but decreases the\ntime per 1000 editions from 50s to 30s." }, { "from": "human", "value": "require \"policy_admin_url_replac...
ruby
chosen
[ { "from": "system", "value": "Use the updated_at value rather than the version to calculate the hash\n\nWhen using the preview api the revision field won't change unless the\nentry is republished. This meant that even if the data in the entries\nchanged the version hash would stay the same\n" }, { "...
ruby
chosen
[ { "from": "system", "value": "Fix for dependency installation failure.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\n\nGem::Specification.new do |spec|\n spec.name = \"lumidatum_c...
ruby
chosen
[ { "from": "system", "value": "Tweak the catch all routing spec.\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe 'catch all' do\n it 'GET /foo' do\n expect(get: '/foo').to route_to(\n controller: 'catch_all',\n acti...
ruby
chosen
[ { "from": "system", "value": "Test working generator with just card class and migration\n" }, { "from": "human", "value": "require 'rails/generators'\n\nmodule MTGExtractor\n class MTGExtractorGenerator < ::Rails::Generators::Base\n include Rails::Generators::Migration\n source_root File....
ruby
chosen
[ { "from": "system", "value": "Customize parameters on acceptance tests\n" }, { "from": "human", "value": "require 'spec_helper_acceptance'\n\ndescribe 'stns::server class' do\n let(:manifest) {\n <<-EOS\n include ::stns::server\n EOS\n }\n\n it \"should work without errors\" do\n ...
ruby
chosen
[ { "from": "system", "value": "Make relaying of events testable\n" }, { "from": "human", "value": "class SpecPerimeter < Kindergarten::Perimeter\n purpose :testing\n\n governess Kindergarten::StrictGoverness\n\n govern do\n can :view, String\n end\n\n subscribe :dining, :eat, :evented\n ...
ruby
chosen
[ { "from": "system", "value": "Disable environment override test on Puppet ~> 3.8.5\n\nBroken since PUP-5522 (puppetlabs/puppet@8136aff1), without a clear\nsolution.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'facts.acme.com' do\n context 'without an explicit environmen...
ruby
chosen
[ { "from": "human", "value": "Add test that release versions match URLs\n\nWe've hit problems where release URLs get updated, but the corresponding\nversion field doesn't. This adds a test to catch this early.\n" }, { "from": "gpt", "value": "require 'uri'\n\nRSpec.describe \"release versions\" d...
ruby
chosen
[ { "from": "system", "value": "Change from whitelisting to blacklisting interfaces. Exclude only loopback interface by default\n" }, { "from": "human", "value": "require \"server_metrics/system_info\"\n\nclass ServerMetrics::Network < ServerMetrics::MultiCollector\n\n def build_report\n if li...
ruby
chosen
[ { "from": "system", "value": "Make new file URLS default to main host and https" }, { "from": "human", "value": "require 'net/dav'\n\nmodule CarrierWave\n module Storage\n class Webdav < Abstract\n\n class File\n attr_reader :path\n def server_name\n ENV['WEBDAV_S...
ruby
chosen
[ { "from": "system", "value": "Fix error in gemspec with specifying Ruby version\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'private_address_check/version'\n\nGem::Specification.n...
ruby
chosen
[ { "from": "system", "value": "Implement tests for the behaviour\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Okapi do\n class TestClass\n attr_accessor :username\n\n def initialize(username, password)\n @username = username\n @password = password\n end...
ruby
chosen
[ { "from": "human", "value": "Add test for phenotype/variation recommendation\n" }, { "from": "gpt", "value": "RSpec.feature 'Phenotype recommendation' do\n let!(:user) { create(:user) }\n let!(:phenotype1) do\n create(:phenotype, characteristic: 'Eye count',\n descript...
ruby
chosen
[ { "from": "system", "value": "Raise when raw body nonsensical.\n" }, { "from": "human", "value": "module YACCL\n module Model\n class ObjectFactory\n def self.create(repository_id, raw)\n base_type_id = if raw[:properties]\n raw[:properties][:'cmis:baseTypeId'][:value]\n...
ruby
chosen
[ { "from": "system", "value": "Update User model password validations. Turn off has_secure_password validations to avoid repeat error for empty password field\n" }, { "from": "human", "value": "require 'bcrypt'\n\nclass User < ApplicationRecord\n validates :username, presence: { message: \"User...
ruby
chosen
[ { "from": "system", "value": "Fix DRb.start_service to use any available port\n\ngit-svn-id: ab86ecd26fe50a6a239cacb71380e346f71cee7d@58995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e\n" }, { "from": "human", "value": "require File.expand_path('../../../spec_helper', __FILE__)\nrequire File.expand_path...
ruby
chosen
[ { "from": "system", "value": "Include validations for name and email\n" }, { "from": "human", "value": "class User < ActiveRecord::Base\n\n has_secure_password\n\n has_many :comments\n has_many :votes\n\n\n\nend" }, { "from": "gpt", "value": "class User < ActiveRecord::Base\n\n h...
ruby
chosen
[ { "from": "system", "value": "Add validations to Vote model\n" }, { "from": "human", "value": "class Vote < ActiveRecord::Base\n belongs_to :user\n belongs_to :votable, polymorphic: true\nend\n" }, { "from": "gpt", "value": "class Vote < ActiveRecord::Base\n belongs_to :user\n be...
ruby
chosen
[ { "from": "system", "value": "Support RSpec expose_dsl_globally configuration option\n" }, { "from": "human", "value": "module Capybara\n module Features\n def self.included(base)\n base.instance_eval do\n alias :background :before\n alias :scenario :it\n alias :xsc...
ruby
chosen
[ { "from": "system", "value": "Stop running yard:generate unless Yard is defined\n" }, { "from": "human", "value": "Capistrano::Configuration.instance(:must_exist).load do\n\n after 'deploy:create_symlink', 'yard:generate'\n\n namespace :yard do\n\n desc \"Update the documentation alone befo...
ruby
chosen
[ { "from": "system", "value": "Replace any non-word in parameters for Wikia\n" }, { "from": "human", "value": "module Lyricfy\n class Wikia < Lyricfy::LyricProvider\n include URIHelper\n\n def initialize(parameters)\n super(parameters)\n self.base_url = \"http://lyrics.wikia.com/...
ruby
chosen
[ { "from": "system", "value": "[BUGFIX] Use existing full_length instance var\n" }, { "from": "human", "value": "require 'ws_light/set/color_set'\n\nmodule WSLight\n module Set\n # Creates a set with all random colors\n class RandomSet < ColorSet\n def frame\n @set ||= generate...
ruby
chosen
[ { "from": "human", "value": "Add an example to show how to customize vagrant prompt\n" }, { "from": "gpt", "value": "Vagrant.configure('2') do |config|\n\n # Use %q to avoid nested here-doc issue with vim-ruby syntax highlighting.\n config.vm.provision :shell, :inline => %q!\ncat <<BASHRC > /h...
ruby
chosen
[ { "from": "system", "value": "Write test for user searching Overheards\n\nFirst things first, we write a test. Here we're expecting the page to\nhave:\n\n1. Have an input field labeled `Search`\n2. A button labeled `Search Overheards`\n\nOnce the `Search Overheards` button is clicked; we're expecting to\n*o...
ruby
chosen
[ { "from": "system", "value": "[promo] Remove excessive respond_with usage in CheckoutControllerDecorator\n" }, { "from": "human", "value": "Spree::CheckoutController.class_eval do\n\n #TODO 90% of this method is duplicated code. DRY\n def update\n if @order.update_attributes(object_params)\...
ruby
chosen
[ { "from": "system", "value": "Test inherited class on integration spec\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'support/db'\n\nclass Post < ShardHandler::Model\nend\n\ndescribe ShardHandler do\n before(:all) do\n Db.setup\n\n Db.connect_to_shard('shard1')\n si...
ruby
chosen
[ { "from": "system", "value": "Adjust steps to run on JRuby\n" }, { "from": "human", "value": "require 'open3'\n\n#\nmodule CLISteps\n def _execute(exec)\n Dir.chdir(@__root) do\n Bundler.with_clean_env do\n Open3.popen2e(exec) do |_, stdout_err, wait_thr|\n exit_status =...
ruby
chosen
[ { "from": "system", "value": "Move --prod so that command is the last argument" }, { "from": "human", "value": "node[:deploy].each do |app_name, deploy|\n if platform?(\"ubuntu\")\n user = \"www-data\"\n elsif platform?(\"amazon\")\n user = \"apache\"\n end\n\n if node[...
ruby
chosen
[ { "from": "system", "value": "Add bugfix is \"patch\" level detection\n" }, { "from": "human", "value": "class Commit\n extend Forwardable\n def_delegators :@hash, :[]\n\n def initialize(hash)\n @hash = hash\n end\n\n def major?\n !!(self[:subject] =~ /breaking/i)\n end\n\n def patc...
ruby
chosen
[ { "from": "system", "value": "Fix helper inclusion for Rails 5\n\nCalling the `helper` method after upgrading to Rails 5 resulted in the\nfollowing error:\n\nundefined method 'helper' for ActionController::API:Class\n\nThis commit follows the lead of the following commit on another project:\nhttps://github....
ruby
chosen
[ { "from": "system", "value": "Return nil if field was not provided\n" }, { "from": "human", "value": "module MdiCloudDecoder \n class Track \n attr_reader :id,\n :asset,\n :location_provided,\n :latitude,\n :longitude,\n :received_at,\n :recorded_at,\n ...
ruby
chosen
[ { "from": "system", "value": "Revert \"Removed `expect_its` and `expect_its!` methods.\"\n\nThis reverts commit b38c6267c348d5643f8004ffac5478064edb70cc.\n" }, { "from": "human", "value": "module RSpec\n module ExpectIt\n module Helpers\n def expect_it\n if block_given?\n ...
ruby
chosen
[ { "from": "system", "value": "Create list of assigned Bambinos." }, { "from": "human", "value": "module SecretBambino\n class Bambinos\n def init(filename)\n load_from_yaml(filename)\n end\n\n private\n\n def load_from_yaml(filename)\n data = YAML::load(File.open(filename)...
ruby
chosen
[ { "from": "system", "value": "10398: Make create_admin task set pref_lang\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nnamespace :db do\n desc \"Create an admin user.\"\n task :create_admin, [:password] => :environment do |_t, args|\n u = User.new(login: \"admin\", na...
ruby
chosen
[ { "from": "system", "value": "Add rake task to launch tests\n" }, { "from": "human", "value": "namespace :redmine_jenkins do\n\n desc \"Show library version\"\n task :version do\n puts \"Redmine Jenkins #{version(\"plugins/redmine_jenkins/init.rb\")}\"\n end\n\n\n desc \"Start unit tests\...
ruby
chosen
[ { "from": "system", "value": "Update survey link to Mk 2 survey" }, { "from": "human", "value": "module SurveyHelper\n def survey_url\n 'https://forms.gle/MXbpmLTPdJnVLDdc8'\n end\nend\n" }, { "from": "gpt", "value": "module SurveyHelper\n def survey_url\n 'https://forms.gle...
ruby
chosen
[ { "from": "system", "value": "Use sudo to restart passenger\n" }, { "from": "human", "value": "# frozen_string_literal: true\n# config valid only for current version of Capistrano\nlock '~> 3.14'\n\nset :application, 'fleetfocus-api'\nset :repo_url, 'https://github.com/umts/fleetfocus-api.git'\n...
ruby
chosen
[ { "from": "system", "value": "Add missing column in default scope.\n" }, { "from": "human", "value": "class BenchmarkType < ActiveRecord::Base\n default_scope { order(\"#{self.table_name} ASC\") }\n\n has_many :benchmark_runs, dependent: :destroy\n belongs_to :repo\n\n validates :category, p...
ruby
chosen
[ { "from": "system", "value": "Fix the file differ to handle long outputs.\n" }, { "from": "human", "value": "class DiffOutputs\n def initialize filename1, filename2\n @filename1 = filename1\n @filename2 = filename2\n end\n\n def call\n line_counter = 0\n\n File.readlines(filename1...
ruby
chosen
[ { "from": "system", "value": "Add redirect from /albums to root\n" }, { "from": "human", "value": "require 'sidekiq/web'\n\nPhotoAlbum::Application.routes.draw do\n root 'albums#index'\n\n get \"/auth/:provider/callback\" => \"sessions#create\"\n delete \"/signout\" => \"sessions#destroy\", :...
ruby
chosen
[ { "from": "system", "value": "Fix DEPRECATION WARNING: ActionController::Routing::Routes is deprecated.\n" }, { "from": "human", "value": "ActionController::Routing::Routes.draw do |map|\n\n map.namespace(:admin_data) do |admin_data|\n \n admin_data.with_options :controller => 'main' do |...
ruby
chosen
[ { "from": "system", "value": "Fix filenames for README & CHANGELOG in the gemspec.\n" }, { "from": "human", "value": "require './lib/breakpoint'\n\nGem::Specification.new do |s|\n # Release Specific Information\n s.version = Breakpoint::VERSION\n s.date = Breakpoint::DATE\n\n # Gem Details\n...
ruby
chosen
[ { "from": "system", "value": "Change root based on if user_signed_in?\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n devise_for :users\n get 'w_elcome/index'\n\nroot 'w_elcome#index'\n\nresources :notes\n \nend\n" }, { "from": "gpt", "value": "Rails.applicat...
ruby
chosen
[ { "from": "system", "value": "Update project url for dot names.\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n # BACKEND\n devise_for :admin_users, ActiveAdmin::Devise.config\n ActiveAdmin.routes(self)\n\n # FRONTEND\n root to: \"dashboards#show\"\n resource :dashboa...
ruby
chosen
[ { "from": "system", "value": "Add runtime dependency hashie to 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 'bank_job/version'\n\nGem::Specification.new do |spec|\n spec.n...
ruby
chosen
[ { "from": "system", "value": "Rename method argument for clarification\n" }, { "from": "human", "value": "module Braingasm\n module Options\n @options = {}\n @defaults = {\n eof: 0\n }.freeze\n\n def self.[](option)\n return @options[option] if @options.has_key?(option)\n ...
ruby
chosen
[ { "from": "human", "value": "Add commands to deal with different podding installations\n" }, { "from": "gpt", "value": "# encoding: utf-8\n\n# Commands that deal with the settings file\n\nclass PoddingCLI < Thor\n desc \"use NAME\", \"use project NAME to execute commands in (a project is one po...
ruby
chosen
[ { "from": "human", "value": "Add RSpec helper with initial configuration for filtering VCR sensitive data, expectation syntax, load paths, etc.\n" }, { "from": "gpt", "value": "$:.unshift File.expand_path('..', __FILE__)\n$:.unshift File.expand_path('../../lib', __FILE__)\nrequire 'coveralls'\nC...
ruby
chosen
[ { "from": "system", "value": "Use localhost redis for specs\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\nENV[\"RELIABLE_TIMEOUT\"] = \"1\"\nENV[\"RELIABLE_TIME_TRAVEL_DELAY\"] = \"1\"\nrequire 'reliable'\n\nRSpec.configure do |config|\n redis = ...
ruby
chosen
[ { "from": "system", "value": "Load simplecov only if environment variable is present\n" }, { "from": "human", "value": "# This file was generated by the `rspec --init` command. Conventionally, all\n# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.\n# Require this file ...
ruby
chosen
[ { "from": "system", "value": "Call DataMapper.finalize after model definition\n" }, { "from": "human", "value": "require 'dm-core/spec/setup'\nrequire 'dm-core/spec/lib/adapter_helpers'\n\nrequire 'dm-is-list'\nrequire 'dm-migrations'\n\nDataMapper::Spec.setup\n\nclass User\n include DataMapper...
ruby
chosen
[ { "from": "system", "value": "Include Lita::RSpec to for the Redis test isolation.\n" }, { "from": "human", "value": "require \"simplecov\"\nrequire \"coveralls\"\nSimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[\n SimpleCov::Formatter::HTMLFormatter,\n Coveralls::SimpleCov::Formatt...
ruby
chosen
[ { "from": "system", "value": "Call sign_out! *before* each spec, so that current_user is always set no matter what\n" }, { "from": "human", "value": "# Configure Rails Envinronment\nENV[\"RAILS_ENV\"] = \"test\"\nrequire File.expand_path(\"../dummy/config/environment.rb\", __FILE__)\n\nrequire ...
ruby
chosen
[ { "from": "system", "value": "Add a proper spec helper for using Capybara+Rails\n" }, { "from": "human", "value": "ENV[\"RAILS_ENV\"] = \"test\"\n\n$:.unshift File.dirname(__FILE__)\nrequire \"rails_app/config/environment\"\n" }, { "from": "gpt", "value": "ENV[\"RAILS_ENV\"] = \"test...
ruby
chosen
[ { "from": "human", "value": "Add graceful shutdown check that assists in client cleanup\n" }, { "from": "gpt", "value": "#! /usr/bin/env ruby\n#\n# Graceful Shutdown Monitor\n# ===\n#\n# DESCRIPTION:\n# This check is responsible for removing clients from Sensu who have\n# graceful shutdown s...
ruby
chosen
[ { "from": "system", "value": "Sort the list of statuses by LCD\n\nGoal is to fix the weird order the statuses are showing up in production. This\nis probably because the order of the list returned by PostgreSQL is different\nthan SQLite.\n" }, { "from": "human", "value": "class Clock < ActiveRec...
ruby
chosen
[ { "from": "system", "value": "Add a step to edit a lockfile\n" }, { "from": "human", "value": "Given 'a lockfile with:' do |content|\n steps %Q{\n Given a file named \"#{'.'.to_lockfile_path}\" with:\n \"\"\"\n #{expand(content)}\n \"\"\"\n }\nend\n\nGiven 'I copy a new lockf...
ruby
chosen
[ { "from": "system", "value": "Update rubocop requirement from ~> 1.10.0 to ~> 1.13.0\n\nUpdates the requirements on [rubocop](https://github.com/rubocop/rubocop) to permit the latest version.\n- [Release notes](https://github.com/rubocop/rubocop/releases)\n- [Changelog](https://github.com/rubocop/rubocop/bl...
ruby
chosen
[ { "from": "system", "value": "Use an ordered has for parameters\n" }, { "from": "human", "value": "module Buildr\n module OSGi\n class Container\n attr_reader :runtime\n\n def initialize(runtime)\n @runtime = runtime\n @parameters = {}\n end\n\n def []=(key,...
ruby
chosen
[ { "from": "human", "value": "Add US tests for completeness\n" }, { "from": "gpt", "value": "require File.expand_path(File.dirname(__FILE__) + '/../test_helper')\n\n## United States\nclass USTest < Test::Unit::TestCase\n \n def test_local\n parse_test('+1 555 123 4567', '1', '555', '1234567'...
ruby
chosen
[ { "from": "system", "value": "Update gc_ruboconfig requirement from ~> 3.1.0 to ~> 3.2.0\n\nUpdates the requirements on [gc_ruboconfig](https://github.com/gocardless/ruboconfig) to permit the latest version.\n- [Release notes](https://github.com/gocardless/ruboconfig/releases)\n- [Changelog](https://github....
ruby
chosen
[ { "from": "system", "value": "Remove the need to define component_types twice (autocreate list)\n" }, { "from": "human", "value": "module SinatraMore\n module ConfiguredComponents\n def self.included(base)\n # base.include(ClassMethods)\n base.extend(ClassMethods)\n end\n\n A...
ruby
chosen
[ { "from": "system", "value": "Set location and status on json response\n" }, { "from": "human", "value": "class FilesController < ApplicationController\n respond_to :html, :json\n\n def index\n #thumbnails 260x180 looks good\n @selected_tags = params[\"tags\"].blank? ? [] : params[\"tags...
ruby
chosen
[ { "from": "system", "value": "Remove event_type attribute causing AMS to fail\n" }, { "from": "human", "value": "class EventSerializer < ActiveModel::Serializer\n attributes :id, :title, :event_type, :start_time, :end_time, :start_date, :end_date, :description, :address, :skills_needed, :minimu...
ruby
chosen
[ { "from": "system", "value": "Add a `links` object to place representation\n" }, { "from": "human", "value": "class PlaceSerializer < ActiveModel::Serializer\n attributes :id, :name, :created_at\n\n belongs_to :category\n\n def id\n object.external_id\n end\nend\n" }, { "from": "g...
ruby
chosen
[ { "from": "system", "value": "Fix select input name concatenation\n\nDo not modify the source string when appending '_in' or '_eq' to\nsearchable_method_name otherwise it gets appended at each call.\n\nExample: `payment_type_code_eq_eq_eq_eq_eq_eq_eq_eq_eq_eq`\n\nFixes #4121.\n" }, { "from": "human"...
ruby
chosen
[ { "from": "system", "value": "Use the subject instead of making a new instance.\n\nThis allows the subject to be configured ahead of time for validations\nthat rely on other attribute values within the instance.\n" }, { "from": "human", "value": "RSpec::Matchers.define(:allow_values_for) do |*at...
ruby
chosen
[ { "from": "system", "value": "Add receipt_email so users can get automatic receipts for payments from Stripe\n" }, { "from": "human", "value": "class PaymentsController < ApplicationController\n protect_from_forgery\n\n def new\n @user = current_user\n @amount = params[:amount].gsub(/,/,...
ruby
chosen
[ { "from": "system", "value": ":boom: Switch redirect path between twitter and github when login\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n\n def create\n auth = request.env['omniauth.auth']\n user = User.create_auth(auth)\n session[:user_id] =...
ruby
chosen
[ { "from": "system", "value": "Introduce param for time in milliseconds\n" }, { "from": "human", "value": "# Controller used for simple tracking with GET requests\n\nclass TrackingController < ApplicationController\n before_filter :authenticate_with_token\n before_filter :find_track\n\n def tr...
ruby
chosen
[ { "from": "system", "value": "Clean up formula a bit, add comments\n" }, { "from": "human", "value": "require 'formula'\n\nclass Haxby < Formula\n homepage 'https://github.com/tabletcorry/haxby'\n head \"git://github.com/tabletcorry/haxby.git\"\n\n depends_on 'coreutils'\n\n def inst...
ruby
chosen
[ { "from": "system", "value": "Fix bug with published related policies.\n\nMapping to #latest_edition then filtering by\npublished will get you false negatives if the\npolicy has a newer unpublished edition." }, { "from": "human", "value": "module Edition::RelatedPolicies\n extend ActiveSupport:...
ruby
chosen
[ { "from": "human", "value": "Add specs to customer builder\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Vend::CustomerBuilder do\n let(:customer_with_id) { {\n 'id' => 'a123771197',\n 'firstname' => 'Brian XX',\n 'lastname' => 'Smith',\n 'email'...
ruby
chosen
[ { "from": "human", "value": "Add feature test for profile edit\n" }, { "from": "gpt", "value": "require File.expand_path('../../spec_helper', __FILE__)\n\nfeature 'profile settings' do\n given(:expected_flash) {\n I18n.t('flash.profile.updated')\n }\n\n background do\n sign_in\n end\n\...
ruby
chosen
[ { "from": "system", "value": "Update DBeaver community to v3.1.5\n" }, { "from": "human", "value": "cask :v1 => 'dbeaver-community' do\n version '3.1.4'\n\n if Hardware::CPU.is_32_bit?\n sha256 '017ef0d2aa6236685cfdec4988e05e0926a156db3cc46c48e09f11879b62402c'\n url \"http://dbeaver.jkis...
ruby
chosen
[ { "from": "system", "value": "Check archive more specifically in request spec\n" }, { "from": "human", "value": "require 'spec_helper'\ndescribe \"archive\" do\n before(:each) do\n Factory(:post, title: \"post X\")\n end\n\n it \"lists archived posts\" do\n visit \"/monologue\"\n wit...
ruby
chosen
[ { "from": "system", "value": "Update Plex Media Player to 2.19.1.904-f679df4f\n" }, { "from": "human", "value": "cask 'plex-media-player' do\n version '2.19.0.902-42a9f589'\n sha256 'b3f9e114586c84a665a5e2a87dab5495b4a6af5a4c7fd6230d66115f0b641268'\n\n url \"https://downloads.plex.tv/plexmedi...
ruby
chosen
[ { "from": "system", "value": "Update rubocop requirement from ~> 1.13.0 to ~> 1.14.0\n\nUpdates the requirements on [rubocop](https://github.com/rubocop/rubocop) to permit the latest version.\n- [Release notes](https://github.com/rubocop/rubocop/releases)\n- [Changelog](https://github.com/rubocop/rubocop/bl...
ruby
chosen
[ { "from": "system", "value": "Add file reading in export functions script.\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\nrequire 'optparse'\nrequire 'pathname'\n\ndef parseOptions\n\toptions = {:void => 'void', :float => 'float', :c_string => 'const char*'}\n\tOptionParser.new do |op...
ruby
chosen
[ { "from": "human", "value": "Add script which will easily traverse s3 tree.\n" }, { "from": "gpt", "value": "require \"rubygems\"\nrequire \"aws-sdk\"\nrequire \"RMagick\"\n\ndef s3\n\t@s3 = @s3 || AWS::S3.new(\n\t\t:access_key_id => ENV[\"S3_ACCESS_KEY_ID\"],\n\t\t:secret_access_key => ENV[...
ruby
chosen
[ { "from": "system", "value": "Fix private methods on terminal width calculator\n" }, { "from": "human", "value": "module TerminalWidthCalculator\n def self.calculate\n default_width = 80\n\n term_width = calculate_term_width\n\n term_width > 0 ? term_width : default_width\n end\n\n p...
ruby
chosen
[ { "from": "system", "value": "Align argument description following gem rdoc\n" }, { "from": "human", "value": "require 'rubygems/package'\nrequire 'rubygems/command'\nrequire 'yard'\n\nclass Gem::Commands::YardocCommand < Gem::Command\n VERSION = '0.0.1'\n\n def initialize\n super 'yardoc',...
ruby
chosen
[ { "from": "system", "value": "Adjust routing logic for about and home\n" }, { "from": "human", "value": "require 'roda'\n\n# Basic routing tree logic to render the index.erb template\nclass App < Roda\n plugin :render\n\n route do |r|\n r.root do\n view(:index)\n end\n\n r.get('/...
ruby
chosen
[ { "from": "system", "value": "Add view test for init invitation\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe 'projects/new', type: :view do\n before(:each) do\n @chair = FactoryGirl.create(:chair)\n @user = FactoryGirl.create(:user)\n @wimi_user = Factory...
ruby
chosen
[ { "from": "system", "value": "Fix to work rake test\n" }, { "from": "human", "value": "require \"pebbles-soreyuke\"\n#require \"taem_c_kadai\"\nrequire \"taem_c_kadai/fumin\"\nrequire \"taem_c_kadai/needed_calorie\"\nrequire \"readline\"\n\nmodule TaemCKadai\n greeting = '不眠に悩んでいるのか体型に悩んでいるのか教え...
ruby
chosen
[ { "from": "system", "value": "Fix N+1 queries on individual form request\n" }, { "from": "human", "value": "json.extract! form, :id, :name, :description, :created_at, :updated_at, :questions, \\\n :version_independent_id, :version, :all_versions, :most_recent, :parent, \\\n ...
ruby
chosen
[ { "from": "system", "value": "Set branch and application folder\n" }, { "from": "human", "value": "lock '3.1.0'\nset :application, 'whatsmydistrict'\nset :repo_url, 'https://github.com/openlexington/WhatsMyDistrict.git'\nset :linked_dirs, %w{log tmp/pids tmp/sockets}\nset :linked_files, %w{model...
ruby
chosen
[ { "from": "system", "value": "Remove warning of undefined instance variable\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule ActiveStorage\n class Previewer::MuPDFPreviewer < Previewer\n class << self\n def accept?(blob)\n blob.content_type == \"applicat...
ruby
chosen
[ { "from": "system", "value": "Add new route to access all items\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html\nend\n" }, { "from": "gpt", "value": "Rails.appli...
ruby
chosen
[ { "from": "system", "value": "Update Routes for Club change_logo/upload_logo\n\nUpdate the routes file to include change_logo and upload_logo routes for\nthe Club model.\n" }, { "from": "human", "value": "Ifsimply::Application.routes.draw do\n devise_for :users, :controllers => { :registrations...
ruby
chosen
[ { "from": "system", "value": "Use a scope declaration to disallow the format variant\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n scope format: false do |r|\n put \"/draft-content(/*base_path)\", to: \"content_items#put_draft_content_item\"\n put \"/content(/*base...
ruby
chosen
[ { "from": "system", "value": "Fix Spree initializer for backward compability\n" }, { "from": "human", "value": "# Configure Spree Preferences\n#\n# Note: Initializing preferences available within the Admin will overwrite any changes that were made through the user interface when you restart.\n# ...
ruby
chosen