conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Make https variable emulation removable if already added\n" }, { "from": "human", "value": "https_map = <<-eos\n map $scheme $https {\n default \"\";\n https on;\n }\neos\n\nfile \"#{node['nginx']['dir']}/conf.d/https.conf\" do\n content https_map\n ow...
ruby
chosen
[ { "from": "system", "value": "Update my solution with output\n" }, { "from": "human", "value": "# Math Methods\n\n# I worked on this challenge by myself.\n\n# Your Solution Below\n\ndef add(num_1, num_2)\n num_1 + num_2\nend\n\ndef subtract(num_1, num_2)\n num_1 - num_2\nend\n\ndef multiply(num_...
ruby
chosen
[ { "from": "system", "value": "Change requirements for abandoned channels\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass CleanAbandonedSiteChannelsJobTest < ActiveJob::TestCase\n test \"cleans abandoned site channels older than one day\" do\n publisher = publishers(:medium_...
ruby
chosen
[ { "from": "system", "value": "Add extra space to distinguish options better\n" }, { "from": "human", "value": "# -*- encoding : utf-8 -*-\n\nmodule PPCurses\n\n RADIO_NOT_SELECTED = 'â—Ž'\n RADIO_SELECTED = 'â—‰'\n\n class RadioButtonGroup < View\n\n attr_accessor :selected\n attr_accessor ...
ruby
chosen
[ { "from": "system", "value": "Fix deprecation warning on ruby 2.4.0\n\nlib/rspec/parameterized/table_syntax.rb:30: warning: constant ::Fixnum is deprecated\nlib/rspec/parameterized/table_syntax.rb:34: warning: constant ::Bignum is deprecated\n" }, { "from": "human", "value": "require 'binding_of...
ruby
chosen
[ { "from": "system", "value": "Add 'Security' framework into the spec file\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"TreasureData-iOS-SDK\"\n s.version = \"0.0.6\"\n s.summary = \"TreasureData SDK for iOS.\"\n s.license = \"Apache\"\n s.autho...
ruby
chosen
[ { "from": "system", "value": "Remove default attribute that caused windows chef runs to fail\n\nThe same default value was already set in the recipe. Removing it here\nshould result in the same outcome without failing chef runs on windows.\n" }, { "from": "human", "value": "# instead of using h...
ruby
chosen
[ { "from": "system", "value": "Add test for part of to_summary functionality\n\nSmall test but I think it's worth a test for the functionality that translates to a string, removes the @ and then symbolizes again.\n" }, { "from": "human", "value": "require 'spec_helper'\n\nmodule Vcloud\n module ...
ruby
chosen
[ { "from": "system", "value": "Add v1 prefixes for convenience.\n" }, { "from": "human", "value": "require 'sinatra'\n\nclass App < Sinatra::Base\n get('/success') do\n status 200\n end\n\n post('/404') do\n status 404\n end\n \n post('/503') do\n status 503\n end\nend\n\nrun App...
ruby
chosen
[ { "from": "system", "value": "Fix a Devise deprecation warning in the tests\n" }, { "from": "human", "value": "RSpec.configure do |config|\n # Add Devise's helpers for controller tests\n config.include Devise::TestHelpers, type: :controller\nend\n" }, { "from": "gpt", "value": "RSp...
ruby
chosen
[ { "from": "system", "value": "Add User factory for testing\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :hero do\n name 'McCree'\n role 'offense'\n end\n\n factory :map do\n name 'Dorado'\n map_type 'escort'\n end\n\n factory :map_segment do\n map\n n...
ruby
chosen
[ { "from": "system", "value": "Add full_name to user factory\n" }, { "from": "human", "value": "FactoryGirl.define do\n sequence :secure_password do\n Forgery(:basic).password(allow_special: true)\n end\n\n sequence :sorcery_random_token do\n Sorcery::Model::TemporaryToken.generate_rando...
ruby
chosen
[ { "from": "system", "value": "Revert \"Comment file related to screenshot archiver, that is not being used\"\n\nThis reverts commit 4e88297dac731d39a4cd6e8907caf3563cbc6f86.\n" }, { "from": "human", "value": "module MediaScreenshotArchiver\n extend ActiveSupport::Concern\n\n# def screenshot_sc...
ruby
chosen
[ { "from": "system", "value": "Update per_page/total_pages to pull from filtered object\n" }, { "from": "human", "value": "module ElocalApiSupport\n module Actions\n module Index\n def index\n render json: {\n current_page: current_page,\n per_page: per...
ruby
chosen
[ { "from": "system", "value": "Replace __FILE__ with __dir__ to fix Rubocop offense" }, { "from": "human", "value": "require File.expand_path('../lib/jekyll_asset_pipeline/version', __FILE__)\n\nGem::Specification.new do |s|\n # Metadata\n s.name = 'jekyll_asset_pipeline'\n s.version = JekyllA...
ruby
chosen
[ { "from": "system", "value": "Add unit Test for product\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\nclass ...
ruby
chosen
[ { "from": "human", "value": "Add token column to invites table\n" }, { "from": "gpt", "value": "class AddTokenToInvite < ActiveRecord::Migration\n def self.up\n add_column :invites, :token, :string\n end\n\n def self.down\n remove_column :invites, :token\n end\nend\n" } ]
ruby
chosen
[ { "from": "human", "value": "Add BytedanceAds SDK v2.4.6.7 but have CoreLocation\n" }, { "from": "gpt", "value": "Pod::Spec.new do |s|\n name = \"BytedanceAds\"\n version = \"2.4.6.7\"\n\n s.name = \"Yumi#{name}\"\n s.version = version\n s.summary = \"Yumi#{name}.\"\n s.d...
ruby
chosen
[ { "from": "system", "value": "Add ruby version dependency. (for bsearch)\n" }, { "from": "human", "value": "lib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'wareki/version'\n\nGem::Specification.new do |spec|\n spec.name = \"...
ruby
chosen
[ { "from": "system", "value": "Add tag stanza to Firefox Nightly JA\n" }, { "from": "human", "value": "cask :v1 => 'firefox-nightly-ja' do\n version '40.0a1'\n sha256 :no_check # required as upstream package is updated in-place\n\n url \"https://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/...
ruby
chosen
[ { "from": "human", "value": "Add task to delete people activities on a site\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nnamespace :gobierto_people do\n desc \"Delete people activities on a site\"\n task :delete_activities, [:site_domain] => [:environment] do |_t, args|\n ...
ruby
chosen
[ { "from": "system", "value": "Make it compatible with the newest http.rb version (3.0.0)\n\nhttp.rb 3.0.0 have introduced HTTP::Request::Body abstraction (\nhttps://github.com/httprb/http/pull/412) - let's make webmock compatible\nwith it.\n" }, { "from": "human", "value": "module HTTP\n class ...
ruby
chosen
[ { "from": "system", "value": "Use explicit String for author's name\n\nThis prevents a strange YAML dump in .hitch_authors, i.e.\n!ruby HighLine::String\n\ncloses #15\n" }, { "from": "human", "value": "HighLine.track_eof = false\n\nmodule Hitch\n class UI\n\n def self.prompt_for_group_email\...
ruby
chosen
[ { "from": "system", "value": "Update rubocop to fix vulnerability CVE-2017-8418\n\nRuboCop 0.48.1 and earlier does not use /tmp in safe way, allowing\nlocal users to exploit this to tamper with cache files belonging to\nother users.\n" }, { "from": "human", "value": "# encoding: UTF-8\nlib = Fil...
ruby
chosen
[ { "from": "system", "value": "Use a on-disk database for testing\n" }, { "from": "human", "value": "require \"test/unit\"\nrequire \"rr\"\nrequire \"extlib\"\nrequire \"dm-sweatshop\"\nrequire \"context\"\nrequire \"pending\"\n\nrequire \"integrity\"\nrequire \"fixtures\"\n\nbegin\n require \"r...
ruby
chosen
[ { "from": "system", "value": "Fix null values in EnvValue\n" }, { "from": "human", "value": "require 'pkgr/env_value'\n\nmodule Pkgr\n class Env\n attr_reader :variables\n\n def self.from_export(file)\n new(File.read(file).split(\"\\n\").map { |line| line.sub(/^export\\s+/, \"\") })\...
ruby
chosen
[ { "from": "system", "value": "Add LICENSE to gemspec files\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'haproxy_log_parser'\n s.version = IO.read('VERSION').chomp\n s.authors = ['Toby Hsieh']\n s.homepage = 'https://github.com/tobyhs/haproxy_log_parser'\n s.s...
ruby
chosen
[ { "from": "system", "value": "[Sender] Use the proper CocoaPods subdomain\n" }, { "from": "human", "value": "require 'rest'\n\nmodule CocoaPodsStats\n class Sender\n API_URL = 'http://stats-cocoapods-org.herokuapp.com/api/v1/install'\n\n def send(targets, pod_try: false)\n REST.post(...
ruby
chosen
[ { "from": "system", "value": "Add classifications accessible from WebService\n" }, { "from": "human", "value": "require \"httparty\"\nrequire \"json\"\nrequire \"ostruct\"\nrequire \"rodzilla/version\"\nrequire \"rodzilla/resource/base\"\nrequire \"rodzilla/resource/product\"\nrequire \"rodzilla...
ruby
chosen
[ { "from": "system", "value": "Disable setting whiny_nils when using Rails 4.0.0 and later.\n" }, { "from": "human", "value": "Rails.env = ENV['RAILS_ENV'] || 'test'\n\nmodule Combustion\n class Application < Rails::Application\n # Core Settings\n config.cache_classes = true\...
ruby
chosen
[ { "from": "system", "value": "Set dependency to rails ~> 4.1\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"blankplate-rails/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |...
ruby
chosen
[ { "from": "system", "value": "Make sure we're operating inside the bundle\n" }, { "from": "human", "value": "require 'rubygems'\n\nENV['RACK_ENV'] ||= 'development'\n\nrequire File.join(File.dirname(__FILE__), 'lib/metrics-api.rb')\n\nuse(Rack::Cors) do\n allow do\n origins '*'\n resource...
ruby
chosen
[ { "from": "system", "value": "Add spacing and y-min/max to bar chart sparkline example.\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n#\n# Print a tiny bar chart and hide the axes using a div which is slightly\n# smaller than the chart image.\n#\n\n$:.unshift(File.join(File.dirname(__F...
ruby
chosen
[ { "from": "system", "value": "Add default playlist to new user account\n" }, { "from": "human", "value": "class Api::V1::UsersController < ApplicationController\n\n def create\n @user = User.new(user_params)\n if @user.save\n render 'users/user_with_token.json.jbuilder', user: @user\...
ruby
chosen
[ { "from": "system", "value": "Update spec helper with rspec defaults\n" }, { "from": "human", "value": "# Configure Rails Envinronment\nENV[\"RAILS_ENV\"] = \"test\"\nrequire File.expand_path(\"../dummy/config/environment\", __FILE__)\n\nrequire 'rspec/rails'\nrequire \"json\"\n\nENGINE_RAILS_R...
ruby
chosen
[ { "from": "system", "value": "Fix weird spacing issues in file" }, { "from": "human", "value": "require \"utep_sso/version\"\nrequire 'savon'\n\nmodule UTEPSSO\n @client = Savon.client(wsdl: 'http://websvs.utep.edu/databaseservices/public/ExternalSignon.asmx?wsdl')\n\n #{:get_user_by_ssiu_res...
ruby
chosen
[ { "from": "system", "value": "Update InitiationType enumeration from spec\n" }, { "from": "human", "value": "module Enumerations\n InitiationType = %w[\n charge_sheet\n postal_requisition\n summons\n ]\nend\n" }, { "from": "gpt", "value": "module Enumerations\n Initiation...
ruby
chosen
[ { "from": "system", "value": "Refactor to reduce complexity from O(n*2) to O(n)\n\nA class is only a direct descendant if its superclass is self.\n\nFixes https://github.com/rails/rails/pull/37487\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass Class\n # Returns an arr...
ruby
chosen
[ { "from": "system", "value": "Fix homepage to use SSL in Postbox Cask\n\nThe HTTP URL is already getting redirected to HTTPS. Using the HTTPS URL directly\nmakes it more secure and saves a HTTP round-trip.\n" }, { "from": "human", "value": "cask :v1 => 'postbox' do\n version '4.0.0'\n sha256 '...
ruby
chosen
[ { "from": "system", "value": "Fix checksum in Thunder.app Cask\n" }, { "from": "human", "value": "cask :v1 => 'thunder' do\n version '2.6.7.1706'\n sha256 '974de57f80e110f1a2001b7bf0b2e60edc28fd6a2234f8f2574ea49c8c6598ff'\n\n # sandai.net is the official download host per the vendor homepage\...
ruby
chosen
[ { "from": "system", "value": "Bump to 2.2.0 for release\n" }, { "from": "human", "value": "# Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n# documentation f...
ruby
chosen
[ { "from": "system", "value": "Move the model reload detect regex to help method\n" }, { "from": "human", "value": "require 'hashid/rails/version'\nrequire 'hashids'\nrequire 'active_record'\n\nmodule Hashid\n module Rails\n\n # Get configuration or load defaults\n def self.configuration\n...
ruby
chosen
[ { "from": "system", "value": "Support for TCP and WebSockets is now on the same level, follows support for separate port and mode configuration\n" }, { "from": "human", "value": "# -*- encoding : utf-8 -*-\nmodule JSTP\n VERSION = \"0.1.0\"\nend\n" }, { "from": "gpt", "value": "# -*...
ruby
chosen
[ { "from": "system", "value": "Change env variable name for mongo\n\n seems like now for some reason heroku gives it another name, than before\n" }, { "from": "human", "value": "require 'mongo'\n\nclass MongoClient\n attr_reader = :client\n\n def initialize(params)\n @client = Mongo::Client...
ruby
chosen
[ { "from": "system", "value": "Raise error if Rails logger class is not found\n" }, { "from": "human", "value": "require \"multi_logger/version\"\n\nmodule MultiLogger\n class << self\n def add_logger(name, path=nil)\n name = name.to_s\n rails_logger_class = get_rails_logger_class()...
ruby
chosen
[ { "from": "system", "value": "Use built in URI library to encode urls for supersearch\n" }, { "from": "human", "value": "class SuperSearch\n\tdef self.url\n\t\t\"http://search.alaska.dev/\"\n\tend\n\tdef self.query_param_for(item_name)\n\t\titem_name.gsub(/\\s+/, '+')\n\tend\n\tdef self.url_for(...
ruby
chosen
[ { "from": "system", "value": "Use fail instead of raise\n" }, { "from": "human", "value": "# Sysctl\nmodule Sysctl\n class << self\n def config_file(node)\n return nil unless node['sysctl']['conf_dir'] || node['sysctl']['allow_sysctl_conf']\n\n node['sysctl']['conf_file']\n end\...
ruby
chosen
[ { "from": "system", "value": "Fix comment to reflect current API\n" }, { "from": "human", "value": "require_relative 'binary_operator_operator'\n\nmodule ConceptQL\n module Operators\n # Base class for all temporal operators\n #\n # Subclasses must implement the where_clause method whi...
ruby
chosen
[ { "from": "system", "value": "Add suggested build environment packages for debian/ubuntu\n\nhttps://github.com/sstephenson/ruby-build/wiki#suggested-build-environment" }, { "from": "human", "value": "# encoding: utf-8\n\nnode[:rtn_rbenv] ||= {}\n\npackages = []\npackages << 'gcc'\npackages << 'g...
ruby
chosen
[ { "from": "system", "value": "Update TG Pro.app to v2.7.1\n" }, { "from": "human", "value": "cask :v1 => 'tg-pro' do\n version '2.6'\n sha256 '2b84e6dbae6516584c8303fc7e7305026b7c62cf9eec94435bb8ee68c8859824'\n\n url \"http://www.tunabellysoftware.com/resources/TGPro_#{version.gsub('.','_')}....
ruby
chosen
[ { "from": "system", "value": "Add lib to Ruby's load path\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\nrequire 'markety/version'\n\nGem::Specification.new do |s|\n s.name = \"markety\"\n s.version = Markety::VERSION\n s.summary = \"Marke...
ruby
chosen
[ { "from": "system", "value": "Update Day-O to version 2.0\n" }, { "from": "human", "value": "cask 'day-o' do\n version :latest\n sha256 :no_check\n\n url 'http://shauninman.com/assets/downloads/Day-O.zip'\n name 'Day-O'\n homepage 'http://www.shauninman.com/archive/2011/10/20/day_o_mac_menu...
ruby
chosen
[ { "from": "system", "value": "Add get_published for a single published post\n" }, { "from": "human", "value": "module Cortex\n class Posts < Cortex::Resource\n def query(params = {})\n client.get('/posts', params)\n end\n\n def feed(params = {})\n client.get('/posts/feed', p...
ruby
chosen
[ { "from": "system", "value": "Fix to attr_accessor from attr_reader\n" }, { "from": "human", "value": "class Autotest\n module Twitter\n def self.config\n @@config ||= Config.new\n end\n\n def self.configure\n yield config if block_given?\n end\n\n class Config\n a...
ruby
chosen
[ { "from": "system", "value": "Set ca_file path for heroku\n" }, { "from": "human", "value": "require \"net/https\"\nrequire \"uri\"\n\nmodule EventMachine\n module C2DM\n class Auth\n CLIENT_LOGIN_URL = \"https://www.google.com/accounts/ClientLogin\"\n\n # This call blocks the reac...
ruby
chosen
[ { "from": "system", "value": "Add RSpec as a development dependency\n\nSigned-off-by: Wincent Colaiuta <c76ac2e9cd86441713c7dfae92c451f3e6d17fdc@wincent.com>\n" }, { "from": "human", "value": "require File.expand_path('lib/mkdtemp/version.rb', File.dirname(__FILE__))\n\nGem::Specification.new do...
ruby
chosen
[ { "from": "system", "value": "Load rb-inotify when jQuery is working, rather than when it's not.\n" }, { "from": "human", "value": "require 'rbconfig'\n\nmodule FSSM::Support\n class << self\n def backend\n @@backend ||= case\n when mac? && !jruby? && carbon_core?\n 'FSE...
ruby
chosen
[ { "from": "system", "value": "Add help and project specifier\n" }, { "from": "human", "value": "module Marooned\n class CLI\n def initialize(argv)\n @argv = argv\n end\n\n def run\n global_options.parse!(@argv)\n end\n\n def global_options\n OptionParser.new do |op...
ruby
chosen
[ { "from": "system", "value": "Fix the regexp more strict\n" }, { "from": "human", "value": "require 'no_proxy_fix/version'\n\nmodule NoProxyFix\n require 'cext/generic_find_proxy' if RUBY_VERSION =~ /2\\.4\\.[10].*/\nend\n" }, { "from": "gpt", "value": "require 'no_proxy_fix/version...
ruby
chosen
[ { "from": "system", "value": "Set minimum deployment target of podspec to 8.0 to match the project settings.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"DEjson\"\n s.version = \"1.0.2\"\n s.summary = \"JSON parser and serializer in pure swift.\"\n s...
ruby
chosen
[ { "from": "system", "value": "Disable fixtures during deployment by default\n" }, { "from": "human", "value": "server \"dev.symfony.webplates.xyz\", user: \"webplates\", roles: [:app, :db, :web]\n\nset :composer_install_flags, \"--no-interaction --quiet --optimize-autoloader\"\n\nset :symfony_en...
ruby
chosen
[ { "from": "system", "value": "Use mkdir_p instead of mkdir\n" }, { "from": "human", "value": "module GrapeDoc \n class DOCGenerator \n attr_accessor :resources, \n :formatter, \n :single_file\n def initialize(resource_path)\n begin\n require r...
ruby
chosen
[ { "from": "system", "value": "Add a bit of more intelligent formatting to JSON output\n\nThere's no way to make everyone happy, but some things can be\nstandardized a bit.\n\ne.g. having Refs on a single line makes a lot of sense.\n\nSigned-off-by: Evan Owen <a31932a4150a6c43f7c4879727da9a731c3d5877@gmail.c...
ruby
chosen
[ { "from": "system", "value": "Include original error in ConnectionError\n" }, { "from": "human", "value": "require \"faraday\"\nrequire \"uri\"\nrequire \"stacker_bee/middleware/signed_query\"\nrequire \"stacker_bee/middleware/detokenizer\"\n\nmodule StackerBee\n class ConnectionError < Standar...
ruby
chosen
[ { "from": "system", "value": "Change some fields to writable\n" }, { "from": "human", "value": "module MdiCloudDecoder \n class Track \n attr_reader :id,\n :asset,\n :location_provided,\n :latitude,\n :longitude,\n :received_at,\n :recorded_at,\n :field...
ruby
chosen
[ { "from": "system", "value": "Add save_and_review to permitted params\n" }, { "from": "human", "value": "# This file initializes Tolaria's default configuration, which the developer\n# is expected to override.\n#\n# Please see lib/generators/tolaria/install/templates/tolaria_initializer.rb\n# an...
ruby
chosen
[ { "from": "human", "value": "Add rake task to export the entire trade db in csv files and then zipped\n" }, { "from": "gpt", "value": "require 'zip'\nrequire 'fileutils'\nnamespace :export do\n task :trade_db => :environment do\n RECORDS_PER_FILE = 500000\n ntuples = RECORDS_PER_FILE\n ...
ruby
chosen
[ { "from": "system", "value": "Make textile_to_markdown task convert feedback\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nnamespace :publify do\n desc \"Convert content in Textile format to Markdown\"\n task textile_to_markdown: :environment do\n Content.find_each do ...
ruby
chosen
[ { "from": "system", "value": "Fix gravatar_id to use email.\n\nThis is a temporary fix for travis-ci/travis-ci#2837, until the\nsync is fixed.\n" }, { "from": "human", "value": "module Travis\n module Api\n module V2\n module Http\n class User\n include Formats\n\n ...
ruby
chosen
[ { "from": "system", "value": "Add yammer_network_id to yammer staging strategy\n" }, { "from": "human", "value": "require 'omniauth-oauth2'\n\nmodule OmniAuth\n module Strategies\n class YammerStaging < OmniAuth::Strategies::OAuth2\n # Give your strategy a name.\n option :name, 'ya...
ruby
chosen
[ { "from": "system", "value": "Make sure composer and composer.phar owner is the same\n" }, { "from": "human", "value": "include_recipe \"php::multi\"\n\nphpenv_path = \"#{node.travis_build_environment.home}/.phpenv\"\n\nnode[:php][:multi][:versions].each do |php_version|\n\n bin_path = \"#{phpe...
ruby
chosen
[ { "from": "system", "value": "Raise podspec version to 0.1.0\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"Kakapo\"\n s.version = \"0.0.1\"\n s.summary = \"Dynamically Mock server behaviors and responses.\"\n\n s.description = <<-DESC...
ruby
chosen
[ { "from": "system", "value": "Allow Channels call from Places to define options\n" }, { "from": "human", "value": "module Carbonculture\n class Place\n include HTTParty\n attr_accessor :name, :organisation_name, :data, :body\n\n def initialize(name, org_name)\n self.name = name\n ...
ruby
chosen
[ { "from": "system", "value": "Add GET endpoint for builds\n" }, { "from": "human", "value": "require 'sinatra'\nrequire 'json'\nrequire 'mail'\n\nclass PGQuilter::Builder < Sinatra::Base\n # validate and store a build request; to be picked up by a worker\n post '/build' do\n payload = JSON....
ruby
chosen
[ { "from": "system", "value": "2215: Move $PATH to the end of PATH to get the right Ruby\n" }, { "from": "human", "value": "set :branch, 'staging'\nset :ping_url, \"https://staging.getelmo.org\"\nset :user, 'cceom'\nset :home_dir, '/home/cceom'\nset :use_sudo, false\nset(:deploy_to) {\"#{home_dir...
ruby
chosen
[ { "from": "system", "value": "MAke sure categories have all the translations\n" }, { "from": "human", "value": "RSpec.feature 'Category', type: :feature do\n describe 'when a category is assigned to tags' do\n\n let!(:ada) {FactoryBot.create(:published, topic_list: ['fruehling'])}\n let!(...
ruby
chosen
[ { "from": "system", "value": "Add block device mapping helper to asg launch_config\n" }, { "from": "human", "value": "require_relative '../resource'\n\nmodule Convection\n module Model\n class Template\n class Resource\n ##\n # AWS::AutoScaling::LaunchConfiguration\n ...
ruby
chosen
[ { "from": "system", "value": "Use Sinatra's request object instead of set default method\n" }, { "from": "human", "value": "require 'sinatra'\nrequire 'json'\n\nget '/' do\n result.to_json\nend\n\nget '/path/to/resource' do\n result.to_json\nend\n\npost '/' do\n result.tap {|res| res['method'...
ruby
chosen
[ { "from": "system", "value": "Fix builder to use referencia instead of reference\n" }, { "from": "human", "value": "module CorreiosSigep\n module Builders\n module XML\n class Sender\n def initialize(builder, sender)\n @builder = builder\n @sender = sender\n ...
ruby
chosen
[ { "from": "system", "value": "Add deprecation warning on git-deploy-key strategy\n" }, { "from": "human", "value": "module DPL\n class Provider\n module Heroku\n class GitDeployKey < GitSSH\n def needs_key?\n false\n end\n\n def check_auth\n super\...
ruby
chosen
[ { "from": "system", "value": "Remove the chunk size argument and reinstate the test on the `Catalog::all` method\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe RsrGroup::Catalog do\n\n let(:sample_dir) { File.expand_path(File.join(Dir.pwd, 'spec', 'samples')) }\n let(:ftp...
ruby
chosen
[ { "from": "system", "value": "Make app available to options\n\nSeems to have been broken by 95fe0b9\n" }, { "from": "human", "value": "require 'image_optim'\n\nclass ImageOptim\n # Adds image_optim as preprocessor for gif, jpeg, png and svg images\n class Railtie < Rails::Railtie\n initiali...
ruby
chosen
[ { "from": "system", "value": "Use file.rewind before yielding for upload\n" }, { "from": "human", "value": "module Avocado\n class Uploader\n include Singleton\n\n attr_accessor :payload\n\n def initialize\n @payload = []\n end\n\n def upload!\n return unless should_upl...
ruby
chosen
[ { "from": "system", "value": "Fix double slash after login\n" }, { "from": "human", "value": "class ExercismApp < Sinatra::Base\n get '/logout' do\n logout\n redirect root_path\n end\n\n if ENV['RACK_ENV'] == 'development'\n get '/backdoor' do\n if User.count == 0\n flash...
ruby
chosen
[ { "from": "system", "value": "Add host to db back task\n" }, { "from": "human", "value": "require 'date'\n\nnamespace :collegestar do\n desc \"Use pg_dump to backup collegestar database\"\n task backup_db: :environment do\n sh \"PGPASSWORD=\\\"#{ENV['DB_PASS']}\\\" pg_dump -h localhost -U #...
ruby
chosen
[ { "from": "system", "value": "Fix failing test that used incorrect select ID\n" }, { "from": "human", "value": "require 'spec_helper'\n\nRSpec.describe \"Store promotion rule\", js: true do\n stub_authorization!\n\n let!(:store) { create(:store, name: \"Real fake doors\") }\n let!(:promotion)...
ruby
chosen
[ { "from": "system", "value": "Remove unneeded tests for the sass converter plugin.\n" }, { "from": "human", "value": "require 'helper'\n\nclass TestSass < Test::Unit::TestCase\n def converter(overrides = {})\n Jekyll::Converters::Sass.new(site_configuration({\"sass\" => overrides}))\n end\n...
ruby
chosen
[ { "from": "system", "value": "Add milliseconds to Logger timestamp\n" }, { "from": "human", "value": "module Discordrb\n # Logs debug messages\n class Logger\n # @return [true, false] whether or not this logger should be in debug mode (all debug messages will be printed)\n attr_writer :d...
ruby
chosen
[ { "from": "system", "value": "Remove shell_escape method because it was unused\n" }, { "from": "human", "value": "unless Hash.method_defined?(:recursive_with_indifferent_access)\n class Hash\n def recursive_with_indifferent_access\n hash = with_indifferent_access\n\n hash.each do |...
ruby
chosen
[ { "from": "system", "value": "Modify Boom::Color to extend itself (easier to test).\n" }, { "from": "human", "value": "# coding: utf-8\n\nmodule Boom\n\n # Color collects some methods for colorizing terminal output.\n module Color\n\n CODES = {\n :reset => \"\\e[0m\",\n\n :magen...
ruby
chosen
[ { "from": "system", "value": "Use filter only when it is not empty\n" }, { "from": "human", "value": "module Atmosphere\n class VmTemplateMonitoringWorker\n include Sidekiq::Worker\n\n sidekiq_options queue: :monitoring\n sidekiq_options retry: false\n\n def perform(site_id)\n ...
ruby
chosen
[ { "from": "system", "value": "Change test assertions for compatibility with resque v1 and v2.\n" }, { "from": "human", "value": "require 'test_helper'\n\n# make sure the worlds not fallen from beneith us.\nclass ResqueTest < Minitest::Test\n def test_resque_version\n major, minor, patch = Re...
ruby
chosen
[ { "from": "system", "value": "Test for values which truncated trailing \"=\".\n" }, { "from": "human", "value": "require \"test/unit\"\nrequire \"otp/base32\"\n\nclass TestBase32 < Test::Unit::TestCase\n def assert_encode(encoded, plain)\n assert_equal(encoded, ::OTP::Base32.encode(plain))\n...
ruby
chosen
[ { "from": "system", "value": "Change IsNumeric to a module and include it to String class instead of openning directly\n" }, { "from": "human", "value": "require 'is_numeric/version'\n\n# Extending the class String to perform checks on string to get\n# if is a number\nclass String\n def numeric...
ruby
chosen
[ { "from": "system", "value": "Save ENV on activate! and restore on deactivate!\n\nrather than overriding [] and []=.\n\nNote that it makes child processes take over a faked ENV.\n" }, { "from": "human", "value": "require 'thread'\nrequire 'fake_env/version'\n\nmodule FakeEnv\n class << self\n ...
ruby
chosen
[ { "from": "system", "value": "Add methods to route and respond to WebDAV requests\n" }, { "from": "human", "value": "module Calligraphy::Rails\n class WebDavRequestsController < ActionController::Base\n def invoke_method\n end\n end\nend\n" }, { "from": "gpt", "value": "modul...
ruby
chosen
[ { "from": "system", "value": "Add flight info and add save_yesterday_info method\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\nclass FlightInfo\n\nend\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\n\nclass FlightInfo\n def self.save_yesterday_info\n haha = Aloh...
ruby
chosen
[ { "from": "system", "value": "Test seems to be working\n" }, { "from": "human", "value": "require \"rails_helper\"\nrequire 'factory_girl'\n\nfeature \"Event Creation\" do\n scenario \"User enters venue name\", js: true do\n new_relic = create(:venue, title: 'New Relic')\n urban_airship =...
ruby
chosen
[ { "from": "system", "value": "Add a description to the gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire 'adauth/version'\n\nGem::Specification.new do |s|\n s.name = \"adauth\"\n s.version = Adauth::Version\n s....
ruby
chosen
[ { "from": "system", "value": "Add `created_at` and `updated_at` to StudentIdentifierType and StudentIdentifier\n" }, { "from": "human", "value": "class CreateStudentIdentifiers < ActiveRecord::Migration\n def change\n create_table :student_identifier_types do |t|\n t.belongs_to :organiz...
ruby
chosen