conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Update read_with_front_matter to use @contents.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Dimples\n # A mixin class that handles reading and parsing front matter from a file.\n module Frontable\n METADATA_KEYS = %w[title layout ...
ruby
chosen
[ { "from": "system", "value": "Put children in their own process groups.\n\nNuke entire process groups\n" }, { "from": "human", "value": "require 'fileutils'\nrequire 'tempfile'\nmodule Juici\n module BuildLogic\n\n def spawn_build\n raise \"No such work tree\" unless FileUtils.mkdir_p(w...
ruby
chosen
[ { "from": "system", "value": "Remove unneeded require of dry-monitor\n" }, { "from": "human", "value": "require \"roda\"\nrequire \"roda/plugins/flow\"\nrequire \"dry-configurable\"\nrequire \"dry-monitor\"\n\nmodule Kanji\n class Application < ::Roda\n extend Dry::Configurable\n\n settin...
ruby
chosen
[ { "from": "system", "value": "Remove explicit version requirement for rake\n" }, { "from": "human", "value": "\nlib = File.expand_path(\"../lib\", __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire \"err_merchant/version\"\n\nGem::Specification.new do |spec|\n spec.name...
ruby
chosen
[ { "from": "system", "value": "Add app name to backup file name\n" }, { "from": "human", "value": "module PgDrive\n module Uploader\n Drive = Google::Apis::DriveV2\n AUTH_SCOPE = \"https://www.googleapis.com/auth/drive\".freeze\n RETRY_COUNT = 3\n\n class << self\n def call(cont...
ruby
chosen
[ { "from": "system", "value": "Refactor specs for clarity and runway\n\nThere are several more examples coming and I want it to be easy to add\nthem, and clear to read. Thanks @myronmarston for the suggestion:\nhttps://gist.github.com/2142563\n[#26437519]\n" }, { "from": "human", "value": "requir...
ruby
chosen
[ { "from": "system", "value": "Add a first simple spec\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe Lita::Handlers::Wolframalpha, lita_handler: true do\nend\n" }, { "from": "gpt", "value": "require \"spec_helper\"\n\ndescribe Lita::Handlers::Wolframalpha, lit...
ruby
chosen
[ { "from": "system", "value": "Fix minor typo in spec\n\nIt renders this specific test ineffective.\n" }, { "from": "human", "value": "describe ArbitrationSetting do\n describe '.seed' do\n context 'seeding from YAML file' do\n before { ArbitrationSetting.seed }\n\n it 'should creat...
ruby
chosen
[ { "from": "system", "value": "Add version constraint for Pry\n\nTakes care of the following warning when building the gem:\n\n```\nWARNING: open-ended dependency on pry (>= 0, development) is not recommended\n use a bounded requirement, such as '~> x.y'\n```\n" }, { "from": "human", "value": "...
ruby
chosen
[ { "from": "system", "value": "Fix beeminder link in main page\n" }, { "from": "human", "value": "class BeeminderAdapter < BaseAdapter\n RECENT_INTERVAL = 2.days.ago\n\n class << self\n def required_keys\n %i(token)\n end\n\n def auth_type\n :oauth\n end\n\n def website...
ruby
chosen
[ { "from": "system", "value": "Remove a comment and modify the super call\n\n* Passing the arguments here doesn't\nhave to be explicit.\n" }, { "from": "human", "value": "module Shhhhh\n class Middleware < Rails::Rack::Logger\n protected\n\n def call_app(request, env)\n # if the path ...
ruby
chosen
[ { "from": "human", "value": "Support for being called as delayed job and having a proper request_context.\n" }, { "from": "gpt", "value": "require 'delayed_job'\nmodule LogStasher\n module Delayed\n class Plugin < ::Delayed::Plugin\n callbacks do |lifecycle|\n lifecycle.before(:i...
ruby
chosen
[ { "from": "system", "value": "Raise an error for an error occurring in a sub shell\n" }, { "from": "human", "value": "module DataLoader\n \n def usage_message message\n puts ''\n puts message\n puts ''\n exit 0\n end\n \n def check_for_file\n unless ENV['FILE']\n usage_m...
ruby
chosen
[ { "from": "system", "value": "Add wrapper for tails admin model change\n" }, { "from": "human", "value": "require 'piggybak_braintree/payment_decorator'\nrequire 'piggybak_braintree/order_decorator'\nrequire 'piggybak_braintree/orders_controller_decorator'\n\nmodule PiggybakBraintree\n class En...
ruby
chosen
[ { "from": "system", "value": "Delete comma because an extra one was ending up in generated tests\n" }, { "from": "human", "value": "module Rambo\n module RamlModels\n class Headers\n attr_accessor :headers\n\n def initialize(headers)\n @headers = headers\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Rewrite SharedContext to use a simple record/playback mechanism.\n" }, { "from": "human", "value": "module RSpec\n module Core\n # Exposes {ExampleGroup}-level methods to a module, so you can include that\n # module in an {ExampleGroup}.\n #\n # @exampl...
ruby
chosen
[ { "from": "system", "value": "Change default from address for emails\n" }, { "from": "human", "value": "class ApplicationMailer < ActionMailer::Base\n default from: \"\\\"CQ Manager Admin\\\" <admin@lunchiatto.com>\"\n layout 'mailer'\nend\n" }, { "from": "gpt", "value": "class App...
ruby
chosen
[ { "from": "system", "value": "Change example response to return all include plugins\n" }, { "from": "human", "value": "require \"sinatra\"\nrequire './plugins/requests'\n\nclass DummyApp < Sinatra::Base\n get '/' do\n Nark.total_requests.inspect\n end\nend\n" }, { "from": "gpt", ...
ruby
chosen
[ { "from": "system", "value": "Add ability to specify XLSX column types\n" }, { "from": "human", "value": "require 'axlsx'\n\nmodule Stradivari\n module XLSX\n class Generator < CSV::Generator\n\n class Column < CSV::Generator::Column\n # Like parent\n end\n\n def to_s\n...
ruby
chosen
[ { "from": "system", "value": "Verify that the exit status won't overflow.\n" }, { "from": "human", "value": "require_relative '../lib/uspec'\nextend Uspec\n\ndef capture\n readme, writeme = IO.pipe\n pid = fork do\n $stdout.reopen writeme\n readme.close\n\n yield\n end\n\n writeme.c...
ruby
chosen
[ { "from": "system", "value": "Revert \"Disable RSS search results\"\n\nFix case in Url tags\n\nThis reverts commit e8258ac9baeb1e1d3ee2216c6fc42901469c574f.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nxml.instruct!\nxml.OpenSearchDescription 'xmlns' => 'http://a9.com/-/sp...
ruby
chosen
[ { "from": "system", "value": "Make sure publish is flushed\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'nats/client'\n\ndef usage\n puts \"Usage: pub.rb <user> <pass> <subject> <msg>\"; exit\nend\n\nuser, pass, subject, msg = ARGV\nusage unless user and pass and subject\n\n# ...
ruby
chosen
[ { "from": "system", "value": "Update RSpec dependency to 3.0.beta.2\n\nCurrent spec status: 358 examples, 167 failures in 0.1169 seconds; 145\ndeprecations found.\n" }, { "from": "human", "value": "# rspec-sleeping_king_studios.gemspec\n\nrequire File.expand_path \"lib/rspec/sleeping_king_studio...
ruby
chosen
[ { "from": "system", "value": "Fix mistake in default Regex of initializer\n" }, { "from": "human", "value": "Devise.setup do |config|\n # ==> Security Extension\n # Configure security extension for devise\n\n # Should the password expire (e.g 3.months)\n # config.expire_password_after = fals...
ruby
chosen
[ { "from": "system", "value": "Add observers path to autoload\n" }, { "from": "human", "value": "module Neighborly\n module Balanced\n class Engine < ::Rails::Engine\n isolate_namespace Neighborly::Balanced\n\n initializer 'include_user_concern' do |app|\n ::User.send(:includ...
ruby
chosen
[ { "from": "system", "value": "Revert \"fixes regression where entry point was not being loaded\"\n\nThis reverts commit 28f6da0e4e89d35411b19d5a5977a9d9f305f5f9.\n" }, { "from": "human", "value": "class Spork::RunStrategy::Forking < Spork::RunStrategy\n def self.available?\n Kernel.respond_t...
ruby
chosen
[ { "from": "system", "value": "Add spec for ruby -Cdir -e code\n" }, { "from": "human", "value": "require_relative '../spec_helper'\n\ndescribe 'The -C command line option' do\n before :all do\n @script = fixture(__FILE__, 'dash_upper_c_script.rb')\n @tempdir = File.dirname(@script)\n en...
ruby
chosen
[ { "from": "system", "value": "Add spec for -I with symlinks\n" }, { "from": "human", "value": "require_relative '../spec_helper'\n\ndescribe \"The -I command line option\" do\n before :each do\n @script = fixture __FILE__, \"loadpath.rb\"\n end\n\n it \"adds the path to the load path ($:)\...
ruby
chosen
[ { "from": "system", "value": "Call uniq! to get unique searches deal with perf later\n" }, { "from": "human", "value": "class Api::SearchController < ApplicationController\n def show\n @searches = Line.search(params[:term]).joins(:quote).includes(:character, :quote).map(&:quote)\n render ...
ruby
chosen
[ { "from": "human", "value": "Create data export code for Research Matters\n" }, { "from": "gpt", "value": "require 'csv'\n\nclass ResearchMattersExporter\n\n STUDENT_INCLUDES = %w[school absences discipline_incidents event_notes]\n\n def initialize\n @school = School.find_by_local_id('HEA')...
ruby
chosen
[ { "from": "system", "value": "Fix the missing attribute reader.\n\nRollupRule should have attr_reader :rule.\n" }, { "from": "human", "value": "require 'scorm2004/sequencing'\nrequire 'scorm2004/sequencing/rollup_rule_description'\nrequire 'scorm2004/sequencing/evaluate_rollup_conditions_subproc...
ruby
chosen
[ { "from": "system", "value": "Add second search term when grepping for PID of Chef-Zero\n" }, { "from": "human", "value": "module VagrantPlugins\n module ChefZero\n module ServerHelpers\n\n def start_chef_zero(env)\n port = get_port(env)\n host = get_host(env)\n if ...
ruby
chosen
[ { "from": "system", "value": "Add Proxy Settings to HTTP connections.\n" }, { "from": "human", "value": "class HttpService < Versioneye::Service\n\n def self.fetch_response url, timeout = 60\n uri = URI.parse url\n http = Net::HTTP.new uri.host, uri.port\n http.read_timeout = timeout ...
ruby
chosen
[ { "from": "system", "value": "Update wkhtmltopdf executable path for Heroku\n" }, { "from": "human", "value": "require 'wicked_pdf'\n\nWickedPdf.config = if Rails.env.production?\n { exe_path: '/u/apps/handy/shared/bin/wkhtmltopdf' }\nelse\n { exe_path: '/usr/local/bin/wkhtmltopdf' }\nend\n" ...
ruby
chosen
[ { "from": "system", "value": "Remove silent option to update successfully\n" }, { "from": "human", "value": "cask :v1 => 'cacoo-ninja' do\n version '1.2.0'\n sha256 'd536efe0d4d947b724a513d9874a8d47e13299c1f6c1767cb9f56c50e7e38ccb'\n\n url 'http://assets.cacoo.com/extension/151111/CacooNinjaI...
ruby
chosen
[ { "from": "system", "value": "Add github source URL as homepage\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path('../lib', __FILE__)\nrequire 'simple_sitemap/version'\n\nGem::Specification.new do |gem|\n\n gem.name = 'simple_sitemap'\n gem.version...
ruby
chosen
[ { "from": "system", "value": "[Specs] Test input validation in `trunk add-owner`\n" }, { "from": "human", "value": "require File.expand_path('../../../spec_helper', __FILE__)\n\nmodule Pod\n describe Command::Trunk::AddOwner do\n describe 'CLAide' do\n it 'registers it self' do\n ...
ruby
chosen
[ { "from": "system", "value": "Add more spec to cover latest improvements on the validator\n\n - Spec to cover any random String should not break the validator\n - Given a SRO with a specific suffix we could validate passing the suffix to the validator\n" }, { "from": "human", "value": "require '...
ruby
chosen
[ { "from": "human", "value": "Add some specs for sidebar helper. Not pretty.\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\nclass TestBrokenSidebar < Sidebar\n description \"Invalid test sidebar\"\n def parse_request(contents, request_params)\n raise \"I'm b0rked!\"\n end\nend\n\...
ruby
chosen
[ { "from": "system", "value": "Update rspec to ~> 2.9.0.rc2" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/omniauth-medpass/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = ['Karol Sarnacki']\n gem.email = ['soder...
ruby
chosen
[ { "from": "system", "value": "Fix Ruby warning: method redefined; discarding old breakpoint\n" }, { "from": "human", "value": "module Kernel\n unless respond_to?(:debugger)\n # Starts a debugging session if ruby-debug has been loaded (call script/server --debugger to do load it).\n def de...
ruby
chosen
[ { "from": "system", "value": "Revert \"Return webp if browser supports it\"\n\nThis reverts commit a7127f132a007839a63a912cdcdba2ac7dfcd780.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nif [:local, :test].include? Rails.application.config.active_storage.service\n module A...
ruby
chosen
[ { "from": "human", "value": "Add first Board class spec\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Tavern::Board do\n\n let(:status_list) { [:todo, :done] }\n let(:priorities) { [:low, :normal, :high] }\n \n subject(:board) { Tavern::Board.new }\n\n its(:tasks) { sho...
ruby
chosen
[ { "from": "system", "value": "Bump to v1.1.0 (added Dimma::VERSION)\n" }, { "from": "human", "value": "module Dimma\n # Dimmas’ version.\n # @see http://semver.org/\n VERSION = %w(1 0 1).join(\".\")\nend" }, { "from": "gpt", "value": "module Dimma\n # Dimmas’ version.\n # @see h...
ruby
chosen
[ { "from": "system", "value": "Remove secret from Heroku cookie\n" }, { "from": "human", "value": "module Identity\n Main = Rack::Builder.new do\n use Rack::Instruments\n use Rack::SSL if Config.production?\n\n # general cookie storing information of the logged in user; should be\n #...
ruby
chosen
[ { "from": "system", "value": "Hide legal intro paragraph from request search listing\n" }, { "from": "human", "value": "# Add a callback - to be executed before each request in development,\n# and at startup in production - to patch existing app classes.\n# Doing so in init/environment.rb wouldn...
ruby
chosen
[ { "from": "system", "value": "Return empty Amount object when API returns null\n" }, { "from": "human", "value": "module Mollie\n class Amount < Base\n attr_accessor :value, :currency\n\n def value=(net)\n @value = BigDecimal.new(net.to_s)\n end\n end\nend\n" }, { "from":...
ruby
chosen
[ { "from": "system", "value": "Add scons, make-like tool used by godot\n" }, { "from": "human", "value": "\nuser = node[:settings][:user]\n\nexecute \"apt-get-update\" do\n command \"apt-get update\"\nend\n\n%w{ant ant-contrib autoconf autoconf2.13 autopoint bison cmake expect flex gperf libarch...
ruby
chosen
[ { "from": "system", "value": "[16] Add unit tests for cache manager\n" }, { "from": "human", "value": "cache_test.rb - Unit Tests\n\nrequire 'test/unit'\n\nclass CacheTest < Test::Unit::TestCase \n\nend" }, { "from": "gpt", "value": " #cache_test.rb - Unit Tests\n\nrequire 'test/unit...
ruby
chosen
[ { "from": "system", "value": "Add image URL to Character model\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'sinatra/base'\n\nrequire 'net/http'\nrequire 'data_mapper'\n\nclass Character\n include DataMapper::Resource\n\n property :id, Serial\n property :region, ...
ruby
chosen
[ { "from": "system", "value": "Add Search For Number In API Item\n" }, { "from": "human", "value": "class Api::ItemsController < ApiController\n def index\n item_type_id = params[:item_type_id]\n agenda_id = params[:agenda_id]\n \n @items = Item.all\n\n @items = @items.where(\"low...
ruby
chosen
[ { "from": "system", "value": "Use sinatra/reloader in development mode\n" }, { "from": "human", "value": "require 'sinatra'\nrequire 'haml'\n\nrequire_relative 'lib/config'\nrequire_relative 'lib/db-config'\nrequire_relative 'lib/links'\n\nclass Blog < Sinatra::Application \n\n\tget \"#{$app_roo...
ruby
chosen
[ { "from": "system", "value": "Update homepage of the gem\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'bigpanda'\n s.version = '0.1.0'\n s.date = '2013-07-17'\n s.summary = \"Ruby client and integrations for the BigPanda API\"\n s.descrip...
ruby
chosen
[ { "from": "system", "value": "Change visiblity of a couple methods in `Gsub`\n" }, { "from": "human", "value": "require_relative 'sub'\n\nmodule SubDiff\n class Gsub < Sub\n protected\n\n attr_reader :last_prefix\n\n def diff_method\n :gsub\n end\n\n private\n\n def diff!...
ruby
chosen
[ { "from": "system", "value": "Change indentation in Tree class\n\nTo remove the long lines.\n" }, { "from": "human", "value": "# This has been copied into Content Tagger, pending a decision on where it should live.\n# If you're changing it, please consider handling the common case.\n\n# Recursiv...
ruby
chosen
[ { "from": "system", "value": "Allow Woodhouse::Job to mimic a hash of its arguments.\n" }, { "from": "human", "value": "require 'securerandom'\nrequire 'forwardable'\n\nclass Woodhouse::Job\n attr_accessor :worker_class_name, :job_method, :arguments\n\n def initialize(class_name = nil, method ...
ruby
chosen
[ { "from": "system", "value": "Use new fails_with DSL syntax\n\nSigned-off-by: Jack Nagel <43386ce32af96f5c56f2a88e458cb94cebee3751@gmail.com>\n" }, { "from": "human", "value": "require 'formula'\n\nclass Minc < Formula\n homepage 'http://en.wikibooks.org/wiki/MINC'\n url 'https://github.com/do...
ruby
chosen
[ { "from": "system", "value": "Add space in front of CA for include method\n" }, { "from": "human", "value": "# Simple Substrings\n\n# I worked on this challenge by myself.\n\n\n# Your Solution Below\n\ndef welcome(address)\n if address.include?('CA') == true\n return 'Welcome to California'\...
ruby
chosen
[ { "from": "system", "value": "Refactor test to redirect to new experiment path\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe 'Experiment' do\n feature 'Post a New Experiment' do\n it 'is able to display a new experiment form' do\n visit '/experiment/index'\n ...
ruby
chosen
[ { "from": "system", "value": "Increase the descriptiveness of the examples\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + '/../spec_helper'\n\ndescribe \"The user_and_repo_from helper\" do\n before(:each) do\n @helper = GitHub::Helper.new\n end\n\n it \"should return d...
ruby
chosen
[ { "from": "system", "value": "Remove game from email title.\n" }, { "from": "human", "value": "class CommentMailer < ApplicationMailer\n def notify_user(user, comment)\n @user = user\n @comment = comment\n @subject = comment.subject\n if @subject.is_a?(Post)\n @game = @subject....
ruby
chosen
[ { "from": "system", "value": "Allow the condition value to accept any type\n" }, { "from": "human", "value": "require 'dry-struct'\n\nDry::Types.load_extensions(:maybe)\n\n# Convenience module for dry-types\nmodule Types\n include Dry::Types.module\nend\n\n# Placeholder class that represents a ...
ruby
chosen
[ { "from": "system", "value": "Add education filter for only graduated degrees\n" }, { "from": "human", "value": "class EducationsController < MyplaceonlineController\n def may_upload\n true\n end\n\n def use_bubble?\n true\n end\n \n def bubble_text(obj)\n Myp.display_date_month_y...
ruby
chosen
[ { "from": "human", "value": "Add OperationsController and create - new actions.\n" }, { "from": "gpt", "value": "class OperationsController < ApplicationController\n skip_before_filter :require_login\n\n\tdef new\n\t\t@operation = Operation.new\n\tend\n\n def create\n @operation = Operation...
ruby
chosen
[ { "from": "system", "value": "Add explicit reference to controller to prevent namespace clash.\n" }, { "from": "human", "value": "class RouteSweeper < ActionController::Caching::Sweeper\n\n observe :route\n\n def after_create(route)\n expire_cache_for(route)\n end\n\n def after_destroy(ro...
ruby
chosen
[ { "from": "system", "value": "Complete 4.6.4. Small formatting change on prev commit\n" }, { "from": "human", "value": "# Shortest String\n\n# I worked on this challenge by myself.\n\n# shortest_string is a method that takes an array of strings as its input\n# and returns the shortest string\n#\...
ruby
chosen
[ { "from": "system", "value": "Bump the version to 1.3.2.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n\ts.name = 'FreeStreamer'\n\ts.version = '1.3.1'\n\ts.license = 'BSD'\n\ts.summary = 'A low-memory footprint streaming audi...
ruby
chosen
[ { "from": "human", "value": "Add specs for Utilities module\n\nAdd:\n * Specs for time_from_natural_language method\n * Specs for class_from_string method\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ninclude GitHubArchiveParser\n\ndescribe Utilities do\n describe \"#time_from_natur...
ruby
chosen
[ { "from": "system", "value": "Handle that scenario outline steps do not contain result\n" }, { "from": "human", "value": "# override aruba to filter out some stuff\nmodule NormaliseArubaOutput\n def all_stdout\n normalise_output(super)\n end\n\n def normalise_output(out)\n out = out.gsu...
ruby
chosen
[ { "from": "system", "value": "Rename method load_order to load_order_with_lock\n\nFixes #59\n" }, { "from": "human", "value": "module Spree\n CheckoutController.class_eval do\n before_filter :remove_payments_attributes_if_total_is_zero\n\n [:store_credit_amount, :remove_store_credits].eac...
ruby
chosen
[ { "from": "system", "value": "Set default Cookie value at 0\n" }, { "from": "human", "value": "# This hash will contain the type of the question as a key and value will be number of cookies\nH_COOKIES = {\"Simple\" => 1, \"Medium\" => 3, \"Hard\" => 5}\n" }, { "from": "gpt", "value":...
ruby
chosen
[ { "from": "system", "value": "Make redirects robust enough to cope with a relative root URL\n" }, { "from": "human", "value": "Sanskrit::Application.routes.draw do\n\t# The priority is based upon order of creation: first created -> highest priority.\n\t# See how all your routes lay out with \"ra...
ruby
chosen
[ { "from": "system", "value": "Create route to searched stories view\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n mount RedactorRails::Engine => '/redactor_rails'\n resources :snippets\n\n get '/signup', to: 'users#new'\n post '/signup', to: 'users#create', as: 'new_s...
ruby
chosen
[ { "from": "system", "value": "Use rails 4 route syntax\n" }, { "from": "human", "value": "Refinery::Core::Engine.routes.draw do\n\n # Frontend routes\n namespace :elasticsearch, :path => '' do\n match \"/search\", :to => 'search#show', :as => 'search'\n end\n\nend\n" }, { "from": "...
ruby
chosen
[ { "from": "system", "value": "Add edit route for developer\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n authenticated :developer do\n root 'developers#profile', as: :developer_root\n end\n\n authenticated :recruiter do\n root 'search#index', as: :recruiter_root\...
ruby
chosen
[ { "from": "system", "value": "Correct the end in raven configuration\n" }, { "from": "human", "value": "Raven.configure do |config|\n # Raven reports on the following environments\n # config.environments = %w(staging production)\n \n # Sentry respects the sanitized fields specified in:\n # ...
ruby
chosen
[ { "from": "system", "value": "Include helper automatically in all controllers\n" }, { "from": "human", "value": "module Bodega\n class Engine < ::Rails::Engine\n isolate_namespace Bodega\n\n initializer \"bodega.hookses\" do\n ActiveSupport.on_load :action_controller do\n #req...
ruby
chosen
[ { "from": "human", "value": "Add a presenter test for CompletedTransactionPresenter\n" }, { "from": "gpt", "value": "require \"test_helper\"\n\nclass CompletedTransactionPresenterTest < ActiveSupport::TestCase\n def subject(content_item)\n CompletedTransactionPresenter.new(content_item.deep_...
ruby
chosen
[ { "from": "system", "value": "Fix a typo in DeleteEmptyHeaders plugin" }, { "from": "human", "value": "# frozen-string-literal: true\n\n#\nclass Roda\n module RodaPlugins\n # The delete_empty_headers plugin deletes any headers whose\n # value is set to the empty string. Because of how de...
ruby
chosen
[ { "from": "system", "value": "Use xml namespace constant from sepafm.rb and add memoization to methods\n" }, { "from": "human", "value": "module Sepa\n class DanskeResponse < Response\n\n # Namespace used in danske bank certificate responses and requests\n TNS = 'http://danskebank.dk/PKI/...
ruby
chosen
[ { "from": "system", "value": "Add 'Jessica RABBIT' bookmarks to each user\n" }, { "from": "human", "value": "module Renalware\n log \"--------------------Adding Bookmarks --------------------\"\n\n logcount=0\n roger_rabbit = Patient.find_by(family_name: 'RABBIT', given_name: 'Roger')\n User...
ruby
chosen
[ { "from": "system", "value": "Fix homepage to not use git URI.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'serp_metrics/version'\n\nGem::Specification.new do |gem|\n g...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary settings for loading of static assets\n\n* It brokes 'rake assets:precompile' when the host app\n is set not to serve static assets\n" }, { "from": "human", "value": "module Katgut\n class Engine < ::Rails::Engine\n isolate_namespace Katgut\n...
ruby
chosen
[ { "from": "system", "value": "Put the htpasswd file in shared path\n" }, { "from": "human", "value": "namespace :nginx do\n\n desc \"Setup application in nginx\"\n task :setup, :roles => :web do\n template \"nginx/nginx_virtual_host_conf.erb\", \"/tmp/#{application}\"\n run \"#{sudo} mv ...
ruby
chosen
[ { "from": "system", "value": "Introduce subject to GitHubSource specs.\n\nThis commits adds a _named_ subject to Memory::Sources::GitHubSource specs to\navoid code duplication.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Memory do\n describe Memory::Sources::GitHubSourc...
ruby
chosen
[ { "from": "system", "value": "Enable checking up to 1000 projects at a time\n" }, { "from": "human", "value": "class Api::StatusController < Api::ApplicationController\n before_action :require_api_key\n\n def check\n if params[:projects].any?\n @projects = params[:projects].group_by{|p...
ruby
chosen
[ { "from": "system", "value": "Fix bug - trying to access locality name after it had been deleted.\n" }, { "from": "human", "value": "class LocalitiesController < ApplicationController\n before_action :set_locality, only: [:show, :edit, :update, :destroy]\n\n def index\n @localities = Locali...
ruby
chosen
[ { "from": "system", "value": "Set exit statuses into constants instead of hard coding them\n" }, { "from": "human", "value": "require 'deject'\nrequire 'readme_tester/version'\nrequire 'readme_tester/interpreter'\n\ndef ReadmeTester(argv)\n ReadmeTester.new(argv).execute\nend\n\nclass ReadmeTes...
ruby
chosen
[ { "from": "system", "value": "Fix error about empty? called on nil object\n" }, { "from": "human", "value": "class ApplicationHelper::Button::UtilizationDownload < ApplicationHelper::Button::Basic\n def disabled?\n # to enable the button we are in the \"Utilization\" and have trend report\n ...
ruby
chosen
[ { "from": "system", "value": "Update todo to point to open pivotal card" }, { "from": "human", "value": "class LitePaperSerializer < ActiveModel::Serializer\n attributes :id, :title, :short_title, :submitted, :roles, :related_at_date\n\n def related_at_date\n scoped_user.paper_roles.where(p...
ruby
chosen
[ { "from": "human", "value": "Add service CsvlintValidateService - validate s3 csv string with csvlint.rb\n" }, { "from": "gpt", "value": "class CsvlintValidateService\n\n\trequire 'csvlint'\n\n\tdef self.validate_csv(dataset_files)\n\t\tdataset_files.each do |file|\n\t\t\t@s3_string = FileStorag...
ruby
chosen
[ { "from": "system", "value": "Add end-to-end bounce override spec\n" }, { "from": "human", "value": "require 'poltergeist_helper'\n\nRSpec.feature \"overriding Sendgrid\" do\n include ActiveJobHelper\n include FeaturesHelper\n\n before do\n ActionMailer::Base.deliveries.clear\n end\n\n s...
ruby
chosen
[ { "from": "system", "value": "Change JWT encrytion to RS256\n" }, { "from": "human", "value": "class SessionToken\n PASSWORD = Rails.application.secrets.secret_key_base\n EXPIRY = 4.days\n ISSUER = 'farmbot-web-app'\n\n attr_accessor :encoded, :unencoded\n\n def initialize(payload)\n ...
ruby
chosen
[ { "from": "system", "value": "Add thumb version for images" }, { "from": "human", "value": "class Pulitzer::ImageUploader < Pulitzer::BaseUploader\n\n process :resize_image\n\n def resize_image\n self.class.process resize_to_fit: [model.height, model.width]\n end\nend\n" }, { "from...
ruby
chosen
[ { "from": "system", "value": "Use DateTime instaed of Time to support ruby 1.8\n" }, { "from": "human", "value": "require 'tzinfo'\nrequire \"active_support/core_ext\"\nrequire \"time_zone_ext/version\"\n\nmodule TimeZoneExt\n def strptime(date, format)\n if format =~ /%z/i\n Time.strpt...
ruby
chosen
[ { "from": "system", "value": "Support passing in a custom filename to write().\n" }, { "from": "human", "value": "$:.unshift(__dir__)\n\nrequire 'rubygems'\nrequire 'renderable'\n\nmodule UsesThis\n class Page\n include Frontable\n include Renderable\n attr_accessor :site, :metadata, :...
ruby
chosen
[ { "from": "system", "value": "Change default value for migration\n" }, { "from": "human", "value": "require 'carto/db/migration_helper'\n\ninclude Carto::Db::MigrationHelper\n\nmigration(\n Proc.new do\n add_column :user_migration_imports, :dry, :boolean, default: true\n end,\n Proc.new do...
ruby
chosen
[ { "from": "system", "value": "Make running benchmarks TWICE AS FAST!\n" }, { "from": "human", "value": "require \"bundler/setup\"\nrequire \"stomp_parser\"\nrequire \"benchmark/ips\"\n\nclass Benchpress\n attr_reader :options\n\n def initialize(options, &body)\n @options = options\n inst...
ruby
chosen
[ { "from": "system", "value": "Allow newer versions of addressable\n\nTested and working with addressable 2.5.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"postrank-uri/version\"\n\nGem::Specification.new do |s|\n s.name...
ruby
chosen
[ { "from": "system", "value": "Switch away from patched Turnip autoloading.\n" }, { "from": "human", "value": "# See https://github.com/jnicklas/turnip/pull/96\n# with a tweak to group features into acceptance/features/ alongside\n# acceptance/steps/\n\nmodule Turnip\n module RSpec\n class <<...
ruby
chosen