conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Add rspec for BitBucket::Request::OAuth middleware\n" }, { "from": "gpt", "value": "require 'spec_helper'\nrequire 'rack/test'\n\ndescribe BitBucket::Request::OAuth do\n include Rack::Test::Methods\n\n\n let(:app) { ->(env) { [200, env, \"app\"] } }\n\n let (:midd...
ruby
chosen
[ { "from": "human", "value": "Add missing spec of shell/directories module\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe ElectricSheep::Shell::Directories do\n DirectoriesKlazz = Class.new do\n include ElectricSheep::Shell::Directories\n \n attr_reader :cmd, :host, ...
ruby
chosen
[ { "from": "system", "value": "Fix name in the describe block of Dir.exists?.\n" }, { "from": "human", "value": "require File.expand_path('../../../spec_helper', __FILE__)\nrequire File.expand_path('../fixtures/common', __FILE__)\nrequire File.expand_path('../shared/exist', __FILE__)\n\ndescribe ...
ruby
chosen
[ { "from": "human", "value": "Add tests for the specs generator\n" }, { "from": "gpt", "value": "require \"spec_helper\"\nrequire \"generators/clearance/specs/specs_generator\"\n\ndescribe Clearance::Generators::SpecsGenerator, :generator do\n it \"copies specs to host app\" do\n run_generato...
ruby
chosen
[ { "from": "system", "value": "Replace URL with unescaped version.\n" }, { "from": "human", "value": "# encoding: utf-8\nrequire 'test_helper'\nrequire 'cgi'\nrequire 'uri'\n\nclass OauthUtilTest < Test::Unit::TestCase\n def test_query_string_escapes_single_quote\n base_url = \"http://example...
ruby
chosen
[ { "from": "human", "value": "Add a tool to add framework automatically to a project.\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\n\n# Copyright 2019 Google\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the ...
ruby
chosen
[ { "from": "system", "value": "Initialize translator instance in setup hook.\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass Chelsy::TranslatorTest < Minitest::Test\n include Chelsy\n\n def test_integer\n translator = Translator.new\n\n i = Constant::Int.new(1)\n asse...
ruby
chosen
[ { "from": "system", "value": "Add support for activesupport > 3\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'attr_enum_accessor/version'\n\nGem::Specification.new do |spec|\n spe...
ruby
chosen
[ { "from": "human", "value": "Add data migration to convert NewsArticles\n\nThe NewsArticleType Unknown is a legacy concept. These are NewsArticles that were never categorised into one of the other NewsArticleTypes. These are surfaced on the frontend via the [Announcements page](www.gov.uk/government/announc...
ruby
chosen
[ { "from": "human", "value": "Rename all forbidden paths again\n" }, { "from": "gpt", "value": "# See http://doc.gitlab.com/ce/development/migration_style_guide.html\n# for more information on how to write migrations for GitLab.\n\nclass RenameAllReservedPathsAgain < ActiveRecord::Migration\n in...
ruby
chosen
[ { "from": "system", "value": "Fix indentation and change inner matcher\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Projects::GraphsController do\n let(:project) { create(:project) }\n let(:user) { create(:user) }\n\n before do\n sign_in(user)\n project.team <...
ruby
chosen
[ { "from": "system", "value": "Remove article test for unapproved_edits\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe Article do\n\t# let(:article_one) = Article.create()\n\t# it 'has a valid factory' do\n\t# \texpect(build(:article)).to be_valid\n\t# end\n\n\t# let(:ruby)...
ruby
chosen
[ { "from": "human", "value": "Test for files created by lx_boot_zone_ubuntu.ksh\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\n# Testing for override files created by lx_boot\n\n# See https://github.com/joyent/illumos-joyent/blob/master/usr/src/lib/brand/lx/zone/lx_boot_zone_ubuntu.ksh...
ruby
chosen
[ { "from": "system", "value": "Use Stitch Fix open source email\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"extra_extra/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |s|\...
ruby
chosen
[ { "from": "system", "value": "Add rake to dev dependencies so travis will work\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"bencodr/version\"\n\nGem::Specification.new do |s|\n s.name = \"bencodr\"\n s.version ...
ruby
chosen
[ { "from": "system", "value": "Remove puppet and fpm from development dependencies.\n\nThey are already in runtime dependencies.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"fpm/cookery/version\"\n\nGem::Specification.new ...
ruby
chosen
[ { "from": "system", "value": "Remove Instabug as a framework from the podspec\n" }, { "from": "human", "value": "require \"json\"\n\njson = File.read(File.join(__dir__, \"package.json\"))\npackage = JSON.parse(json).deep_symbolize_keys\n\nPod::Spec.new do |s|\n s.name = package[:name]\n s.vers...
ruby
chosen
[ { "from": "system", "value": "Add missing gem dependency for rack.\n\nGollum depends on sinatra which depends on rack ~> 1.4.\nThe latest version 1 of rack is 1.6.5 so we stick to 1.6.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unsh...
ruby
chosen
[ { "from": "system", "value": "Remove rubyforge link from gemspec\n\nRubyforge is sunsetted, see: https://twitter.com/evanphx/status/399552820380053505\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"api-versions/version\"\n\...
ruby
chosen
[ { "from": "system", "value": "Move DEFAULT_FIELDS out of class << self\n" }, { "from": "human", "value": "module ICIMS\n\n require 'ostruct'\n\n class Job < OpenStruct\n\n class << self\n\n DEFAULT_FIELDS = %w(id folder jobtitle positioncategory positiontype joblocation additionallocat...
ruby
chosen
[ { "from": "system", "value": "Add followers query method for Tag model\n" }, { "from": "human", "value": "class Tag < ActiveRecord::Base\n has_many :taggings, dependent: :destroy\n has_many :posts, through: :taggings\nend\n" }, { "from": "gpt", "value": "class Tag < ActiveRecord::B...
ruby
chosen
[ { "from": "human", "value": "Add binary search in ruby\n" }, { "from": "gpt", "value": "def binary_search(array, num)\n\tlow = 0\n\thigh = array.size - 1\n\n\twhile low <= high\n\t\tmid = (low + high) / 2\n\n\t\tif (array[mid] == num)\n\t\t\treturn true\n\t\telsif array[mid] < num\n\t\t\tlow = m...
ruby
chosen
[ { "from": "system", "value": "Add minimal documentation in GetFederationToken request\n" }, { "from": "human", "value": "module Fog\n module AWS\n class STS\n class Real\n\n require 'fog/aws/parsers/sts/get_session_token'\n\n def get_federation_token(name, policy, duration...
ruby
chosen
[ { "from": "human", "value": "Create spec for Institution.top scope\n" }, { "from": "gpt", "value": "require \"rails_helper\"\n\ndescribe Institution do\n describe \".top\" do\n let(:petition){ FactoryGirl.create(:local_organizing_petition) }\n\n let(:high_rank){ petition.action_page.insti...
ruby
chosen
[ { "from": "system", "value": "Update to new rspec-support library-wide checks.\n" }, { "from": "human", "value": "require 'rspec/support/spec/prevent_load_time_warnings'\n\nRSpec.describe \"RSpec::Expectations\" do\n it_behaves_like 'a library that issues no warnings when loaded', 'rspec-expect...
ruby
chosen
[ { "from": "system", "value": "Fix spelling in HtmlExample spec" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nrequire 'spec_helper'\n\ndescribe RspecApiDocumentation::Views::HtmlExample do\n let(:metadata) { { :resource_name => \"Orders\" } }\n let(:group) { RSpec::Core::ExampleGrou...
ruby
chosen
[ { "from": "system", "value": "Add the source_file method so that we don't break the sitemap area. /__middleman/sitemap/\n" }, { "from": "human", "value": "module Middleman\n module Sitemap\n class AliasResource < ::Middleman::Sitemap::Resource\n \n attr_accessor :output\n\n de...
ruby
chosen
[ { "from": "system", "value": "Remove funding round specific properties from Relation\n" }, { "from": "human", "value": "module Crunchbase\n\n class Relation\n\n attr_reader :type\n attr_reader :name\n attr_reader :path\n attr_reader :created_at\n attr_reader :updated_at\n attr...
ruby
chosen
[ { "from": "human", "value": "Add specs for the deprecated Data class\n" }, { "from": "gpt", "value": "require_relative '../../spec_helper'\n\ndescribe \"Data\" do\n it \"is a subclass of Object\" do\n suppress_warning do\n Data.superclass.should == Object\n end\n end\n\n ruby_versi...
ruby
chosen
[ { "from": "system", "value": "Support for rails 4 protected_attributes gem\n" }, { "from": "human", "value": "require \"priceable/version\"\n\nmodule Priceable\n SUFFIXES = [\"_in_cents\", \"_in_pennies\", \"_as_integer\"]\n def priceable(*price_fields)\n price_fields.each do |price_field|\...
ruby
chosen
[ { "from": "system", "value": "Include collection name into metrics name\n" }, { "from": "human", "value": "DependencyDetection.defer do\n @name = :moped\n\n depends_on do\n defined?(::Moped) and not NewRelic::Control.instance['disable_moped']\n end\n\n executes do\n NewRelic::Agent.log...
ruby
chosen
[ { "from": "system", "value": "Use `ActiveSupport.on_load` to extend ActionController and ActionView.\n\nhttp://api.rubyonrails.org/classes/ActiveSupport/LazyLoadHooks.html\nhttps://github.com/rails/rails/blob/92703a9ea5d8b96f30e0b706b801c9185ef14f0e/actionpack/lib/action_controller/base.rb#L264\nhttps://git...
ruby
chosen
[ { "from": "system", "value": "Fix method name cannot be setting's key\n" }, { "from": "human", "value": "module RailsSettings\n class CachedSettings < Settings\n after_commit :rewrite_cache, on: %i(create update)\n def rewrite_cache\n Rails.cache.write(\"rails_settings_cached:#{var}\...
ruby
chosen
[ { "from": "system", "value": "Remove the 'it' so 'it' can be placed higher up to catch interrupts\n" }, { "from": "human", "value": "def check_all_columns(instance)\n instance.class.columns.each do |column|\n it \"has data in #{column.name} column\" do\n instance.send(:\"#{column.name}\...
ruby
chosen
[ { "from": "system", "value": "Update the Ability Model for Club :read\n\nUpdate the Ability model to handle restricting Club show actions based\non whether the member is currently a member of the Club.\n" }, { "from": "human", "value": "class Ability\n include CanCan::Ability\n\n def initializ...
ruby
chosen
[ { "from": "system", "value": "Implement JSON logging for Patron\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nif defined?(Patron)\n module Patron\n class Session\n alias orig_request request\n def request(action_name, url, headers, options = {})\n log_e...
ruby
chosen
[ { "from": "system", "value": "Test for Heroku, unconditionally enabled Google Analytics\n" }, { "from": "human", "value": "require 'bundler/setup'\nBundler.require(:default, (ENV['RACK_ENV'] || 'development').to_sym)\n\n# Models\nrequire './models.rb'\n\n# Rack configuration\nconfigure do\n if ...
ruby
chosen
[ { "from": "system", "value": "Add debugger as development dependency.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"erbtex/version\"\n\nGem::Specification.new do |s|\n s.name = %q{erbtex}\n s.version = ErbTeX::VERSION\n ...
ruby
chosen
[ { "from": "system", "value": "Remove sshkit runtime dependency declaration\n\nCapistrano gem depends on sshkit itself.\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...
ruby
chosen
[ { "from": "system", "value": "Stop it all exploding on Travis\n" }, { "from": "human", "value": "#Use this file to set/override Jasmine configuration options\n#You can remove it if you don't need it.\n#This file is loaded *after* jasmine.yml is interpreted.\n#\n#Example: using a different boot f...
ruby
chosen
[ { "from": "system", "value": "Downgrade chrome driver for jasmine\n\nInline with feature test chromedirver version\nand version 79 may not work for some local test envs.\n" }, { "from": "human", "value": "#Use this file to set/override Jasmine configuration options\n#You can remove it if you don...
ruby
chosen
[ { "from": "system", "value": "Simplify GenDumpCommand to not use instances of itself\n\n- Remove reliance on `easy_class_to_instance_method`\n" }, { "from": "human", "value": "module Storey\n class GenDumpCommand\n\n easy_class_to_instance\n\n def initialize(options={})\n @options = ...
ruby
chosen
[ { "from": "system", "value": "Remove one more instance of old requirement" }, { "from": "human", "value": "require 'rspec/rails/extensions/active_record/base'\n# Adds a custom matcher to RSpec to make it easier to make sure your email\n# column is valid.\n#\n# class Person\n# include Activ...
ruby
chosen
[ { "from": "system", "value": "Fix argument configuration from job definition properties\n" }, { "from": "human", "value": "require 'arg_parser'\nrequire 'color-console'\n\n\nclass Batch\n\n # Defines a module for adding argument parsing to a job via the arg-parser\n # gem, and displaying h...
ruby
chosen
[ { "from": "system", "value": "Add statsd-ruby client to dependencies\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'resque/plugins/statsd_metrics/version'\n\nGem::Specific...
ruby
chosen
[ { "from": "system", "value": "Add authentication to everything except the index.\n" }, { "from": "human", "value": "class ArticlesController < ApplicationController\n before_filter :authenticate_user!, only: [:destroy]\n\n def index\n @articles = Article.search(params[:search])\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Add missing update and destroy actions to expense controller\n" }, { "from": "human", "value": "class ExpensesController < ApplicationController\n\n def index\n @expenses = Expense.all\n end\n\n def new\n @expense = Expense.new\n end\n\n def create\n @...
ruby
chosen
[ { "from": "system", "value": "Fix flash persisting after you've logged in\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n def new\n end\n\n def create\n profile= Profile.find_by_email(params[:session][:email].downcase)\n if profile && profile.authen...
ruby
chosen
[ { "from": "system", "value": "Set CmsController as a parent of SessionsController\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nclass SessionsController < ApplicationController\n before_action :logged_in_user, only: [:destroy]\n\n def create\n if valid_credentials?(params[:ema...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary line of code\n" }, { "from": "human", "value": "class FixedArray\n attr_reader :size\n\n def initialize(size)\n @size = size\n size.times do |index|\n set(index, nil)\n end\n end\n\n def get(index)\n instance_variable_get(name...
ruby
chosen
[ { "from": "system", "value": "Fix argument delegation in Ruby 3\n" }, { "from": "human", "value": "require 'httparty'\nrequire 'builder'\n\nclass Datatrans::XML::Transaction\n class Request\n\n attr_accessor :params, :datatrans\n\n def post(url, options = {})\n options = options.merg...
ruby
chosen
[ { "from": "system", "value": "Use correct boolean || operator\n" }, { "from": "human", "value": "# Hide the implementation detail of usual methods\n# that could be part of the Message class\nclass FactCheckMail\n def initialize(message)\n @message = message\n end\n\n def recipients\n [@...
ruby
chosen
[ { "from": "system", "value": "Fix method calls where name was changed\n" }, { "from": "human", "value": "module Firebolt\n module Warmer\n include ::Firebolt::Keys\n\n ##\n # Public instance methods\n #\n def warm\n results = perform\n\n _warmer_write_results_to_cache(r...
ruby
chosen
[ { "from": "system", "value": "Use accessor methods instead of instance variables.\n" }, { "from": "human", "value": "module Lita\n module RSpec\n module Matchers\n # Used to complete a chat routing test chain.\n class RouteMatcher\n attr_accessor :expected_route\n\n d...
ruby
chosen
[ { "from": "system", "value": "Return first page if page supplied inst available\n" }, { "from": "human", "value": "module Pagylight\n module ActiveRecordExtension\n #\n # It'll give a simple interface like:\n # Model.pagylight(10, 20)\n # where firt parameter is page, and second is ...
ruby
chosen
[ { "from": "system", "value": "Use 'go build' + ./binary instead of 'go run'\n" }, { "from": "human", "value": "require 'sys/proctable'\nrequire 'childprocess'\n\nmodule Guard\n class GoRunner\n MAX_WAIT_COUNT = 10\n\n attr_reader :options, :pid\n\n def initialize(options)\n @optio...
ruby
chosen
[ { "from": "system", "value": "Make more attempts to check for the precision of Process.times\n\n* Process.clock_getres specs use 10_000 but that's quite slow for\n the Process.times spec.\n" }, { "from": "human", "value": "require_relative '../../spec_helper'\n\ndescribe \"Process.times\" do\n ...
ruby
chosen
[ { "from": "human", "value": "Add a rake task that drops all tables\n" }, { "from": "gpt", "value": "namespace :gitlab do\n namespace :db do\n task drop_all_tables: :environment do\n connection = ActiveRecord::Base.connection\n connection.tables.each do |table|\n connection.d...
ruby
chosen
[ { "from": "system", "value": "Raise a TypeError if not a hash or an array" }, { "from": "human", "value": "# Autoload is fine, its apart of ruby-core.\nautoload :YAML, \"yaml\"\n\nmodule Transcoder\n class Yaml < Parser\n identifier \"text/yaml\",\n \"text/x-yaml\",\n ...
ruby
chosen
[ { "from": "system", "value": "Fix misleading comment on DOI regexp\n\nThe end of the match for DOIs ending in balanced parentheses does not\nmatch punctuation (it's looking for something that is neither a space\nnor punctuation) so correct the comment to be less misleading.\n" }, { "from": "human", ...
ruby
chosen
[ { "from": "system", "value": "Fix parts spec by forcing variant creation\n\nAvoid errors like:\n\n Failure/Error: Unable to find matching line from backtrace\n ActiveRecord::RecordNotFound:\n Couldn't find Spree::Variant with id=1\n" }, { "from": "human", "value": "require 'spec_helper'\n\n...
ruby
chosen
[ { "from": "system", "value": "Use raise_error instead of raise_exception\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Rollbar::Delay::Thread do\n describe '.call' do\n let(:payload) { { :key => 'value' } }\n\n it 'process the payload in a new thread' do\n expe...
ruby
chosen
[ { "from": "human", "value": "Fix specification holes in Mutant::AST::Sexp\n" }, { "from": "gpt", "value": "RSpec.describe Mutant::AST::Sexp do\n let(:object) do\n Class.new do\n include Mutant::AST::Sexp\n\n public :n_not\n public :s\n end.new\n end\n\n describe '#n_not' ...
ruby
chosen
[ { "from": "human", "value": "Add script to check all users for spammers.\n" }, { "from": "gpt", "value": "def find_spammers\n spammers = Set.new\n User.all.each do |u|\n puts \"Checking user #{u.email}\"\n hp_last = ProjectHoneypot.lookup(u.last_sign_in_ip.to_s)\n if hp_last.suspiciou...
ruby
chosen
[ { "from": "system", "value": "Add Phone to supporter data\n" }, { "from": "human", "value": "class SalsaSupporter < SalsaObject\n salsa_attribute :organization_KEY, :Email, :First_Name, :Last_Name\n salsa_attribute :Street, :Street_2\n salsa_attribute :City, :State, :Country, :Zip\n salsa_at...
ruby
chosen
[ { "from": "system", "value": "Use capture instead of with_output_buffer.\n" }, { "from": "human", "value": "module ShowFor\n module Helper\n # Creates a div around the object and yields a builder.\n #\n # Example:\n #\n # show_for @user do |f|\n # f.attribute :name\n ...
ruby
chosen
[ { "from": "system", "value": "Load required libraries in updatepo task\n" }, { "from": "human", "value": "#\n# Added for Ruby-GetText-Package\n#\n\nrequire 'noosfero'\n\ndesc \"Create mo-files for L10n\"\ntask :makemo do\n require 'gettext/utils'\n GetText.create_mofiles(true, \"po\", \"locale...
ruby
chosen
[ { "from": "system", "value": "Change to ensure dependency is loaded\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire_relative 'prompt'\n\nmodule TTY\n # Used for initializing test cases\n class TestPrompt < Prompt\n def initialize(**options)\n @input = Strin...
ruby
chosen
[ { "from": "system", "value": "Change from spermy to gt or = for railties 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 'threejs-rails/version'\n\nGem::Specification.new d...
ruby
chosen
[ { "from": "system", "value": "Add middleware at the bottom\n\nRails 5 eliminates the `ParamsParser` middleware. The Clearance\nmiddleware itself seems to have no dependency on certain middleware\nrunning after it.\n" }, { "from": "human", "value": "require \"clearance\"\nrequire \"rails\"\n\nmod...
ruby
chosen
[ { "from": "system", "value": "Fix ensurable so it works with PE 2015.2, tested as working on 3.8 as well\n" }, { "from": "human", "value": "Puppet::Type.newtype(:dism) do\n @doc = 'Manages Windows features via dism.'\n\n ensurable do\n desc 'Windows feature install state.'\n\n defaultval...
ruby
chosen
[ { "from": "system", "value": "Handle RackAfterReply being loaded before web server library.\n" }, { "from": "human", "value": "require 'rack'\n\nmodule RackAfterReply\n CALLBACKS_KEY = 'rack_after_reply.callbacks'.freeze\n\n autoload :AppProxy, 'rack_after_reply/app_proxy'\n autoload :Adapter...
ruby
chosen
[ { "from": "system", "value": "Fix obsolete require statement for rspec\n\n(The old one brakes with RSpec 2.*)\n" }, { "from": "human", "value": "#\n# Author:: Adam Jacob (<adam@opscode.com>)\n# Copyright:: Copyright (c) 2008 Opscode, Inc.\n# License:: Apache License, Version 2.0\n#\n# Licensed u...
ruby
chosen
[ { "from": "system", "value": "Revert \"Allow rackspace connections further up the chain\"\n\nThis reverts commit ccf5271bf223b6c6ab97b13b6fedb24295fddc23.\n" }, { "from": "human", "value": "require 'vcr'\nrequire 'webmock/cucumber'\n\nWebMock.disable_net_connect!(:allow => 'lon.auth.api.rackspac...
ruby
chosen
[ { "from": "system", "value": "Change the version of ActiveSupport from rc to rel.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nGem::Specification.new do |spec|\n spec.name = 'filtered_params'\n spec.version = '0.0.1'\n spec.authors = ['ITO Nobuaki']\n sp...
ruby
chosen
[ { "from": "system", "value": "Document C code now (pretty much documented)\n\nThanks to tenderlove (Aaron Patterson) for that!\n" }, { "from": "human", "value": "begin\n require 'hoe'\nrescue LoadError\n # try with rubygems?\n require 'rubygems'\n require 'hoe'\nend\n\nHoe.plugin :debugging,...
ruby
chosen
[ { "from": "system", "value": "Fix a deprecation warning of simpleCov\n\n`SimpleCov::Formatter::MultiFormatter[]` is deprecated.\nSo, this PR replaces it with `.new`.\nSee https://github.com/colszowka/simplecov/blob/cb0e62b37b63816d07bdb15f3ee88ceade0947e5/lib/simplecov/formatter/multi_formatter.rb#L27\n" ...
ruby
chosen
[ { "from": "system", "value": "Use j() for i18n translating text\n" }, { "from": "human", "value": "module WebConsole\n class View < ActionView::Base\n # Execute a block only on error pages.\n #\n # The error pages are special, because they are the only pages that\n # currently requi...
ruby
chosen
[ { "from": "system", "value": "Add not_compliant_on for retry in block on jruby.\n" }, { "from": "human", "value": "describe \"The retry statement\" do\n it \"raises a LocalJumpError if used outside of a block\" do\n def bad_meth_retry; retry; end\n lambda { bad_meth_retry() }.should ...
ruby
chosen
[ { "from": "system", "value": "Make the script work with arguments\n" }, { "from": "human", "value": "require 'revdev'\nrequire 'pry'\n\nLEFT_SHIFT = 42\nENTER = 28\n\nKEYPRESS = :EV_KEY\nKEYDOWN = 1\n\nTIME_FORMAT = '%d.%m.%y %H:%M:%S'\n\ndef line_format(buffer)\n \"#{buffer}; #{Time.now.strfti...
ruby
chosen
[ { "from": "system", "value": "Fix spec completeness user concern spec\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe User::Completeness do\n\n subject { User::Completeness::Calculator.new(user).progress }\n\n context 'when the profile type is personal' do\n let(:user) ...
ruby
chosen
[ { "from": "system", "value": "Test that the Cucumber::Web module extends paths, selectors and steps\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Cucumber::Web do\nend\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Cucumber::Web do\n it 'ex...
ruby
chosen
[ { "from": "system", "value": "Add development dependencies 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 'hatenablog/version'\n\nGem::Specification.new do |spec|\n spec....
ruby
chosen
[ { "from": "system", "value": "Update name of pod dep to match name given in the fork\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"FDTake\"\n s.version = \"0.4.3\"\n s.summary = \"Easily take a photo or video or choose from library\"\n s.description ...
ruby
chosen
[ { "from": "human", "value": "Add initializer for production config\n" }, { "from": "gpt", "value": "rails_root = ENV['RAILS_ROOT'] || File.dirname(__FILE__) + '/../..'\nrails_env = ENV['RAILS_ENV'] || 'development'\n\nresque_config = YAML.load_file(rails_root + '/config/resque.yml')\nResque.redi...
ruby
chosen
[ { "from": "system", "value": "Add ability to perform a task with retries\n" }, { "from": "human", "value": "module SmokeTest\n module Steps\n class BaseStep\n include Capybara::DSL\n\n attr_accessor :state\n\n def initialize(state)\n puts \"Step:#{step_name}\"\n ...
ruby
chosen
[ { "from": "system", "value": "Test for non attribute params on put\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe Api::V1::TasksController do\n let( :user ) { create :user }\n let( :task ) { create :task, user: user }\n let( :task_attr ) do\n {\n title: 'foo',\n...
ruby
chosen
[ { "from": "system", "value": "Update createing post spec with new validations/passing\n" }, { "from": "human", "value": "require 'rails_helper.rb'\n\nfeature 'Save valid posts only' do\n def attempt_to_post_with (options={})\n options[:title] ||= \"My valid post\"\n options[:content] ||= ...
ruby
chosen
[ { "from": "system", "value": "Use the active admin method for this\n" }, { "from": "human", "value": "require 'active_admin/views/components/status_tag'\n\nmodule ActiveAdmin\n module Globalize3\n module IndexTableFor\n def translation_status\n column I18n.t(\"active_admin.global...
ruby
chosen
[ { "from": "system", "value": "Add magic encoding comment for Ruby 1.9\n\nRequired due to \"»\" character in spec example.\n" }, { "from": "human", "value": "require File.expand_path(File.dirname(__FILE__) + '/acceptance_helper')\n\nfeature 'Users' do\n background do\n 1.upto(100) {|i| User.c...
ruby
chosen
[ { "from": "system", "value": "Refactor interface spec and change/add methods\n" }, { "from": "human", "value": "require 'spec_helper'\n\nmodule SandthornDriverSequel\n\tdescribe EventStore do\n\t\tbefore(:each) { prepare_for_test }\n\t\tcontext \"interface structure\" do\n\t\t\tlet(:subject) {ev...
ruby
chosen
[ { "from": "system", "value": "Add functional spec for a :name symbol\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe \"FC108\" do\n context \"with a cookbook with a custom resource that defines...
ruby
chosen
[ { "from": "human", "value": "Add mailer for sending reminding's notifications\n" }, { "from": "gpt", "value": "class ProjectNotificationMailer < ApplicationMailer\n attr_reader :project_check\n\n def check_reminder(notification, project_check)\n @project_check = project_check\n mail(to: ...
ruby
chosen
[ { "from": "system", "value": "Allow receive_incoming_mail to receive a String\n\nYou can now send a string rather than a filename to the\nreceive_incoming_mail spec helper.\n\nFor example:\n\n spam_email = <<-EOF\n From: EMAIL_FROM\n To: FOI Person <EMAIL_TO>\n Subject: Test Email\n\n Plz buy...
ruby
chosen
[ { "from": "system", "value": "Add a post_install_message to the gem to inform users that the Ruby data modules have been moved.\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'tzinfo'\n s.version = '1.0.0.pre1' \n s.summary = 'Daylight-savings aware timezone libr...
ruby
chosen
[ { "from": "system", "value": "Order players in tournament reports by rank\n" }, { "from": "human", "value": "require 'open-uri'\n\nclass Rpt::TournamentReportsController < Rpt::AbstractReportController\n helper_method :self_promoter\n\n def show\n @tournament = Tournament.yr(@year).find(par...
ruby
chosen
[ { "from": "system", "value": "Fix rubocop warnings in ProviderConfigurationManagerHelper\n" }, { "from": "human", "value": "module ProviderConfigurationManagerHelper\n include TextualMixins::TextualGroupTags\n\n def textual_group_properties\n %i(hostname\n ipmi_present\n ipaddre...
ruby
chosen
[ { "from": "system", "value": "Move last update before request\n" }, { "from": "human", "value": "require 'rss/1.0'\nrequire 'rss/2.0'\nrequire 'eventmachine'\n\nclass Reddit\n def initialize(bot)\n @bot = bot\n\n unless File.exist?(@config = ENV[\"HOME\"] + \"/.drug-bot\")\n FileUtil...
ruby
chosen
[ { "from": "system", "value": "Change to more specific message about java" }, { "from": "human", "value": "# Fact: java_patch_level\n#\n# Purpose: get Java's patch level\n#\n# Resolution:\n# Uses java_version fact splits on the patch number (after _)\n#\n# Caveats:\n# none\n#\n# Notes:\n# N...
ruby
chosen
[ { "from": "system", "value": "Allow other engines to be checked out in parallel with stash_engine as well as in subdirectories\n" }, { "from": "human", "value": "module BundlerHelp\n\n def self.find_path(dir_name)\n paths = [File.expand_path('.'), File.expand_path('..')]\n paths.each do |...
ruby
chosen