conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Rename rake task to reflect action better.\n" }, { "from": "human", "value": "require 'rake/tasklib'\n\nmodule Chicago\n # Rake tasks for a Chicago project.\n class RakeTasks < Rake::TaskLib\n def initialize(db)\n @migration_dir = \"migrations\"\n @db...
ruby
chosen
[ { "from": "human", "value": "Add scratch idea for QB::Ansible::Module::Response\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\n# Requirements\n# =======================================================================\n\n# Stdlib\n# ---------------------------------------------...
ruby
chosen
[ { "from": "system", "value": "Fix DiscoverRunnerJob when srdc_id is nil\n" }, { "from": "human", "value": "class DiscoverRunnerJob < ApplicationJob\n queue_as :discover_runner\n\n def perform(run)\n srdc_runner_id = SpeedrunDotCom::Run.runner_id(run.srdc_id)\n return if srdc_runner_id.ni...
ruby
chosen
[ { "from": "system", "value": "Handle error when listing partitions\n" }, { "from": "human", "value": "require_relative '../command'\n\nmodule AmazonAthena\n module Commands\n class ShowPartitions < AmazonAthena::Command\n\n def initialize(database_table)\n @database_table = datab...
ruby
chosen
[ { "from": "system", "value": "Remove extraneous blank line from source code\n" }, { "from": "human", "value": "require 'test_helper'\n\n\n# See https://github.com/metaskills/minitest-spec-rails#test-styles\nclass IntegrationTest < ActionDispatch::IntegrationTest\n\n describe 'signing up' do\n ...
ruby
chosen
[ { "from": "system", "value": "Change to page with signout link\n\nMinor hack to account for the fact that signout isn't yet shown on every\npage.\n" }, { "from": "human", "value": "Given(/^I am a signed in admin$/) do\n admin = create(:case_worker, :admin)\n visit new_user_session_path\n sign...
ruby
chosen
[ { "from": "human", "value": "Add OseqFlowcellRun. This uses the oseq_flowcell table, but is able to parse a nested structure\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\n# OseqFlowcellRun\nclass OseqFlowcellRun < ActiveRecord::Base\n self.table_name = 'oseq_flowcell'\n\n i...
ruby
chosen
[ { "from": "system", "value": "Use guard clause in Helm::InstallCommand\n" }, { "from": "human", "value": "module Gitlab\n module Kubernetes\n module Helm\n class InstallCommand\n include BaseCommand\n\n attr_reader :name, :files, :chart, :version, :repository\n\n de...
ruby
chosen
[ { "from": "system", "value": "Add validation to posts comments\n\n" }, { "from": "human", "value": "class Post::PostComment < ApplicationRecord\n\n self.table_name = \"post_comments\"\n belongs_to :user\n belongs_to :post\n\nend\n" }, { "from": "gpt", "value": "class Post::P...
ruby
chosen
[ { "from": "system", "value": "Add new options for role payment types\n\nAdds the options:\n- Paid as a whip\n- Paid as a consultant\n\nRequested by a publisher so they can more accurately represent people in their organisation.\n" }, { "from": "human", "value": "class RolePaymentType\n include ...
ruby
chosen
[ { "from": "system", "value": "Make it easy to look up a field by its name.\n" }, { "from": "human", "value": "module Templatr\n class Template < ActiveRecord::Base\n validates :name, :presence => true, :uniqueness => {:case_sensitive => false}\n\n def self.templatable_class\n self.to...
ruby
chosen
[ { "from": "system", "value": "Enforce consistent ordering of strings across postgres distibutions\n\nDifferences in postgres distributions and hosts OS appear to cause\ndifferent handling of braces when ordering by strings. For example\npostgres 9.6 on alpine and postgres 9.6 on darwin/apple order strings\n...
ruby
chosen
[ { "from": "system", "value": "Update rake to latest (fixes ruby 2.7 deprecation warnings)\n" }, { "from": "human", "value": "require File.expand_path(\"lib/resqued/version\", File.dirname(__FILE__))\nGem::Specification.new do |s|\n s.name = \"resqued\"\n s.version = Resqued::VERSION\n s.su...
ruby
chosen
[ { "from": "human", "value": "Add a test file for BMFF::Box::DataReference.\n" }, { "from": "gpt", "value": "# coding: utf-8\n# vim: set expandtab tabstop=2 shiftwidth=2 softtabstop=2 autoindent:\n\nrequire_relative '../../minitest_helper'\nrequire 'bmff/box'\nrequire 'stringio'\n\nclass TestBMFF...
ruby
chosen
[ { "from": "system", "value": "Add .pre for next release\n" }, { "from": "human", "value": "module EY\n VERSION = '2.1.2'\n ENGINEYARD_SERVERSIDE_VERSION = ENV['ENGINEYARD_SERVERSIDE_VERSION'] || '2.1.3'\nend\n" }, { "from": "gpt", "value": "module EY\n VERSION = '2.1.3.pre'\n ENG...
ruby
chosen
[ { "from": "system", "value": "Update spec file to point to version 0.2.0\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"NPReachability\"\n s.version = \"0.1.0\"\n s.summary = \"Reachability without the suck.\"\n s.homepage = \"https://github.com/Ab...
ruby
chosen
[ { "from": "system", "value": "Fix persistence generator for Rails 3 use\n" }, { "from": "human", "value": "require 'rails/generators/migration'\nrequire 'rails/generators/active_record'\n\nclass PersistenceGenerator < Rails::Generators::Base\n\n include Rails::Generators::Migration\n\n desc \"...
ruby
chosen
[ { "from": "system", "value": "Set deployment environment to Staging\n" }, { "from": "human", "value": "require 'halfday/helpers/cset'\nrequire 'halfday/helpers/require_recipe'\n\nCapistrano::Configuration.instance(:must_exist).load do\n # Stages\n # Load 3rd party recipes\n require_recipe \"b...
ruby
chosen
[ { "from": "system", "value": "Fix early bird date should not be empty\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass Site\n module HasTicketOptions\n extend ActiveSupport::Concern\n\n TICKET_OPTIONS = [\n # Price\n :ticket_student_price,\n :ticket...
ruby
chosen
[ { "from": "system", "value": "Check slide number before setting\n\ndont advance over the end or before 1\n" }, { "from": "human", "value": "module CommandDeck\n class Runner\n\n attr_accessor :deck\n\n def initialize(args)\n @current = args.fetch(:start, 1)\n p @current\n @...
ruby
chosen
[ { "from": "system", "value": "Make scss-lint Git hook actually work\n\nThe `require` was failing due to a typo in the name.\n\nRelated Story:\n http://www.pivotaltracker.com/story/show/41566653 (fixed)\n (\"Make scss-lint Git hook actually work\")\n\nChange-Id: I3b828e02816dbd06be4b654e8124d463b87f9d3b\nR...
ruby
chosen
[ { "from": "human", "value": "Add an acceptance test to prove that default encoding is wrong on Debian\n" }, { "from": "gpt", "value": "require 'spec_helper_acceptance'\n\n# These tests are designed to ensure that the module, when ran with defaults,\n# sets up everything correctly and allows us t...
ruby
chosen
[ { "from": "human", "value": "Add specs to confirm Emojicom rendering\n\ni.e. Emojicom should not be rendered on landing pages\n" }, { "from": "gpt", "value": "require \"rails_helper\"\n\nRSpec.feature \"Emojicom rendering\" do\n context \"home page\" do\n scenario \"does not display emojicom...
ruby
chosen
[ { "from": "system", "value": "Allow for init_Foo() syntax in C files\n" }, { "from": "human", "value": "# Handles the Init_Libname() method\nclass YARD::Handlers::C::InitHandler < YARD::Handlers::C::Base\n MATCH = %r{\\A\\s*(?:static\\s+)?void\\s+Init_(\\w+)\\s*}\n handles MATCH\n statement_c...
ruby
chosen
[ { "from": "system", "value": "Fix issue with authentifications step" }, { "from": "human", "value": "Then /^(?:|I )authenticate on \"([^\"]*)\" with \"([^\"]*)\" account$/ do |service, name|\n VCR.use_cassette(\"authentication_#{service.underscore}\", :erb => {:name => name.downcase} ) do\n ...
ruby
chosen
[ { "from": "system", "value": "Create `path_to` method (alias of `url_for`)\n" }, { "from": "human", "value": "module Munge\n module Helpers\n module Link\n def url_for(item)\n @router.route(item)\n end\n\n def link_to(item, text = nil, opts = {})\n link = url_for...
ruby
chosen
[ { "from": "system", "value": "Upgrade rest-client gem to resolve security issue with password leaking\n" }, { "from": "human", "value": "require 'rake'\nrequire './lib/earth_tools/version'\n\nGem::Specification.new do |gem|\n gem.name = \"earth_tools\"\n gem.version = EarthTools::VERSION\n ...
ruby
chosen
[ { "from": "system", "value": "Fix missing argument from Attr initializer" }, { "from": "human", "value": "require \"formalist/form/definition\"\n\nmodule Formalist\n class Form\n class Attr\n include Definition.with_builders(:group, :section, :field)\n\n attr_reader :name\n\n ...
ruby
chosen
[ { "from": "system", "value": "Remove point ref in Plant.rb for now\n" }, { "from": "human", "value": "# A single organism living in the ground.\nclass Plant < ActiveRecord::Base\n DEFAULT_ICON = \"/app-resources/img/icons/generic-plant.svg\"\n belongs_to :device\n belongs_to :point\n delegat...
ruby
chosen
[ { "from": "system", "value": "Replace wrong trim.squeeze with split.join\n" }, { "from": "human", "value": "class Query < ActiveRecord::Base\n has_one :query_result\n\n validates :name, :query_string, presence: true\n validates :name, uniqueness: true\n\n FORMATS = ['article', 'boo...
ruby
chosen
[ { "from": "system", "value": "Bump the version so we can pin the old one and test this in PP\n" }, { "from": "human", "value": "maintainer \"Opscode, Inc.\"\nmaintainer_email \"cookbooks@opscode.com\"\nlicense \"Apache 2.0\"\ndescription \"Sets up sources for Ubuntu Linux...
ruby
chosen
[ { "from": "system", "value": "Refactor Immedialist::RottenTomatoes::Movie: extract method (query_api)\n" }, { "from": "human", "value": "module Immedialist\n module RottenTomatoes\n class Movie < APIResource\n include Immedialist::RottenTomatoes\n\n def initialize(imdb_id)\n ...
ruby
chosen
[ { "from": "system", "value": "Remove a pending specification since the bug in Parser has been fixed\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'spec_helper'\n\ndescribe Rubocop::Cop::Lint::AmbiguousRegexpLiteral do\n subject(:cop) { described_class.new }\n\n before do\n ...
ruby
chosen
[ { "from": "system", "value": "Remove unused DefaultCacheStore (tests already have this)\n" }, { "from": "human", "value": "module QuickTravel\n module Cache\n def cache(key, cache_options = {}, &block)\n QuickTravel::Cache.cache(key, cache_options) do\n block.call\n end\n ...
ruby
chosen
[ { "from": "human", "value": "Add script for calculating progress toward content goals\n" }, { "from": "gpt", "value": "# This replicates analysis LiAnna used to run on Wikimetrics, showing the total content progress as of the 15th and 30th of each month for each term.\n\ncampaign = Campaign.find...
ruby
chosen
[ { "from": "system", "value": "Fix campaign current action test\n" }, { "from": "human", "value": "require 'test_helper'\n\nmodule Backend\n class CampaignsControllerTest < ActionController::TestCase\n test_restfully_all_actions except: :open\n\n test 'open action in post mode' do\n p...
ruby
chosen
[ { "from": "system", "value": "Add update method to users controller\n" }, { "from": "human", "value": "module Api\n module V1\n module MyCw\n class UsersController < MyCwController\n # Gets the current user\n def current\n render json: @current_user\n end\n...
ruby
chosen
[ { "from": "system", "value": "Update tests to account for changes to upstream error messages\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'support/editor'\n\nRSpec.feature \"Highlighting the output\", type: :feature, js: true do\n before do\n visit '/'\n editor.set(co...
ruby
chosen
[ { "from": "human", "value": "Migrate languages to new code\n" }, { "from": "gpt", "value": "class ArticleVersion < ActiveRecord::Base\nend\n\nclass MigrateLanguages < ActiveRecord::Migration\n Models = [Article, ArticleVersion]\n def up\n Models.each do |model|\n model.where(language: ...
ruby
chosen
[ { "from": "system", "value": "Add BBC iPlayer Downloads appcast" }, { "from": "human", "value": "class BbcIplayerDownloads < Cask\n version :latest\n sha256 :no_check\n\n url 'https://www.bbc.co.uk/iplayer/dm/downloads/mac/latest'\n homepage 'http://www.bbc.co.uk/iplayer/install'\n license ...
ruby
chosen
[ { "from": "system", "value": "Use Data Science Toolkit as the Geocoder for now\n\n> Geocoder.search(\"Paris, France\")\n=> [#<Geocoder::Result::Dstk:0x000000062c5050 @data={\"types\"=>[\"locality\", \"political\"], \"geometry\"=>{\"location\"=>{\"lat\"=>48.85341, \"lng\"=>2.3488}, \"location_type\"=>\"APPRO...
ruby
chosen
[ { "from": "system", "value": "Add conditions for Scrivito workspace configuration\n" }, { "from": "human", "value": "USING_SCRIVITO = false\nScrivito.configure do |config|\n #\n # Uncomment following lines in order to explicitly set the tenant and the API key.\n # If not explicitly set, the t...
ruby
chosen
[ { "from": "system", "value": "Use PAGE_SIZE instead of hardcoded 1\n\nIn read_events_forward - which happens to make all tests pass at current\nstage where we have only one method not being delegated to old client.\n" }, { "from": "human", "value": "require \"forwardable\"\n\nmodule RubyEventSto...
ruby
chosen
[ { "from": "system", "value": "Add description for retab task\n" }, { "from": "human", "value": "namespace :whitespace do\n desc 'Removes trailing whitespace'\n task :cleanup do\n sh %{find . -name '*.rb' -exec sed -i '' 's/ *$//g' {} \\\\;}\n end\n task :retab do\n sh %{find . -name '*...
ruby
chosen
[ { "from": "system", "value": "Cover resources in do_nothing matchers" }, { "from": "human", "value": "module ChefSpec::Matchers\n class DoNothingMatcher\n def matches?(resource)\n @resource = resource\n\n if @resource\n actions = @resource.performed_actions\n actions....
ruby
chosen
[ { "from": "human", "value": "Add new formula for the Instant Client Basic.\n" }, { "from": "gpt", "value": "require File.expand_path(\"../../Strategies/cache_wo_download\", __FILE__)\n\n# A formula that installs the Instant Client Basic package.\nclass InstantclientBasic < Formula\n desc \"Orac...
ruby
chosen
[ { "from": "system", "value": "Make text spec stop lying about its kind\n" }, { "from": "human", "value": "require 'spec_helper'\n\nmodule Abc\n module Adapters\n module Persistence\n module Repositories\n describe Text do\n it \"should be of kind page\" do\n T...
ruby
chosen
[ { "from": "system", "value": "Add foreign key check to fk_exists_between method\n" }, { "from": "human", "value": "def conn\n ActiveRecord::Base.connection\nend\n\nRSpec.shared_examples 'Foreign Keys' do |from_table, to_table, fk|\n context 'Permissions Foreign Keys', if: conn.supports_foreign...
ruby
chosen
[ { "from": "system", "value": "Update to latest producing 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 \"emque/stats/version\"\n\nGem::Specification.new do |spec|\n spec.na...
ruby
chosen
[ { "from": "system", "value": "Add method for closest by coord along with closest by coord and bus num\n" }, { "from": "human", "value": "class BusStop < ActiveRecord::Base\n\n\n\tdef self.find_closest_by_coord_and_bus(lon,lat,num)\n\t\tstop = self.find_by_sql(\"SELECT * from bus_stops WHERE (bus...
ruby
chosen
[ { "from": "system", "value": "Validate presence of user and genotype on UserSnp\n" }, { "from": "human", "value": "class UserSnp < ActiveRecord::Base\n belongs_to :snp, foreign_key: :snp_name, primary_key: :name, :counter_cache => true\n belongs_to :user\n belongs_to :genotype\n\n validates_...
ruby
chosen
[ { "from": "system", "value": "Add commentable_type to invalid_comment factory.\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :comment do\n user_id { Faker::Number.number(1) }\n commentable_id { 1 }\n body { Faker::Lorem.sentence }\n\n factory :q_comment do\n ...
ruby
chosen
[ { "from": "system", "value": "Make sure DatabaseCleaner.clean runs AFTER Capybara's cleanup\n" }, { "from": "human", "value": "RSpec.configure do |config|\n config.before(:suite) do\n DatabaseCleaner.clean_with(:truncation)\n end\n\n config.before(:each) do\n DatabaseCleaner.strategy = ...
ruby
chosen
[ { "from": "system", "value": "rpearce: Add temporary hack to disable enc data output for proxy\nservers. This is going to be coming from puppet for the shared proxy.\n" }, { "from": "human", "value": "require 'stacks/namespace'\n\nclass Stacks::ProxyServer < Stacks::MachineDef\n attr_reader :vi...
ruby
chosen
[ { "from": "system", "value": "Remove rescue block for better debugging\n" }, { "from": "human", "value": "module PiggybakBraintree\n module PaymentDecorator\n extend ActiveSupport::Concern\n\n included do\n attr_accessor :payment_method_nonce\n\n validates :payment_method_nonce,...
ruby
chosen
[ { "from": "system", "value": "Add required empty hash param for BundleTest\n" }, { "from": "human", "value": "require_relative '../test_helper'\n\nclass BundleTest < Test::Unit::TestCase\n\n def test_example_bundle\n client = FHIR::Client.new(\"feed-test\")\n root = File.expand_path '..',...
ruby
chosen
[ { "from": "human", "value": "Add podspec for version 1.3.2\n" }, { "from": "gpt", "value": "Pod::Spec.new do |s|\n s.name = 'DFCache'\n s.version = '1.3.2'\n s.license = 'MIT'\n s.homepage = 'https://github.com/kean/DFCache'\n s.authors = 'Alexander Grebenyuk'\n s.summary = 'Co...
ruby
chosen
[ { "from": "system", "value": "Add a check to support both RSpec 3 & 4\n\nRSpec 4 has removed OperatorMatcher, as it was only supported by the\nshould syntax, and not expect syntax.\n" }, { "from": "human", "value": "if defined?(ActiveRecord::Relation)\n RSpec::Matchers::BuiltIn::OperatorMatcher...
ruby
chosen
[ { "from": "system", "value": "Fix url with custom domains\n" }, { "from": "human", "value": "require_dependency 'profile'\n\nclass Profile\n\n Metadata = {\n 'og:type' => \"#{MetadataPlugin.og_type_namespace}:#{MetadataPlugin.og_types[:profile]}\",\n 'og:image' => proc{ |p, c| \"#{p.envir...
ruby
chosen
[ { "from": "system", "value": "Set dependency to match >= 0.20.0dev\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"RKJSONKitSerialization\"\n s.version = \"0.20.0\"\n s.summary = \"A RestKit serialization format implementation for JSON using JSONKit.\"\n...
ruby
chosen
[ { "from": "system", "value": "Add session file to gemspec\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'isa'\n s.version = '1.0.0'\n s.date = '2014-02-17'\n s.summary = 'Image Session Analyzer'\n s.description = 'Analysis tool for investi...
ruby
chosen
[ { "from": "system", "value": "Use older version of excon so faraday doesn't break" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"elasticsearch/version\"\n\nGem::Specification.new do |s|\n s.name = \"elasticsearch-clie...
ruby
chosen
[ { "from": "human", "value": "Add uuid to saveable_multiple_choice_rationale_choices table.\n\n- Add uuid to saveable_multiple_choice_rationale_choices table.\n" }, { "from": "gpt", "value": "class AddUuidToSaveableMultipleChoiceRationaleChoices < ActiveRecord::Migration\n def change\n add_co...
ruby
chosen
[ { "from": "system", "value": "Add transaction public id to notifications\n" }, { "from": "human", "value": "require 'faraday'\nrequire 'faraday_middleware'\nrequire 'multi_json'\n\nclass NotificationService\n class GcmClient\n def initialize\n @conn = Faraday.new('https://gcm-http.googl...
ruby
chosen
[ { "from": "human", "value": "Adjust contributors view to handle with rejected project\n" }, { "from": "gpt", "value": "class AdjustContributorsToRejected < ActiveRecord::Migration\n def up\n execute %Q{\nCREATE OR REPLACE VIEW \"1\".\"contributors\" AS \n SELECT u.id,\n u.id AS user_id,\n...
ruby
chosen
[ { "from": "human", "value": "Add migration for new contact_people fields\n" }, { "from": "gpt", "value": "class UpdateContactPeople < ActiveRecord::Migration\n def change\n add_column :contact_people, :first_name, :string\n add_column :contact_people, :last_name, :string\n add_column :...
ruby
chosen
[ { "from": "system", "value": "Update mocha require for new version\n" }, { "from": "human", "value": "require 'pathname'\nrequire 'rspec'\nrequire 'rspec/autorun'\nrequire 'mocha'\n\nSpecRoot = Pathname.new File.expand_path('..', __FILE__)\n$LOAD_PATH.unshift(SpecRoot)\n$LOAD_PATH.unshift(File.j...
ruby
chosen
[ { "from": "system", "value": "Set up the spec helper for schema_dev.\n" }, { "from": "human", "value": "$LOAD_PATH.unshift(__dir__)\n$LOAD_PATH.unshift(File.join(__dir__, '..', 'lib'))\n\nrequire 'rspec'\nrequire 'active_record'\nrequire 'schema_plus/core'\n\nDir[__dir__ + '/support/**/*.rb'].ea...
ruby
chosen
[ { "from": "system", "value": "Update initial to take args hash\n" }, { "from": "human", "value": "require_relative 'tic_tac_toe'\n\nclass Game\n\n attr_accessor :gametype, :ui\n\n def initialize(gametype = nil, ui = nil)\n @ui = ui\n @gametype = gametype\n end\n\n def user_move(index_p...
ruby
chosen
[ { "from": "system", "value": "Change the unique constraints on the asset group name to apply only within a leaf of the hierarchy.\n" }, { "from": "human", "value": "class CreateAssetGroups < ActiveRecord::Migration\n def change\n create_table :asset_groups do |t|\n t.string :type, ...
ruby
chosen
[ { "from": "system", "value": "Add missing documentation for Static visitors\n" }, { "from": "human", "value": "module Veritas\n module Adapter\n module Arango\n class Visitor\n class Static < self\n\n # Return root node\n #\n # @return [AQL::Node]\n ...
ruby
chosen
[ { "from": "system", "value": "Add task to import footnotes\n" }, { "from": "human", "value": "namespace :usda do\n desc 'Import the latest USDA nutrition data'\n task import: :environment do\n UsdaNutrientDatabase::Importer.new('tmp/usda', 'sr25').import\n end\n\n desc 'Import the USDA we...
ruby
chosen
[ { "from": "system", "value": "Add TODO note about recently added functionality.\n" }, { "from": "human", "value": "require \"active_support/core_ext\"\n\nrequire 'nark/middleware'\nrequire 'nark/exceptions'\nrequire 'nark/plugin'\nrequire 'nark/report_broker'\n\n#\n# This middleware is the basis...
ruby
chosen
[ { "from": "system", "value": "Fix iOS10 crashing when image picker is called\n\nWhen presenting a `UIImagePickerController` the app would crash because\n`visibleViewController` was `nil` when being called by the navigation\ncontroller.\n\nThe actual changes to iOS10 implementation of `visibleViewController`...
ruby
chosen
[ { "from": "system", "value": "Allow importing posts with attachments\n" }, { "from": "human", "value": "require 'faraday_middleware'\n\nclass TentClient\n module Middleware\n class ContentTypeHeader < Faraday::Middleware\n CONTENT_TYPE_HEADER = 'Content-Type'.freeze\n MEDIA_TYPE = ...
ruby
chosen
[ { "from": "system", "value": "Add new parameter -d or --directory for setting storage destination path.\n" }, { "from": "human", "value": "require 'tors/version'\nrequire 'tors/search'\nrequire 'colorize'\nrequire 'optparse'\n\nmodule TorS\n options = {}\n OptionParser.new do |opts|\n opts....
ruby
chosen
[ { "from": "system", "value": "Define collection and resource as helpers methods.\n\nUsefull if inherited module is no used in a controller.\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'zobi/inherited'\nrequire 'zobi/decorated'\nrequire 'zobi/controlled_access'\nrequire 'zobi/...
ruby
chosen
[ { "from": "system", "value": "Add specs for the notifications matcher\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe ChefSpec::Matchers::NotificationsMatcher do\n pending\nend\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe ChefSpec::Matchers...
ruby
chosen
[ { "from": "system", "value": "Fix crash where prefs.yml is missing\n" }, { "from": "human", "value": "require 'yaml'\n\nclass Preference\n include Radiodan::Logging\n\n def initialize(*config)\n @options = config.shift\n @path = @options[:file_path]\n @defaults = @options[:defaul...
ruby
chosen
[ { "from": "system", "value": "Fix bug that TableElement throws an error while processing table without thead\n" }, { "from": "human", "value": "require 'kosi'\n\nmodule Slacken\n class TableElement\n attr_reader :header, :columns\n def initialize(children)\n thead, tbody = children.s...
ruby
chosen
[ { "from": "system", "value": "Improve Mouth::Ext:Chat.reply that can assign user param both string\n\nand symb.\n" }, { "from": "human", "value": "require 'slatan/affiliation'\nrequire 'slatan/buttocks'\n\nmodule Slatan\n module Mouth\n module Ext\n module Chat\n @category = 'cha...
ruby
chosen
[ { "from": "system", "value": "Fix to properly export multiline strings.\n" }, { "from": "human", "value": "module SuperExport\n class Exporter\n include SharedMethods\n \n def self.export\n SuperExport.models.each do |model|\n Exporter.new(model).export\n end\n end\...
ruby
chosen
[ { "from": "human", "value": "Add task to refresh certs\n" }, { "from": "gpt", "value": "desc 'Refresh app TLS certificates'\ntask refresh_certs: :environment do\n RefreshSSLCertificateService.new(\n heroku_api_key: ENV['HEROKU_API_KEY'],\n heroku_app_name: ENV['HEROKU_APP_NAME']\n ).call...
ruby
chosen
[ { "from": "system", "value": "Add better error message for reason to not use check API\n" }, { "from": "human", "value": "require 'travis/addons/handlers/base'\nrequire 'travis/addons/handlers/task'\nrequire 'travis/addons/handlers/github_status'\n\nmodule Travis\n module Addons\n module Han...
ruby
chosen
[ { "from": "system", "value": "Fix single node execute inspec test to check for just a single node\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "describe command('etcdctl member list') do\n its(:exit_status) { should eq 0 }\n i...
ruby
chosen
[ { "from": "human", "value": "Add jeckle config to spec fixtures" }, { "from": "gpt", "value": "\nJeckle::Setup.register(:my_super_api) do |api|\n api.base_uri = 'http://my-super-api.com.br'\n api.headers = { 'Content-Type' => 'application/json' }\n api.logger = Logger.new(STDOUT)\n ...
ruby
chosen
[ { "from": "system", "value": "Add more tests for .check method\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'simple_webmon'\n\ndescribe SimpleWebmon do\n before(:all) do\n FakeWeb.allow_net_connect = false\n\n FakeWeb.register_uri(:get, \"http://good.example.com/\",\n...
ruby
chosen
[ { "from": "system", "value": "Add 'minitest/pride' to encourage testing." }, { "from": "human", "value": "require 'simplecov'\nrequire 'pry'\nrequire 'minitest/autorun'\nrequire 'minitest/hell'\n\nSimpleCov.start do\n command_name 'MiniTest::Spec'\n add_filter '/test/'\nend unless ENV['no_si...
ruby
chosen
[ { "from": "system", "value": "Fix missing mocha gem, we don't need it anymore\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\nrequire 'banco_central'\n\nrequire 'active_support'\nrequire 'active_support/test_case'\nrequire 'minitest/autorun'\nrequir...
ruby
chosen
[ { "from": "system", "value": "Define the gem files using a Dir glob instead of git list\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'guard/maven/version'\n\nGem::Specification.new...
ruby
chosen
[ { "from": "system", "value": "Refactor ivar name to be a Symbol\n" }, { "from": "human", "value": "# encoding: utf-8\n\n# Module that adds descendant tracking to a class\nmodule DescendantsTracker\n\n # Return the descendants of this class\n #\n # @example\n # descendants = ParentClass.des...
ruby
chosen
[ { "from": "system", "value": "Add a logic to automaticaly figure out applicable endpoints\n" }, { "from": "human", "value": "require 'bunny'\n\nmodule MetricPulse\n module Logger\n class Base\n ROUTING_KEYS = [\"new_relic_logger\", \"honeybadger_logger\"]\n\n class << self\n ...
ruby
chosen
[ { "from": "system", "value": "Make the map pipe more robust." }, { "from": "human", "value": "module Pacer::Pipes\n class MapPipe < RubyPipe\n def initialize(back, block)\n super()\n @block = block\n @back = back\n @graph = back.graph\n @extensions = back.extensions ...
ruby
chosen
[ { "from": "system", "value": "Disable HTTP2 multiplexing due to invalid json responses\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nnamespace :surfline_v2 do\n desc 'Update forecast from Surfline v2 API'\n task update: %w[environment forecasts:set_batch_id] do\n inclu...
ruby
chosen
[ { "from": "human", "value": "Add SolrSource class, which simply iterates over all documents matching query and filter constraints to be returned. This is suitable for use with a Mapper and the Indexer to pull documents (stored fields only) from one Solr instance to another.\n\ngit-svn-id: 3b1ff1236863b4d63...
ruby
chosen
[ { "from": "system", "value": "Make the testing data work on hosts with no 'nat-pmp' /etc/services entry.\n" }, { "from": "human", "value": "# -*- ruby -*-\n#encoding: utf-8\n\nrequire 'arborist'\n\nArborist::Host 'duir' do\n\tdescription \"Router box\"\n\taddress '192.168.16.1'\n\n\ttags :infras...
ruby
chosen
[ { "from": "system", "value": "Use faraday adapters of typhoeus\n" }, { "from": "human", "value": "Elasticsearch::Model.client = Elasticsearch::Client.new(\n hosts: [\n {\n host: ENV['ELASTICSEARCH_HOST'] || '192.168.42.1',\n port: ENV['ELASTICSEARCH_PORT'] || '9200',\n }\n ]\n)...
ruby
chosen
[ { "from": "system", "value": "Add quotes around expected LDAP password\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'freeradius::ldap' do\n include_context 'redhat_common_dependencies'\n\n let(:title) { 'test' }\n\n let(:params) do\n {\n identity: 'cn=root,dc=e...
ruby
chosen
[ { "from": "system", "value": "Refactor test to match temp dir on regex\n" }, { "from": "human", "value": "describe WinRM::FileManager, :integration => true do\n let(:service) { winrm_connection }\n let(:src_file) { __FILE__ }\n let(:dest_file) { File.join(subject.temp_dir, 'winrm_filemanager_...
ruby
chosen
[ { "from": "system", "value": "Convert list spec to rspec3 syntax\n" }, { "from": "human", "value": "require \"spec_helper\"\nrequire \"opsicle/list\"\n\nmodule Opsicle\n describe List do\n subject { List.new('derp') }\n\n context \"#execute\" do\n let(:client) { double }\n let(:...
ruby
chosen