conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add pry as development 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 'libsyn/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Remove old public_ids from redis.\n" }, { "from": "human", "value": "class EntryDeleter\n include Sidekiq::Worker\n sidekiq_options queue: :worker_slow\n\n def perform(feed_id)\n entry_limit = 500\n entry_count = Entry.where(feed_id: feed_id).count\n if ...
ruby
chosen
[ { "from": "system", "value": "Remove sleep to speed up effect\n" }, { "from": "human", "value": "module Helios\n class CylonEffect < Effect\n RED = [255,0,0]\n BLACK = [0,0,0]\n\n def initialize(args = {})\n lights = args.fetch('lights', [1, '..', 25])\n @lights = get_lights(...
ruby
chosen
[ { "from": "system", "value": "Update deprecation messages to print caller on own line\n" }, { "from": "human", "value": "module IceCube\n module Deprecated\n\n # Define a deprecated alias for a method\n # @param [Symbol] name - name of method to define\n # @param [Symbol] replacement -...
ruby
chosen
[ { "from": "system", "value": "Fix deprecation warning for RSpec 3\n" }, { "from": "human", "value": "require \"bbq/core\"\nrequire \"bbq/core/test_user\"\nrequire \"bbq/rspec/version\"\nrequire \"bbq/rspec/matchers\"\nrequire \"rspec/core\"\nrequire \"capybara/rspec/matchers\"\n\nmodule Bbq\n m...
ruby
chosen
[ { "from": "system", "value": "Fix dynamic error rendering for production\n\n* Explicitly specify to render html template\n" }, { "from": "human", "value": "class ErrorsController < ApplicationController\n skip_before_action :authenticate_user!, raise: false\n\n def show\n render status: sta...
ruby
chosen
[ { "from": "system", "value": "Make the actual search qith the query\n" }, { "from": "human", "value": "class SearchController < ApplicationController\n\n def index\n # This should be replaced by:\n page = params.fetch(:page, 1)\n query = params[:query]\n\n @results = DocumentcloudSe...
ruby
chosen
[ { "from": "human", "value": "Set up configuration file from opsworks env variables\n" }, { "from": "gpt", "value": "# Set up app's stack environment variables in the environment.\nnode[:deploy].each do |application, deploy|\n custom_env_template do\n application application\n deploy deplo...
ruby
chosen
[ { "from": "system", "value": "Raise ParseError on invalid json\n" }, { "from": "human", "value": "require 'multi_json'\nrequire 'hashr'\n\nmodule Magnum\n module Payload\n class Base\n include Magnum::Payload::MessageParser\n\n attr_reader :raw_data, :data\n attr_reader :skip,...
ruby
chosen
[ { "from": "system", "value": "Use rack-test instead of sinatra." }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"rack/authenticate/version\"\n\nGem::Specification.new do |s|\n s.name = \"rack-authenticate\"\n s.version...
ruby
chosen
[ { "from": "system", "value": "Remove downvotes and greatvotes for next images\n" }, { "from": "human", "value": "# The main class for getting the images\nclass KWApi < Sinatra::Base\n get '/stars/v1/images/all/?' do\n images = Starsgcsimage.all\n\n images_hash = []\n images.each do |im...
ruby
chosen
[ { "from": "system", "value": "Use system File class instead of Clipboard::File.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Clipboard\n module Cygwin\n extend self\n\n def paste(_ = nil)\n File.read(\"/dev/clipboard\")\n end\n\n def copy(data)\n ...
ruby
chosen
[ { "from": "system", "value": "Fix issue with referencing correct language column\n" }, { "from": "human", "value": "require 'active_support/concern'\n\nmodule WithLanguage\n extend ActiveSupport::Concern\n\n included do\n scope :with_language, -> (language) {\n if language\n whe...
ruby
chosen
[ { "from": "system", "value": "Update author serializer to reflect removal of Paperclip\n" }, { "from": "human", "value": "class AuthorSerializer < ActiveModel::Serializer\n attributes :id, :name, :avatar_url, :description\n\n\n def avatar_url\n object.avatar.url(:thumb)\n end\n\nend\n" }...
ruby
chosen
[ { "from": "human", "value": "Add an empty shell of an RTorCtl::RTorCtl.\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\nrequire 'bundler/setup'\nrequire 'citrus'\nrequire 'socket'\n\n# Load all of our grammars.\ndef load_grammars()\n\t# This is a really long way of saying ../grammars/.\n\t...
ruby
chosen
[ { "from": "system", "value": "Allow usage with Rails 4.x and 5.x\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"import_o_matic/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do...
ruby
chosen
[ { "from": "system", "value": "Add spec for abort setting the message of the SystemExit exception\n" }, { "from": "human", "value": "require File.expand_path('../../../spec_helper', __FILE__)\n\n# TODO: share with Kernel.abort, abort.\ndescribe \"Process.abort\" do\n before :each do\n @name =...
ruby
chosen
[ { "from": "system", "value": "Use temporary URL for rabbitmq plugin download\n" }, { "from": "human", "value": "remote_file \"#{node['gerrit']['install_dir']}/plugins/rabbitmq.jar\" do\n source \"https://github.com/TYPO3-infrastructure/gerrit-rabbitmq-plugin/releases/download/rabbitmq-1.5-SNAPS...
ruby
chosen
[ { "from": "human", "value": "Add test for resource bindings\n" }, { "from": "gpt", "value": "require_relative '../../integration/support/int_helper'\n#require 'core/app'\n\ndescribe Pakyow::App, '#resource' do\n include ReqResHelpers\n\n before do\n Pakyow::App.stage(:test)\n Pakyow.app....
ruby
chosen
[ { "from": "system", "value": "Add links to possibly related stuff\n" }, { "from": "human", "value": "require 'spec_helper'\n\nfeature 'Middleware integration' do\n scenario \"Integrating the middleware into the Rack stack\" do\n pending \"The expectation doesn't work, see http://stackoverflo...
ruby
chosen
[ { "from": "system", "value": "Remove potentially broken implementation dependant ordering\n" }, { "from": "human", "value": "module Twat::Endpoints\n class Base\n\n @@endpoint_set=nil\n\n def authorize_account(name)\n oauth_conf = oauth_options.merge ({ :site => url })\n\n oauth...
ruby
chosen
[ { "from": "system", "value": "Add more documentation for ec2_instance\n" }, { "from": "human", "value": "require_relative '../lib/convection'\n\nmodule Convection\n module Demo\n FOOBAR = Convection.template do\n description 'Demo Foobar'\n\n ec2_instance 'Foobar' do\n subne...
ruby
chosen
[ { "from": "system", "value": "Add Rails as explicit dependency\n\nClosed GH-109\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$LOAD_PATH.push File.expand_path(\"../lib\", __FILE__)\nrequire \"breadcrumbs_on_rails/version\"\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Increase aruba timeout from default of 3 seconds to 10.\n\ncucumber.feature takes longer than 3 seconds.\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'bundler'\nBundler.setup\n\nrequire 'aruba/cucumber'\n\nBefore do\n this_dir = File.dirname(__FIL...
ruby
chosen
[ { "from": "system", "value": "Revert \"Monkeypatch parser Scanner to catch long terminals\"\n\nThis reverts commit cd2caaa294643b2684ae3cb67b19f147de0b41e1.\n" }, { "from": "human", "value": "##\n# Require 'blacklight' before 'krikri/engine' to ensure that view order is\n# configured properly.\n...
ruby
chosen
[ { "from": "system", "value": "Check for deltas at a higher level first.\n\nOnly if deltas are enabled and exist for this model do we actually care if there are changes. This does mean things will be slightly slower on the first call (as indices are loaded to the point of knowing if deltas are in play), but ...
ruby
chosen
[ { "from": "system", "value": "Fix individual photo version processing\n" }, { "from": "human", "value": "class Admin::ProcessVersionJobsController < Admin::ApplicationController\n def create\n if album_slug\n if process_single_album\n head :created\n else\n head :unpr...
ruby
chosen
[ { "from": "human", "value": "Update notification_id primary key to bigint\n" }, { "from": "gpt", "value": "class ChangeNotificationIdToBigint < ActiveRecord::Migration[6.0]\n def up\n change_column :notifications, :id, :bigint\n end\n\n def down\n change_column :notifications, :id, :int...
ruby
chosen
[ { "from": "system", "value": "Add a note on TM_ envvars\n" }, { "from": "human", "value": "# This is both a constant and a module, since in Ruby those two\n# often go together. We avoid an extra item in the namespace\n# and an extra assignment.\nmodule STRICT_ENV\n VERSION = '0.0.1'\n Malforme...
ruby
chosen
[ { "from": "system", "value": "Modify list clean up job\n" }, { "from": "human", "value": "class ListCleanupJob < ActiveJob::Base\n queue_as :default\n\n # rescue_from(Gibbon::MailChimpError) do |exception|\n # end\n\n def perform(lists)\n gibbon_service = GibbonService.new\n contacts_d...
ruby
chosen
[ { "from": "system", "value": "Call override attributes before setting run list, attributes for mysql weren't taking precedence\n" }, { "from": "human", "value": "name \"flyway-mysql\"\ndescription \"flyway mysql demo\"\nenv_run_lists \"_default\" => %w[ apt openssl build-essential mysql::server ...
ruby
chosen
[ { "from": "system", "value": "Set fixture paths for unit tests\n\nThis change defines manifest_dir and module_path expicitly in unit\ntests so that modules installed under fixtures directory is properly\nloaded.\n\nCloses-Bug: #1930403\nChange-Id: Ic6af657059b55368897b04e2f537bb0b60298b31\n" }, { "f...
ruby
chosen
[ { "from": "system", "value": "Disable code coverage to see if it fixes travis" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\n\nrequire 'codeclimate-test-reporter'\nCodeClimate::TestReporter.start\n\nrequire 'pieces'\n\nROOT_DIR = File.dirname(__FILE_...
ruby
chosen
[ { "from": "system", "value": "Allow specs to be run with Postgres adapter\n" }, { "from": "human", "value": "require 'perpetuity'\n\nPerpetuity.data_source :mongodb, 'perpetuity_gem_test'\n" }, { "from": "gpt", "value": "require 'perpetuity'\n\nif ENV['PERPETUITY_ADAPTER'] == 'postgr...
ruby
chosen
[ { "from": "system", "value": "Exit with 'success' status when running 'rake spec'.\n" }, { "from": "human", "value": "$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')\nrequire 'rubygems'\nrequire 'bell'\nrequire 'spec'\n\nunless defined?(FIXTURES_PATH)\n FIXTURES_PATH = File.join(File....
ruby
chosen
[ { "from": "system", "value": "Add year to medicine usage display\n" }, { "from": "human", "value": "class MedicineUsage < ApplicationRecord\n include MyplaceonlineActiveRecordIdentityConcern\n include AllowExistingConcern\n\n validates :usage_time, presence: true\n \n child_properties(name:...
ruby
chosen
[ { "from": "system", "value": "Refactor Query to account for records w/ data attr\n\nNot all records returned by api responses have a data attribute\nSpecifically, those returned from a query for a singular record seem to\nlack a data attribute\n" }, { "from": "human", "value": "\nmodule RedditAp...
ruby
chosen
[ { "from": "system", "value": "Revert \"Back out logic to skip retries for unsubscribed numbers\"\n\nThis reverts commit e0c9e93b9128a129ff42b4890dfb44866d41eaab.\n" }, { "from": "human", "value": "module Citygram\n module Services\n module Channels\n class SMS < Base\n FROM_NUMBE...
ruby
chosen
[ { "from": "human", "value": "Add import script for mybb posts\n" }, { "from": "gpt", "value": "class MybbService\n\tdef self.convert_text(text)\n\t\ttext.gsub('[hr]', '<hr>').gsub(/\\[quote=\"[^\\]]+\\]/, '<blockquote>').gsub('[/quote]', '</blockquote>')\n\tend\n\n\t# note, I edited the posts.js...
ruby
chosen
[ { "from": "system", "value": "Disable RestClient timeout when querying SPARQL\n\nAlso, improve error handling of SPARQL proxy\n\nFixes CredentialEngine/CredentialRegistry#313\n" }, { "from": "human", "value": "# Proxies SPARQL requests to Neptune\nclass QuerySparql\n QUERY_TYPES = %w[query upda...
ruby
chosen
[ { "from": "system", "value": "Set default values if YAML file is missing\n" }, { "from": "human", "value": "module Pesapal\n\n class Railtie < Rails::Railtie\n\n initializer 'pesapal.load_credentials' do\n\n path_to_yaml = \"#{Rails.root}/config/pesapal.yml\"\n if File.exist?(path_...
ruby
chosen
[ { "from": "system", "value": "fix: Switch to safer Open3 to determine OS_VERSION\n\n" }, { "from": "human", "value": "# Copyright 2015 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You ma...
ruby
chosen
[ { "from": "system", "value": "Extend rake task to saturday\n" }, { "from": "human", "value": "namespace :import do\n\n task users: :environment do\n NokoService.import_users\n end\n\n task projects: :environment do\n NokoService.import_projects\n end\n\n desc \"Import new Noko entries...
ruby
chosen
[ { "from": "system", "value": "Fix bug rendering printed directory pdf in some cases.\n\nThis was being called on Family, and this part of the code assumed it would be called on Person.\n" }, { "from": "human", "value": "module ActiveRecord\n module Associations\n module ClassMethods\n d...
ruby
chosen
[ { "from": "human", "value": "Add spec for GitHub emojis\n" }, { "from": "gpt", "value": "require 'github_helper'\n\n# http://developer.github.com/v3/emojis/\nresource :emoji do\n extend Authorize\n authorize_with token: ENV['RSPEC_API_GITHUB_TOKEN']\n\n get '/emojis' do\n respond_with :ok\...
ruby
chosen
[ { "from": "system", "value": "Reduce the number of queries to find if member has seed of this crop\n" }, { "from": "human", "value": "module CropsHelper\n def display_seed_availability(member, crop)\n total_quantity = 0\n\n seeds = member.seeds.select { |seed| seed.crop.name == crop.name ...
ruby
chosen
[ { "from": "system", "value": "Remove unused argument from MemoryLogger constructor\n" }, { "from": "human", "value": "module Loady\n class MemoryLogger\n attr_reader :messages\n\n def initialize(options = {})\n @messages = []\n end\n\n def info(message)\n @messages << mess...
ruby
chosen
[ { "from": "system", "value": "Use Shipwireable module on Spree::Shipment\n" }, { "from": "human", "value": "module SolidusShipwire\n module Shipment\n prepend SolidusShipwire::Proxy\n\n def to_shipwire\n {\n orderId: id,\n orderNo: number,\n processAfterDate: pro...
ruby
chosen
[ { "from": "system", "value": "Use SouthGravity instead of CenterGravity for centering overlayed images\n" }, { "from": "human", "value": "module Teaas\n class Overlayer\n def self.overlay(original_img, overlay_img, options={})\n if options[:whitelisted_animation]\n overlay_animat...
ruby
chosen
[ { "from": "system", "value": "Fix haml dependency to <6\n" }, { "from": "human", "value": "$:.push File.expand_path('../lib', __FILE__)\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |s|\n s.name = 'flay-haml'\n s.version = '0.0.4'\n s.authors =...
ruby
chosen
[ { "from": "system", "value": "Update only the payment's number during migration.\n\nFixes #6327\nFixes #6328\n" }, { "from": "human", "value": "class EnsurePaymentsHaveNumbers < ActiveRecord::Migration\n def change\n Spree::Payment.where(number: nil).find_each do |payment|\n payment.gen...
ruby
chosen
[ { "from": "system", "value": "Use ENV Variable for getsentry\n" }, { "from": "human", "value": "require 'raven'\n\nRaven.configure do |config|\n config.dsn = 'https://166e257bdc0a4464b4aa03076d0a0cda:43cdd2f177b04fe3b7723422bbd9ea1b@app.getsentry.com/23443'\nend" }, { "from": "gpt", ...
ruby
chosen
[ { "from": "system", "value": "Update sum for explicit precedence\n" }, { "from": "human", "value": "class DwpMonitor\n\n def initialize\n dwp_results\n end\n\n def state\n if percent >= 50.0\n 'offline'\n elsif percent >= 25.0\n 'warning'\n else\n 'online'\n end\...
ruby
chosen
[ { "from": "system", "value": "Set default server port to 0 to fix problem with tests failing because port already in use\n" }, { "from": "human", "value": "\nrequire './lib/Maze'\nrequire './lib/Robot'\nrequire './lib/RobotState/Server'\nrequire './lib/Remotes/Serial'\nrequire './lib/Remotes/Xbe...
ruby
chosen
[ { "from": "system", "value": "Fix SmartyPants in markdown renderer\n" }, { "from": "human", "value": "class Forest::MarkdownRenderer < Redcarpet::Render::HTML\n include Redcarpet::Render::SmartyPants\n\n def self.options\n {\n hard_wrap: true,\n autolink: true,\n tables: true...
ruby
chosen
[ { "from": "system", "value": "Add Json to merchants index path\n" }, { "from": "human", "value": "class MerchantsController < ApplicationController\n def index\n @merchants = Merchant.all\n end\n\n def create\n @merchant = Merchant.new(merchant_params)\n end\n\n def new\...
ruby
chosen
[ { "from": "system", "value": "Revert \"Make sure new and updated look different\"\n\nThis reverts commit f89c97bd019c07b178c5dd7a78d8b91c8e8603c8.\n" }, { "from": "human", "value": "class PlatformsController < ApplicationController\n def index\n @platforms = Project.popular_platforms\n end\...
ruby
chosen
[ { "from": "system", "value": "Modify Questions controller to render json\n" }, { "from": "human", "value": "class QuestionsController < ApplicationController\n\n def index\n @questions = Question.all\n\n\n respond_to do |format|\n format.html\n format.json do\n render jso...
ruby
chosen
[ { "from": "system", "value": "Change boolean detecion from string to make entire function more robust.\n\nSigned-off-by: Krzysztof Wilczynski <9bf091559fc98493329f7d619638c79e91ccf029@linux.com>\n" }, { "from": "human", "value": "#\n# bool2num.rb\n#\n\nmodule Puppet::Parser::Functions\n newfunc...
ruby
chosen
[ { "from": "human", "value": "Add a migration to update old-style redirect unpublishings\n" }, { "from": "gpt", "value": "class UpdateOldRedirectUnpublishings < ActiveRecord::Migration[5.0]\n def up\n Unpublishing\n .where(type: :redirect)\n .where(redirects: nil)\n .find_each ...
ruby
chosen
[ { "from": "system", "value": "Set required_ruby_version to >= 2.0.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'git_snip/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Update gollum dependency to the lastest version.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'gitnesse/version'\n\nGem::Specification.new d...
ruby
chosen
[ { "from": "system", "value": "Add allow_blank to uniqueness validation of option type name\n" }, { "from": "human", "value": "module Spree\n class OptionType < Spree::Base\n acts_as_list\n\n has_many :option_values, -> { order(:position) }, dependent: :destroy, inverse_of: :option_type\n ...
ruby
chosen
[ { "from": "system", "value": "Update s3 plugin to v0.4.3\n" }, { "from": "human", "value": "dir 'plugin_gems'\ndownload \"td-client\", \"0.8.66\"\ndownload \"td\", \"0.11.5\"\ndownload \"fluent-plugin-td\", \"0.10.22\"\ndownload \"thrift\", \"0.8.0\"\ndownload \"fluent-plugin-scribe\", \"0.10.13...
ruby
chosen
[ { "from": "system", "value": "Update octokit dependency to latest version\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path('../lib', __FILE__)\n\nrequire 'pronto/version'\n\nGem::Specification.new do |s|\n s.name = 'pronto'\n s.version = Pronto:...
ruby
chosen
[ { "from": "system", "value": "Add link field to JustLooking Cask\n" }, { "from": "human", "value": "class Justlooking < Cask\n url 'http://chipmunkninja.com/download/JustLooking-3.3.3.dmg'\n homepage 'http://chipmunkninja.com/JustLooking'\n version '3.3.3'\n sha1 'ac082882d21e77c5c77e99f8fa7...
ruby
chosen
[ { "from": "system", "value": "Add missing dependencies to gemspec\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)\nrequire 'attribute_predicates/version'\n\nGem::Specification.new do |s|\n s.name = \"attribute_predicates\"\n s.version ...
ruby
chosen
[ { "from": "system", "value": "Refactor Ability so you can override admin functionality easier\n" }, { "from": "human", "value": "module CurationConcerns\n module Ability\n extend ActiveSupport::Concern\n included do\n self.ability_logic += [:curation_concerns_permissions]\n end\n\...
ruby
chosen
[ { "from": "system", "value": "Add gem description, summary, and homepage.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'subtle/version'\n\nGem::Specification.new do |gem|...
ruby
chosen
[ { "from": "system", "value": "Update chef-container to use new Omnibus APIs\n" }, { "from": "human", "value": "#\n# Copyright:: Copyright (c) 2012-2014 Chef Software, Inc.\n# License:: Apache License, Version 2.0\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may ...
ruby
chosen
[ { "from": "system", "value": "Upgrade stray legacy hash syntax to 1.9 syntax.\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass CustomRegistrationsControllerTest < ActionController::TestCase\n tests Custom::RegistrationsController\n\n include Devise::TestHelpers\n\n setup do\n...
ruby
chosen
[ { "from": "system", "value": "Change worker_processes because excloud server has 8 cores\n" }, { "from": "human", "value": "require 'dotenv'\nDotenv.load\n\n# paths\napp_path = ENV['DEPLOY_TO']\nworking_directory \"#{app_path}/current\"\npid \"#{app_path}/current/tmp/pids/unicorn.p...
ruby
chosen
[ { "from": "system", "value": "Revise the example on OpenBSD\n\ngit-svn-id: ab86ecd26fe50a6a239cacb71380e346f71cee7d@67101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e\n" }, { "from": "human", "value": "require_relative '../../spec_helper'\n\ndescribe \"File.birthtime\" do\n before :each do\n @file =...
ruby
chosen
[ { "from": "system", "value": "Support the environment whose long is 64bit.\n" }, { "from": "human", "value": "require File.expand_path('../spec_helper', __FILE__)\n\nload_extension(\"time\")\n\ndescribe \"CApiTimeSpecs\" do\n before :each do\n @s = CApiTimeSpecs.new\n end\n\n describe \"rb...
ruby
chosen
[ { "from": "system", "value": "Update the workflows JSON output.\n\nNow outputs title and description.\n" }, { "from": "human", "value": "json.array!(@workflows) do |workflow|\n json.extract! workflow, :id\n json.url workflow_url(workflow, format: :json)\nend\n" }, { "from": "gpt", ...
ruby
chosen
[ { "from": "system", "value": "Revise indent format for yml loading\n" }, { "from": "human", "value": "module BuildPluginHelpers\n def build_start_paypal_plugin(account_id = nil)\n if account_id.nil?\n plugin = build_plugin(::Killbill::PaypalExpress::PaymentPlugin, 'paypal_express')\n ...
ruby
chosen
[ { "from": "system", "value": "Fix name collision with expected method in blacklist\n\nInstead of expect `include?` method, which is defined in `Module`\nmodule, use `member?`. This still allow us to mock using a simple array\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nreq...
ruby
chosen
[ { "from": "human", "value": "Add stub for routing tests\n\n\ngit-svn-id: 801577a2cbccabf54a3a609152c727abd26e524a@1226 a18515e9-6cfd-0310-9624-afb4ebaee84e\n" }, { "from": "gpt", "value": "require \"#{File.dirname(__FILE__)}/../test_helper\"\n\nclass RoutingTest < ActionController::IntegrationTe...
ruby
chosen
[ { "from": "system", "value": "Fix for tests running against Rails 6\n" }, { "from": "human", "value": "require 'rails'\n\ndef require_migration(migration_name)\n path = MigrationData::ActiveRecord::Migration.migration_dir\n migrations = all_migrations(path)\n\n migration_name += '.rb' unless ...
ruby
chosen
[ { "from": "system", "value": "Allow for some console hacking\n\nMake `bundle console` and `irb -Ilib -rgriddler` work as expected.\n" }, { "from": "human", "value": "require 'griddler/errors'\nrequire 'griddler/engine'\nrequire 'griddler/email'\nrequire 'griddler/email_parser'\nrequire 'griddler...
ruby
chosen
[ { "from": "system", "value": "Fix stty warning when reading terminal size\n" }, { "from": "human", "value": "module Inch\n # The CLI module is tasked with the deconstruction of CLI calls\n # into API calls.\n #\n # @see Inch::API\n module CLI\n class << self\n # Returns the columns ...
ruby
chosen
[ { "from": "system", "value": "Add support for verifying the Kubernetes connection\n\nThis will prevent worker cycling when the Kubernetes endpoint is not\navailable.\n(transferred from ManageIQ/manageiq@51a2ddc09113bc25b046a7f2a18a24f6c872f34f)\n" }, { "from": "human", "value": "require \"spec_h...
ruby
chosen
[ { "from": "system", "value": "Fix coverage generation on Travis\n\nFailing build: https://travis-ci.org/neopoly/neo-rails/jobs/210938081\nFix from: https://github.com/codeclimate/ruby-test-reporter/blob/master/CHANGELOG.md#v100-2016-11-03\n" }, { "from": "human", "value": "if ENV['CODECLIMATE_RE...
ruby
chosen
[ { "from": "system", "value": "Add description for module tasks\n" }, { "from": "human", "value": "# A ModuleTask represents two file tasks: a dynamic library and an\n# associated .swiftmodule file.\n\nrequire 'rake'\nrequire 'rake/tasklib'\nrequire_relative 'group_task'\nrequire_relative 'dylib_...
ruby
chosen
[ { "from": "system", "value": "Use correct environment and add parameters\n" }, { "from": "human", "value": "class RakeJob\n\n def self.find_rake\n rake = %x{which rake}\n if rake.nil? or rake.empty?\n raise RakeNotInstalledException\n end\n rake.chomp\n end\n\n def initialize...
ruby
chosen
[ { "from": "system", "value": "Move comment where it belongs\n" }, { "from": "human", "value": "module Wingtips\n class Configuration\n attr_reader :slide_classes\n\n def initialize(path)\n path = File.expand_path(path)\n dir = File.dirname(path)\n Dir[File.join(dir, \"slid...
ruby
chosen
[ { "from": "system", "value": "Bring chargeback rates buttons back\n\nHidden since fd0e99728920fc2ee3491dba1e46349d0d0206a0.\n(transferred from ManageIQ/manageiq@20940f46183c9ecde3cedf01576146b36e02e936)\n" }, { "from": "human", "value": "class ApplicationHelper::Button::ChargebackRates < Applica...
ruby
chosen
[ { "from": "system", "value": "Install lsof for integration tests\n" }, { "from": "human", "value": "# encoding: UTF-8\n#\n# Cookbook Name:: mumble_server_test\n# Recipe:: default\n#\n# Copyright 2014, Onddo Labs, SL.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you ...
ruby
chosen
[ { "from": "system", "value": "Change destination of the config file\n" }, { "from": "human", "value": "#\n# Cookbook Name:: osl_application_python_test\n# Recipe:: default\n#\n# Copyright 2015, OSU Open Source Lab\n#\n# Licensed under the Apache License, Version 2.0 (the 'License');\n# you may n...
ruby
chosen
[ { "from": "system", "value": "Fix name of world location model\n\nThis was changed in https://github.com/alphagov/whitehall/pull/3384 but the type should still be “world location” whereas whitehall-admin can refer to the pages as “world location news”.\n" }, { "from": "human", "value": "class Wo...
ruby
chosen
[ { "from": "system", "value": "Add unit test for users.\n\nCheck the absent user is really absent.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'users', :type => 'class' do\n context 'with defaults for all parameters' do\n it { should compile.with_all_deps }\n it { ...
ruby
chosen
[ { "from": "human", "value": "Add the spec for the hash fetcher\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\nrequire 'observed/hash/fetcher'\n\ndescribe Observed::Hash::Fetcher do\n\n subject {\n described_class.new(hash)\n }\n\n context 'when the source hash is nil' do\n\n ...
ruby
chosen
[ { "from": "system", "value": "Adjust meaning of a string parameter passed as an argument to be the specified header name rather than treated like a symbol, this makes it a bit cleaner to specify a header name when no sub-attribute/method needs to be called (eg. created_at 'Date').\n" }, { "from": "h...
ruby
chosen
[ { "from": "system", "value": "Refactor validations to create methods\n" }, { "from": "human", "value": "module Emotions\n class Emotion < ActiveRecord::Base\n self.table_name = 'emotions'\n\n # Validations\n validates :emotional, presence: true\n validates :emotive, presence: true\n...
ruby
chosen
[ { "from": "system", "value": "Split display_menu() into two methods.\n" }, { "from": "human", "value": "module Nesta\n module Navigation\n module Renderers\n def display_menu(menu, options = {})\n defaults = { :class => nil, :levels => 2 }\n options = defaults.merge(option...
ruby
chosen
[ { "from": "system", "value": "Allow save options to be passed in to archive! method\n" }, { "from": "human", "value": "require 'active_support/concern'\n\nmodule Archivable\n module Model\n extend ActiveSupport::Concern\n\n module ClassMethods\n def archived\n scoped(condition...
ruby
chosen
[ { "from": "system", "value": "Use Ruby version-specific retry exception list for SSL socket\n" }, { "from": "human", "value": "require \"socket\"\n\nmodule Bunny\n begin\n require \"openssl\"\n\n # TLS-enabled TCP socket that implements convenience\n # methods found in Bunny::Socket.\n...
ruby
chosen
[ { "from": "system", "value": "Fix require for Async Queue\n" }, { "from": "human", "value": "require 'cloudwatch_rails/version'\nrequire 'cloudwatch_rails/railtie' if defined?(Rails)\nrequire 'cloudwatch_rails/config'\nrequire 'cloudwatch_rails/async_queue' if defined?(Rails)\n\nmodule Cloudwatc...
ruby
chosen
[ { "from": "system", "value": "Kill not used constant since removal of runner method\n\nRunner method was removed in ada571bfcdbad669ae43a4dd18277ef227680a0b.\n" }, { "from": "human", "value": "require 'active_support/concern'\nrequire 'active_support/callbacks'\n\nmodule ActiveSupport\n module ...
ruby
chosen
[ { "from": "system", "value": "Read output before waiting for process to end\n\nSometimes a subprocess will not exit until it was able to write its\noutput to stdout/stderr. By waiting _after_ we read the subprocess\noutput, we avoid this potential bug.\n" }, { "from": "human", "value": "require ...
ruby
chosen