conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix backtrace for running the bundle’s own specs.\n\nWhen running the bundle’s own specs *all* backtrace lines got filtered out, so that RSpec showed the complete backtrace as a fallback.\n" }, { "from": "human", "value": "if defined?(RSpec)\n bundle_patterns = [%r...
ruby
chosen
[ { "from": "system", "value": "Add Ctrl-C will elegant exit\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n# -*- coding: utf-8 -*-\n\nrequire 'rb-inotify'\nrequire 'singleton'\n\nmodule CoffeeWithoutNodejs\n class CoffeeWatcher\n include Singleton\n\n def initialize\n @notifi...
ruby
chosen
[ { "from": "system", "value": "Use correct (best-practice) StandardError for ConnectionError\n" }, { "from": "human", "value": "module QuickTravel\n class ConnectionError < Exception\n attr_reader :original\n def initialize(msg, original = $ERROR_INFO)\n super(msg)\n @original = ...
ruby
chosen
[ { "from": "system", "value": "Use keyword arguments instead of last parameter Hash\n\nthis would eliminate warnings when calling keyworded method,\nand this still works with methods taking last parameter Hash\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire \"active_su...
ruby
chosen
[ { "from": "system", "value": "Change the foreground color of keywords to magenta.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Textbringer\n Face.define :comment, foreground: \"yellow\"\n Face.define :keyword, foreground: \"green\", bold: true\n Face.define :stri...
ruby
chosen
[ { "from": "system", "value": "Update presenter reference for restful show view override\n" }, { "from": "human", "value": "module Pakyow\n class RouteTemplateDefaults\n def self.defaults\n lambda {\n template(:restful) {\n nested_path { |group, path|\n File.jo...
ruby
chosen
[ { "from": "system", "value": "Add src_encoding parameter to fix ruby 2.0.0 issue\n\nTravis detected an issue with Ruby 2.0: setting the src_encoding\nparameterto String#encode fixes this issue.\nhttp://ruby-doc.org/core-2.0.0/String.html#method-i-encode\n" }, { "from": "human", "value": "module ...
ruby
chosen
[ { "from": "system", "value": "Use LocationMapsGeneratorService.generate to extract the locations when UPDATE_LOCATIONS=true\n" }, { "from": "human", "value": "require 'json'\nrequire 'pp'\nrequire 'faraday'\n\ndef update_locations\n begin\n conn = Faraday.new(url: 'https://bibdata.princeton....
ruby
chosen
[ { "from": "system", "value": "Add missing docs for Typecast::BigDecimal\n" }, { "from": "human", "value": "module Virtus\n module Typecast\n\n # BigDecimal\n #\n class BigDecimal < Object\n\n # @api public\n def self.to_i(value)\n value.to_i\n end\n\n # @api ...
ruby
chosen
[ { "from": "system", "value": "Remove *nix->Windows path separator translation\n\nOlder versions of libtool apparently don't like Windows backslash\npath component separators.\n" }, { "from": "human", "value": "def append_env(name, value, delim=';')\n env_name = name.to_s.upcase\n sane_value = ...
ruby
chosen
[ { "from": "system", "value": "Update the QueryForDiscussion test to reflect JSON presentation\n\n* /discussions.json includes the identifier_strings field\n when rendering its response." }, { "from": "human", "value": "require 'test_helper'\n\nclass QueryForDiscussionsTest < ActionDispatch::Int...
ruby
chosen
[ { "from": "system", "value": "Fix bug in rake task description line\n" }, { "from": "human", "value": "desc 'Run all unit, functional, helper and integration tests'\ntask :test do\n errors = %w(test:units test:functionals test:helpers test:integration).collect do |task|\n begin\n Rake::...
ruby
chosen
[ { "from": "system", "value": "Allow restrictions to login by specific domain." }, { "from": "human", "value": "OmniAuth.config.logger = Rails.logger\n\nRails.application.config.middleware.use OmniAuth::Builder do\n provider :google_oauth2, ENV['GOOGLE_KEY'], ENV['GOOGLE_SECRET'],\n {\n prom...
ruby
chosen
[ { "from": "system", "value": "QUALITY: Add auth token helper methods to tests\n" }, { "from": "human", "value": "module TestHelpers\n #\n # Authentication test helper\n #\n module AuthHelper\n #\n # Gets an authentication token for User.first\n #\n def get_auth_token\n user ...
ruby
chosen
[ { "from": "system", "value": "Check to see if the module we're actually working with is loaded (in case only pieces of ActiveRecord are loaded)." }, { "from": "human", "value": "if defined?(ActiveRecord)\n RSpec::Matchers::OperatorMatcher.register(ActiveRecord::Relation, '=~', RSpec::Matchers::...
ruby
chosen
[ { "from": "system", "value": "Add `:if_exists => true` to RemoveGeniModels Migration\n" }, { "from": "human", "value": "class RemoveGeniModels < ActiveRecord::Migration[6.1]\n def up\n drop_table :geniverse_activities\n drop_table :geniverse_articles\n drop_table :geniverse_cases\n ...
ruby
chosen
[ { "from": "system", "value": "Add tests for products' model\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass ProductTest < ActiveSupport::TestCase\n # test \"the truth\" do\n # assert true\n # end\nend\n" }, { "from": "gpt", "value": "require 'test_helper'\n\ncl...
ruby
chosen
[ { "from": "system", "value": "Disable ddl transactions for realz!\n" }, { "from": "human", "value": "class MigrateWordCounts < ActiveRecord::Migration\n def up\n\n disable_ddl_transaction\n\n post_ids = execute(\"SELECT id FROM posts WHERE word_count IS NULL LIMIT 500\").map {|r| r['id']....
ruby
chosen
[ { "from": "system", "value": "Access file tree interface through /browse.\n" }, { "from": "human", "value": "require \"erb\"\nrequire \"json/pure\"\nrequire \"android_interface\"\n\nclass Broadcast < Sinatra::Base \n include AndroidInterface\n\n set :views, VIEW_DIR\n set :public, PUBLIC_DIR\...
ruby
chosen
[ { "from": "system", "value": "Edit Seed file to include votes on a comment, question or answer\n" }, { "from": "human", "value": "require 'faker'\n\nUser.delete_all\nQuestion.delete_all\n\n50.times do\n User.create!( name: Faker::Name.name,\n username: Faker::Internet.user_name,\...
ruby
chosen
[ { "from": "system", "value": "Use the noop logger in hiera\n" }, { "from": "human", "value": "#!/usr/bin/ruby\n\nrequire 'hiera'\nrequire 'puppet'\nrequire 'json'\nrequire 'sinatra'\n\nhiera = Hiera.new\nPuppet.initialize_settings\n# this can be :rest to use inventory service instead\nPuppet::No...
ruby
chosen
[ { "from": "system", "value": "Use GitHub releases for homebrew downloads\n" }, { "from": "human", "value": "require \"formula\"\n\nclass Gh < Formula\n VERSION = \"0.19.0\"\n ARCH = if MacOS.prefer_64_bit?\n \"amd64\"\n else\n \"386\"\n end\n\n homepage \"h...
ruby
chosen
[ { "from": "system", "value": "Add one more passing test\n" }, { "from": "human", "value": "require './src/password_crypt.rb'\n\ndescribe PasswordCrypt do \n it 'should use default key file if none given' do \n pc = PasswordCrypt.new\n pc.keyfile.should == PasswordCrypt::DEFAULT_KEY_FILE \...
ruby
chosen
[ { "from": "system", "value": "Fix limited_update_conditions on MySQLCompiler to receive and build\nlimit.\n" }, { "from": "human", "value": "module Arel\n module SqlCompiler\n class MySQLCompiler < GenericCompiler\n def limited_update_conditions(conditions)\n conditions\n en...
ruby
chosen
[ { "from": "system", "value": "Make sure the decorator is in the \"right\" place\n" }, { "from": "human", "value": "require 'test_helper'\n\nmodule SGMailer\n class BaseTest < Minitest::Test\n class SendGridMailer < SGMailer::Base\n template_id 'e0d26988-d1d7-41ad-b1eb-4c4b37125893'\n\n ...
ruby
chosen
[ { "from": "human", "value": "Add a parser with some properties supported.\n" }, { "from": "gpt", "value": "#\n# = Ruby Whois\n#\n# An intelligent pure Ruby WHOIS client and parser.\n#\n#\n# Category:: Net\n# Package:: Whois\n# Author:: Simone Carletti <weppos@weppos.net>\n# License::...
ruby
chosen
[ { "from": "system", "value": "Remove toggle from % of random\n" }, { "from": "human", "value": "module Flipper\n module Gates\n class PercentageOfRandom < Gate\n # Internal: The name of the gate. Used for instrumentation, etc.\n def name\n :percentage_of_random\n end\n\...
ruby
chosen
[ { "from": "system", "value": "Allow the graph format to be set as a local.\n" }, { "from": "human", "value": "require 'graphite_graph'\n\nmodule GraphiteTemplate\n class TemplateHandler\n def self.call(template)\n \"'#{GraphiteTemplate::Config.graphite_url}?' + GraphiteGraph.new('#{temp...
ruby
chosen
[ { "from": "system", "value": "Update formatting of version routes\n" }, { "from": "human", "value": "module LLT\n module Core::Api::VersionRoutes\n def add_version_route_for(route, params)\n dependencies = params[:dependencies]\n\n get(\"#{route}/version\") do\n output = dep...
ruby
chosen
[ { "from": "system", "value": "Use shift to delete first element\n" }, { "from": "human", "value": "# encoding: utf-8\n# frozen_string_literal: true\n\nmodule MessageBroker\n # SortedArray extends functionality of general purpose\n # array and keeps its content sorted. Only required\n # method...
ruby
chosen
[ { "from": "system", "value": "Add more log to send request\n" }, { "from": "human", "value": "class SendRequestEndPoint < Goliath::API\n include Neighborparrot::Connection\n include Neighborparrot::Auth\n\n # Default headers\n HEADERS = { 'Access-Control-Allow-Origin' => '*',\n 'Content-T...
ruby
chosen
[ { "from": "system", "value": "Add request_phase handler and redirect to callback_url\n" }, { "from": "human", "value": "require 'omniauth'\n\nmodule OmniAuth\n module Strategies\n class Headers\n include OmniAuth::Strategy\n\n option :headers, {uid: 'HTTP_USER_ID', email: 'HTTP_EMA...
ruby
chosen
[ { "from": "system", "value": "Remove extensions that are no longer needed\n" }, { "from": "human", "value": "module ROM\n module SQL\n class Relation < ROM::Relation\n # TODO: This will go away when ROM core generates Lazy classes dedicated for each\n # relation class and by adding...
ruby
chosen
[ { "from": "system", "value": "Fix shoulda to something like 2.10.1\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nrequire './lib/jabbot/version'\n\nGem::Specification.new do |s|\n s.name = \"jabbot\"\n s.version = Jabbot::VERSION\n s.date = Time.now...
ruby
chosen
[ { "from": "system", "value": "Make Hiera backend hit Noodle :)\n\nIt works but several TODOs to be a real bear.\n" }, { "from": "human", "value": "# Hiera backend for Noodle\nPuppet::Functions.create_function(:noodle) do\n dispatch :noodle_lookup_key do\n param 'String[1]', :key\n param '...
ruby
chosen
[ { "from": "system", "value": "Fix conversion of IP address, don't use raw address\n" }, { "from": "human", "value": "# dns_lookup.rb\n# does a DNS lookup and returns an array of strings of the results\n\nmodule Puppet::Parser::Functions\n newfunction(:dns_lookup, :type => :rvalue, :doc => <<-EO...
ruby
chosen
[ { "from": "system", "value": "Return original input on schema call\n\nWhen a schema is validated the keys are removed that are not specifiedin\nthe schema. Such as if the schema does not include the `requester` key,\nafter validation that key will no longer exist.\n\nMSG-75\n" }, { "from": "human", ...
ruby
chosen
[ { "from": "system", "value": "Add offset-x and y properties to style parameters\n\nCo-authored-by: kosappi <1a72c3adb8cf451abd36cfcfa35039fbab5efb3b@misoca.jp>\nCo-authored-by: Katsuya HIDAKA <2f1e5d0fd7c5b5529f5d591c063df911b29bc9d1@gmail.com>\n" }, { "from": "human", "value": "# frozen_string_...
ruby
chosen
[ { "from": "system", "value": "Use the new service in the audience controller\n" }, { "from": "human", "value": "#\n# Namespace for the Socializer engine\n#\nmodule Socializer\n class AudiencesController < ApplicationController\n before_action :authenticate_user!\n\n def index\n query...
ruby
chosen
[ { "from": "system", "value": "Update the test model to hold a constant array of data types\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass ApplicationRecord < ActiveRecord::Base\n self.abstract_class = true\n\n # computed attributes\n\n def computed_binary\n binar...
ruby
chosen
[ { "from": "system", "value": "Use hang v1.1 with make install support\n" }, { "from": "human", "value": "require \"formula\"\n\nclass JreeseCore < Formula\n homepage \"https://github.com/jreese/homebrew-formula\"\n url \"https://github.com/jreese/hang.git\", :tag => \"v1.0\", :revision => \"b9...
ruby
chosen
[ { "from": "system", "value": "Update selenium and remove uneeded gemfile additions.\n" }, { "from": "human", "value": "# By placing all of Spree's shared dependencies in this file and then loading\n# it for each component's Gemfile, we can be sure that we're only testing just\n# the one componen...
ruby
chosen
[ { "from": "system", "value": "Add me to the authors\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"clockwork\"\n s.version = \"0.5.2\"\n\n s.authors = [\"Adam Wiggins\"]\n s.description = \"A scheduler process to replace cron, using a more flexible Ruby syntax ...
ruby
chosen
[ { "from": "human", "value": "Add email CSV parsing script\n" }, { "from": "gpt", "value": "#!usr/bin/env ruby\n\nrequire 'csv'\nmessages, addresses, subjects = [], [], []\nemail_regex = /(\\S+)@(\\S+)/\nf = CSV.read('index.csv')\nf.each do |row|\n subjects.push(row[0])\n addresses.push(row[1])...
ruby
chosen
[ { "from": "system", "value": "Allow *either* IRBC or SOLBEBIO_IRBRC to get run after our default profile.\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n# -*- coding: utf-8 -*-\n# Open the SolveBio shell, an IRB wrapper\nrequire 'irb'\n\nmodule IRB\n\n # Stuff to add IRB commands goe...
ruby
chosen
[ { "from": "system", "value": "Extend ActiveRecord::Base with Douglas::Model after active_record is loaded\n" }, { "from": "human", "value": "require 'request_store'\nrequire 'douglas/version'\nrequire 'douglas/model'\n\nmodule Douglas\n class << self\n def the_stamper\n RequestStore.sto...
ruby
chosen
[ { "from": "system", "value": "Implement version method for Libvirt module\n" }, { "from": "human", "value": "#\n# libvirt.rb: main module for the ruby-libvirt bindings\n#\n# Copyright (C) 2007 Red Hat, Inc.\n# Copyright (C) 2010 Oversun-Scalaxy.\n#\n# Distributed under the GNU Lesser General Pub...
ruby
chosen
[ { "from": "system", "value": "Make interface of Nothing the same as for Monad\n" }, { "from": "human", "value": "module M\n class Maybe < Monad\n def self.return(value)\n return value if value == Nothing\n Just(value)\n end\n\n def self.join(value)\n return Nothing if va...
ruby
chosen
[ { "from": "system", "value": "Add SimpleCov filter for vendor installs, avoiding TravisCI failure\n" }, { "from": "human", "value": "require 'simplecov'\nSimpleCov.start\nSimpleCov.refuse_coverage_drop\nrequire_relative '../../lib/quality/rake/task'\nrequire 'test/unit'\nrequire 'mocha/setup'\n"...
ruby
chosen
[ { "from": "system", "value": "Fix merge error: Now the authentication system works again!\n" }, { "from": "human", "value": "module Refinery\n class Plugin\n\n def self.register(&block)\n yield self.new\n end\n\n attr_accessor :name, :title, :version, :description, :url, :menu_mat...
ruby
chosen
[ { "from": "system", "value": "Fix parser spec to not explode\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Parser do\n class ParseTestCommand < Command\n syntax \"testing_good_command\"\n end\n\n context '.parse_and_execute' do\n it \"handles a bad command\" do\n ...
ruby
chosen
[ { "from": "system", "value": "Test for choose processor class method\n" }, { "from": "human", "value": "require 'spec_helper'\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe MiniMagick do\n context '.choose_processor' do\n it \"identifies when mogrify exists\" ...
ruby
chosen
[ { "from": "human", "value": "Add descartes rspec test (for local use only)\n" }, { "from": "gpt", "value": "require 'spec_helper'\nrequire 'open-uri'\ndescribe \"Descartes\", :js => true do\n\n\ttype = \"Descartes\"\n\tname = \"wave:sine\"\n\tdescartes_host = ENV[\"TEST_DESCARTES_HOST\"]\n\trais...
ruby
chosen
[ { "from": "system", "value": "Add spec for customers having many orders\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe Customer, type: :model do\n customer = Customer.create(first_name: 'Jonathan', last_name: 'Chen')\n\n it 'create successfully' do\n expect(cust...
ruby
chosen
[ { "from": "human", "value": "Add spec for post forms on relative/absolute time\n\nbasic tests to confirm date manipuation GUIs work to change the URL.\n" }, { "from": "gpt", "value": "require 'spec_helper'\nrequire './generate_flatfile'\ndescribe \"Post Timescales\", :js => true do\n\n\tit \"Ret...
ruby
chosen
[ { "from": "system", "value": "Add expectation for ACS service_descriptions\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe AttributeConsumingService do\n it_behaves_like 'a basic model'\n\n it { is_expected.to validate_presence :index, allow_missing: false }\n it { is_ex...
ruby
chosen
[ { "from": "system", "value": "Exclude deauthorize spec from live test\n" }, { "from": "human", "value": "require 'spec_helper'\n\nshared_examples 'Account API' do\n it 'retrieves a stripe account', live: true do\n account = Stripe::Account.retrieve\n\n expect(account).to be_a Stripe::Acco...
ruby
chosen
[ { "from": "system", "value": "Use the sorted editable channels by authority\n" }, { "from": "human", "value": "module Users\n class User < Mustache::Railstache\n def init\n self[:graph_user] = self[:user].graph_user\n end\n\n def id\n self[:user].id\n end\n\n def graph_...
ruby
chosen
[ { "from": "system", "value": "Update topics test with pagination\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe 'forums/topics/show' do\n let(:topic) { build_stubbed(:forums_topic) }\n let(:threads) { build_stubbed_list(:forums_thread, 5, topic: topic) }\n let(:subtopic...
ruby
chosen
[ { "from": "human", "value": "Add trivial spec for really basic workingness of the interactors\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Interactors::Groups do\n include PavlovSupport\n\n describe 'Created groups appear in list' do\n it 'filters out invalid activitie...
ruby
chosen
[ { "from": "system", "value": "Fix pivotal-tracker version for now" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/pt-flow/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Jens Balvig\"]\n gem.email = [\"jens@ba...
ruby
chosen
[ { "from": "system", "value": "Make the User initializer get its data from a parsed JSON object\n" }, { "from": "human", "value": "module Ldash\n # Discord user\n class User\n attr_accessor :username, :id, :discriminator, :avatar\n\n # server ID => [role IDs]\n attr_accessor :roles\n\n...
ruby
chosen
[ { "from": "system", "value": "Increase default Capybara wait time\n\n2 seconds is very aggressive on my laptop, but 5 seconds would be an\neternity on the web...\n" }, { "from": "human", "value": "RSpec.configure do |config|\n config.expect_with :rspec do |expectations|\n expectations.includ...
ruby
chosen
[ { "from": "system", "value": "Remove FIXME from primitive type validation\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nrequire 'data_mapper/validation/rule'\n\nmodule DataMapper\n module Validation\n class Rule\n\n class PrimitiveType < Rule\n\n def valid?(reso...
ruby
chosen
[ { "from": "system", "value": "Fix template directory due to RPM build changes\n\nFixes https://github.com/ManageIQ/manageiq/issues/20375\n" }, { "from": "human", "value": "require 'fileutils'\n\nmodule MiqConfigSssdLdap\n class AuthTemplateFilesError < StandardError; end\n\n class AuthTemplate...
ruby
chosen
[ { "from": "human", "value": "Add an example for Android and Sauce Labs\n" }, { "from": "gpt", "value": "# This example automates a test of the Android example notepad app.\n#\n# To run this example, make sure you've run:\n# $ bundle install\n#\n# And set the environment variables:\n# SAUCE_U...
ruby
chosen
[ { "from": "system", "value": "Add newline after magic comment\n\nThe substitution made in the previous commit caused this file to be\npicked up by the rubocop linter in CI and it failed the\n`Layout/EmptyLineAfterMagicComment` rule. Adding this newline fixes\nit.\n" }, { "from": "human", "value"...
ruby
chosen
[ { "from": "system", "value": "Fix incorrect prompt for app secret.\n" }, { "from": "human", "value": "require \"dropbox_sdk\"\n\nclass DropboxSetup\n\n attr_accessor :app_key, :app_secret, :access_token_key, :access_token_secret\n\n def initialize\n @app_key = nil\n @app_secret = nil\n ...
ruby
chosen
[ { "from": "system", "value": "Allow schema to set elasticsearch type and index\n\nSometimes we have date fields. Sometimes we have fields that we want to\nanalyze (and therefore include in _all for keyword matching).\n" }, { "from": "human", "value": "require 'delegate'\n\nclass ElasticSearchMap...
ruby
chosen
[ { "from": "system", "value": "Make init_config! a module method again\n" }, { "from": "human", "value": "module FileConvert\n module Configure\n require 'yaml'\n\n DEFAULT_CONFIG_PATH = 'config/file_convert.yml'\n\n def self.config_yaml_present?\n ::File.exist?(DEFAULT_CONFIG_PATH...
ruby
chosen
[ { "from": "system", "value": "Resolve Style/Next: Use next to skip iteration\n" }, { "from": "human", "value": "module IndexShotgun\n module Analyzer\n require \"index_shotgun/array_start_with\"\n\n class << self\n using IndexShotgun::ArrayStartWith\n\n def check_indexes(table)\...
ruby
chosen
[ { "from": "system", "value": "[scripts] Fix script for resolving conflicts\n" }, { "from": "human", "value": "require 'fileutils'\ninclude FileUtils\n\nconflicts = `find ~/Dropbox -name \"*conflicted*\"`.split(\"\\n\")\nsame, diff = conflicts.select { |conflict|\n actual = conflict.sub(/ \\(.*'...
ruby
chosen
[ { "from": "system", "value": "Update Railtie for multiple cases" }, { "from": "human", "value": "class Rack::SSL::Railtie < ::Rails::Railtie\n initializer \"middleware\" do\n if config.force_ssl\n config.middleware.use Rack::SSL\n end\n end\nend\n" }, { "from": "gpt", "v...
ruby
chosen
[ { "from": "system", "value": "Set watchOS deployment target to 3.0\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"AsyncSwift\"\n s.version = \"2.0.0\"\n s.summary = \"Syntactic sugar in Swift for asynchronous dispatches in Grand Central Dispatch\"\n s.hom...
ruby
chosen
[ { "from": "human", "value": "Add rake task for copying the table partials\n" }, { "from": "gpt", "value": "namespace :datagrid do\n\n def copy_template(path)\n gem_app = File.expand_path(\"../../../app\", __FILE__)\n rails_app = (Rails.root + \"app\").to_s\n puts \"* copy (#{path})\"...
ruby
chosen
[ { "from": "system", "value": "Feature: Allow ResourceNotFoundError to have a default action\n\n--------------------------------------------------------------------------------\nChange-Id: I51b10d48d5f767a51d58a5d401ecf8ccc8a94a46\nSigned-off-by: Jeff Felchner <8a84c204e2d4c387d61d20f7892a2bbbf0bc8ae8@th...
ruby
chosen
[ { "from": "human", "value": "Add spec, mixin module sequencer\n" }, { "from": "gpt", "value": "describe ActiveRecordSharding::Model do\n let!(:model) do\n Class.new(ActiveRecord::Base) do\n def self.name\n 'User'\n end\n\n include ActiveRecordSharding::Sequencer\n ...
ruby
chosen
[ { "from": "system", "value": "Add format to attributes as this is required by model\n" }, { "from": "human", "value": "require \"rails_helper\"\n\nRSpec.describe \"show multipage\" do\n let(:content_item) {{\n \"content_id\": SecureRandom.uuid,\n \"base_path\": \"/vat-rates\",\n \"titl...
ruby
chosen
[ { "from": "system", "value": "Define new tests to cover the case with redirection and setting cookies\n" }, { "from": "human", "value": "require 'spec_helper'\n\nmodule RackPassword\n describe Block do\n\n describe \"success rack response\" do\n let(:block){ Block.new(\"app\") }\n\n ...
ruby
chosen
[ { "from": "system", "value": "Fix async pty name option spec\n" }, { "from": "human", "value": "context 'when async suggestions are enabled' do\n let(:options) { [\"ZSH_AUTOSUGGEST_USE_ASYNC=\"] }\n\n describe 'the zpty for async suggestions' do\n it 'is created with the default name' do\n ...
ruby
chosen
[ { "from": "system", "value": "Add spec to package and fix README naming\n" }, { "from": "human", "value": "SPEC = Gem::Specification.new do |s|\n s.name = \"mmmail\"\n s.version = \"0.1.0\"\n s.date = \"2009-02-22\"\n s.author = \"Loren Segal\"\n s.email = \"lsegal@soen.ca\"\n s.homepage =...
ruby
chosen
[ { "from": "system", "value": "Add route comments and a /users route\n" }, { "from": "human", "value": "require 'sinatra'\nrequire 'haml'\n\nget '/' do\n haml :index, locals: { title: 'Sinatra' }\nend\n" }, { "from": "gpt", "value": "require 'sinatra'\nrequire 'haml'\n\n# GET home pa...
ruby
chosen
[ { "from": "system", "value": "Test for 4 does not offer nothing new. Still GREEN\n" }, { "from": "human", "value": "require \"test/unit\"\nrequire \"shoulda\"\n\nclass FizzBuzz\n def self.say(n)\n return \"Fizz\" if n == 3\n n.to_s \n end\nend\n\nclass TestFizzbuzz < Test::Unit::TestCase...
ruby
chosen
[ { "from": "system", "value": "Use order serializer for order/show\n" }, { "from": "human", "value": "class Sprangular::OrdersController < Sprangular::BaseController\n before_filter :check_authorization\n\n def show\n authorize! :show, @user\n\n @order = Spree::Order.where(number: params[...
ruby
chosen
[ { "from": "system", "value": "Update app from classic sinatra style to modular style\n" }, { "from": "human", "value": "$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), 'lib')))\n\nrequire 'sinatra'\nrequire 'app_helper'\nrequire 'file_helper'\nrequire 'web_helper'\n\nhelpers do\n ...
ruby
chosen
[ { "from": "human", "value": "Add tests for management endpoint for site-wide muting\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nrequire \"rails_helper\"\n\ndescribe Moderation::AnonymousBlockController, :ajax_controller, type: :controller do\n describe \"#index\" do\n s...
ruby
chosen
[ { "from": "system", "value": "[api] Create a cart with some service orders\n" }, { "from": "human", "value": "class ApiController\n module ServiceOrders\n def create_resource_service_orders(type, id, data)\n raise BadRequestError, \"Can't create an ordered service order\" if data[\"stat...
ruby
chosen
[ { "from": "system", "value": "Fix type_cast_for_write on Rails 4.\n\nNumeric type_cast_for_write also needs to be patched on Rail 4 (similar\nto how convert_number_column_value is handled on Rails 3.x). This fixes\nAR#validates_numericality_of which uses a before_type_cast accessor. " }, { "from": "...
ruby
chosen
[ { "from": "system", "value": "Update translation scope for PayPal checkout cancellation message\n" }, { "from": "human", "value": "Spree::PaypalController.class_eval do\n after_filter :reset_order_when_complete, only: :confirm\n before_filter :enable_embedded_shopfront\n\n def cancel\n fla...
ruby
chosen
[ { "from": "system", "value": "Fix specs failing due to constant changes." }, { "from": "human", "value": "# encoding: UTF-8\nrequire 'spec_helper'\n\ndescribe Grim do\n it \"should have a VERSION constant\" do\n Grim.const_defined?('VERSION').should be_true\n end\n\n it \"should have WIDTH...
ruby
chosen
[ { "from": "system", "value": "Fix spec for checking Gemfile\n" }, { "from": "human", "value": "require \"spec_helper\"\nrequire \"fileutils\"\n\ndescribe Ordinare do\n describe \"hi\" do\n it \"says hi in italian\" do\n expect(Ordinare.hi).to eq \"Ciao, sono Ordinare\"\n end\n end\...
ruby
chosen
[ { "from": "system", "value": "Make test tokens unique to allow multiple of same kind.\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :api_token do\n token\t\"deadbeef\"\n name \"general token\"\n read\tfalse\n write false\n end\n\n factory :api_token_r, class: ...
ruby
chosen
[ { "from": "system", "value": "Update do_openedge dependency to ~> 0.10.9\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire File.expand_path('../lib/dm-openedge-adapter/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.name = 'dm-openedge-adapter'\n gem.summary ...
ruby
chosen
[ { "from": "human", "value": "Write a test of \"method_call_situations\"\n" }, { "from": "gpt", "value": "RSpec.feature \"method_call_situation pages\", type: :feature do\n def expect_search_area\n within(\".search-area\") do\n expect(page).to have_content \"Class name\"\n expect(pa...
ruby
chosen
[ { "from": "system", "value": "Extend tests for pipeline detailed status helpers\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Gitlab::Ci::Status::Pipeline::Common do\n let(:user) { create(:user) }\n let(:project) { create(:empty_project) }\n let(:pipeline) { create(:ci_...
ruby
chosen
[ { "from": "system", "value": "Resolve deprecation warning in the chefspecs\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'aws::ec2_hints' do\n let(:chef_run) { ChefSpec::SoloRunner.converge(des...
ruby
chosen
[ { "from": "system", "value": "Add rake as a development dep\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'henson/version'\n\nGem::Specification.new do |gem|\n gem.name ...
ruby
chosen
[ { "from": "human", "value": "Define spree_login_path, spree_logout_path, spree_signup_path inside BaseController decorator\n" }, { "from": "gpt", "value": "Spree::BaseController.class_eval do\n def spree_login_path\n spree.login_path\n end\n\n def spree_signup_path\n spree.signup_path\n...
ruby
chosen
[ { "from": "system", "value": "Use the correct module name\n" }, { "from": "human", "value": "require 'active_support/all'\nrequire 'fulcrum/version'\nrequire 'fulcrum/resource'\nrequire 'fulcrum/actions/list'\nrequire 'fulcrum/actions/find'\nrequire 'fulcrum/actions/create'\nrequire 'fulcrum/act...
ruby
chosen
[ { "from": "human", "value": "Create the first set of definitions\n" }, { "from": "gpt", "value": "default[:opencart][:home_dir] = '/opt/opencart'\ndefault[:opencart][:git_url] = 'https://github.com/opencart/opencart.git'\ndefault[:opencart][:url_path] = '/'\ndefault[:opencart][:rele...
ruby
chosen