conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Add first spec around GithubUtils\n" }, { "from": "gpt", "value": "require \"spec_helper\"\n\ndescribe GithubUtils do\n let(:token) { 'x' * 30 }\n let(:user) { double(github_id: 'test', token: token) }\n\n context \"when retrieving a user's repository list\" do\n ...
ruby
chosen
[ { "from": "system", "value": "Allow for older version of Gemfile\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'object_patch/version'\n\nGem::Specification.new do |spec|\n spec.nam...
ruby
chosen
[ { "from": "system", "value": "Add routing to productions view from Admin show one user's productions\n" }, { "from": "human", "value": "class AdminsController < ApplicationController\n before_action :check_admin\n\n def index\n @users = User.all\n @usertypes = Usertype.all\n end\n\n de...
ruby
chosen
[ { "from": "system", "value": "Add flash messages for event form\n" }, { "from": "human", "value": "class EventsController < ApplicationController\n def index\n @event = Event.new(default_event)\n @events = Event.all\n end\n\n def create\n Event.create(event_params)\n\n redirect_to...
ruby
chosen
[ { "from": "system", "value": "Remove empty slug pages. Fix /resources/ URL.\n\n[#147440453]\n" }, { "from": "human", "value": "class RobotsController < ApplicationController\n \n layout false\n\n def index\n if ENV['DYNAMIC_ROBOTS_TXT'] == 'true'\n\n lines = []\n\n lines = [\...
ruby
chosen
[ { "from": "system", "value": "Handle device pixel ratio for screenshots\n" }, { "from": "human", "value": "module Capybara\n module Guides\n module Screenshotable\n require 'mini_magick'\n\n # TODO: Some elements are outside the screenshot area\n def save_screenshot(image_file...
ruby
chosen
[ { "from": "system", "value": "Tidy up attachment delete worker\n" }, { "from": "human", "value": "class AssetManagerAttachmentDeleteWorker < WorkerBase\n def perform(attachment_data_id)\n attachment_data = AttachmentData.find_by(id: attachment_data_id)\n return unless attachment_data.pres...
ruby
chosen
[ { "from": "system", "value": "Fix to helper work with 3.* rails app\n" }, { "from": "human", "value": "require 'event_calendar/calendar_helper'\n\nmodule EventCalendar\n module Rails\n class Engine < ::Rails::Engine\n initializer 'event_calendar.setup_view_helpers' do |app|\n app...
ruby
chosen
[ { "from": "system", "value": "Handle case where headers are not provided in config\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Heroics\n # Attempts to load configuration, provides defaults, and provide helpers to access that data\n class Configuration\n attr_r...
ruby
chosen
[ { "from": "system", "value": "Use datamapper.select instead of .query.\n" }, { "from": "human", "value": "require 'sinatra'\nrequire 'haml'\nrequire 'model/shop'\nrequire 'model/product'\nrequire File.dirname(__FILE__)+'/../lib/csv_streamer'\nrequire File.dirname(__FILE__)+'/../lib/json_streamer...
ruby
chosen
[ { "from": "system", "value": "Improve page not found info\n" }, { "from": "human", "value": "module Rasti\n module Web\n class Application\n\n def self.router\n @router ||= Router.new\n end\n\n Router::VERBS.each do |verb|\n define_singleton_method verb do |*args...
ruby
chosen
[ { "from": "system", "value": "Add MacRuby note to gemspec summary\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/cocoapods', __FILE__)\n\nGem::Specification.new do |s|\n s.name = \"cocoapods\"\n s.version = Pod::VERSION\n s.date = \"201...
ruby
chosen
[ { "from": "system", "value": "Add widget helper to actionview\n" }, { "from": "human", "value": "module SupportEngine\n class Engine < ::Rails::Engine\n isolate_namespace SupportEngine\n\n config.generators do |g|\n g.test_framework :rspec, :fixture => false\n g.fixt...
ruby
chosen
[ { "from": "system", "value": "Update chef client to 16.6.14\n" }, { "from": "human", "value": "# Add the opscode APT source for chef\ndefault[:apt][:sources] = node[:apt][:sources] | [\"opscode\"]\n\n# Set the default server version\ndefault[:chef][:server][:version] = \"12.17.33\"\n\n# Set the ...
ruby
chosen
[ { "from": "system", "value": "Use aggregation function to reduce cardinality in labels like path and querystring\n" }, { "from": "human", "value": "require 'prometheus/middleware/collector'\nrequire 'prometheus/middleware/exporter'\n\nmodule Prometheus::Middleware\n class CollectorWithExclusion...
ruby
chosen
[ { "from": "system", "value": "Fix a nasty test bug that caused the integration tests to fail under ill-defined circumstances.\n\ngit-svn-id: 30fef0787527f3d4b2d3639a5d6955e4dc84682e@160 c18eca5a-f828-0410-9317-b2e082e89db6\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + '/spe...
ruby
chosen
[ { "from": "system", "value": "Comment out loud debug message appending request body." }, { "from": "human", "value": "require 'httpclient'\n\nclass Coinmux::Http\n include Singleton, Coinmux::Facades\n\n def get(host, path, options = {:disable_cache => false})\n begin\n info \"HTTP GET...
ruby
chosen
[ { "from": "system", "value": "Call to_s on priority so symbols are supported\n" }, { "from": "human", "value": "module Maia\n class Message\n MAX_TOKENS_AT_ONCE = 999\n\n def send_to(pushable)\n devices =\n case pushable\n when ActiveRecord::Relation\n Device.o...
ruby
chosen
[ { "from": "system", "value": "Use Rails eager loading for resque:preload\n" }, { "from": "human", "value": "# require 'resque/tasks'\n# will give you the resque tasks\n\nnamespace :resque do\n task :setup\n\n desc \"Start a Resque worker\"\n task :work => [ :preload, :setup ] do\n require ...
ruby
chosen
[ { "from": "system", "value": "Use an instance of class to represent Undefined\n\nThis gives nicer output for Undefined#inspect\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'addressable/uri'\n\nrequire 'set'\nrequire 'concord'\nrequire 'abstract_type'\nrequire 'descendants_trac...
ruby
chosen
[ { "from": "system", "value": "Rename rake task should assign language to all wordsets\n" }, { "from": "human", "value": "\nnamespace :data do\n task :run => [:clean,\n :rename]\n\n task :clean => [\"db:mongoid:remove_undefined_indexes\", \"db:mongoid:create_indexes\"]\n\n task ...
ruby
chosen
[ { "from": "system", "value": "Update module, defined model_devise for config\n" }, { "from": "human", "value": "require \"tracking_fwz/version\"\n\nmodule TrackingFwz\n # Your code goes here...\nend\n" }, { "from": "gpt", "value": "require \"tracking_fwz/version\"\n\nmodule Tracking...
ruby
chosen
[ { "from": "system", "value": "Fix indentation and move irrelevant configs.\n" }, { "from": "human", "value": "# Set the host name for URL creation\nSitemapGenerator::Sitemap.default_host = \"http://www.example.com\"\n\nSitemapGenerator::Sitemap.create do\n # Put links creation logic here.\n #\...
ruby
chosen
[ { "from": "system", "value": "Change the podspec version -> 2.9.0\n" }, { "from": "human", "value": "Pod::Spec.new do |spec|\n spec.name = \"Framezilla\"\n spec.version = \"2.8.0\"\n spec.summary = \"Comfortable syntax for working with frames.\"\n\n spec.homep...
ruby
chosen
[ { "from": "system", "value": "Fix TestUI to work with Vagrant 1.2+\n" }, { "from": "human", "value": "class TestUI < Vagrant::UI::Interface\n attr_reader :messages\n\n METHODS = [:clear_line, :report_progress, :warn, :error, :info, :success]\n\n def initialize(resource = nil)\n super\n ...
ruby
chosen
[ { "from": "system", "value": "Move history examples into module\n" }, { "from": "human", "value": "require 'spec_helper' \n\ndescribe ArubaDoubles::History do\n before do\n PStore.stub(:new)\n @history = ArubaDoubles::History.new('history.pstore')\n end\n\n #TODO: Add examples to test t...
ruby
chosen
[ { "from": "system", "value": "Use random email and phone for mock contacts\n" }, { "from": "human", "value": "FactoryBot.define do\n factory :contact do\n description { \"Here is a contact\" }\n school\n\n trait :with_name do\n name { \"Eleanor Rigby\" }\n end\n\n trait :wit...
ruby
chosen
[ { "from": "system", "value": "Set repetitions to a big enough number\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe 'benchmarking' do\n def do_things\n visit root_path\n 1.times do\n find :css, 'h1'\n assert_text 'Capybara Driver Benchmarking!'\n clic...
ruby
chosen
[ { "from": "system", "value": "Bring account creation test in line with devise defaults\n\nSince I didn't remember what Devise does by default, I had to change my\ntest to match the form that it presents.\n\nTo get these I used my browsers debugger tools to find the `id`\nattribute on each of the form fields...
ruby
chosen
[ { "from": "system", "value": "Reword it block of test.\n" }, { "from": "human", "value": "require_relative '../../spec_helper'\n\ndescribe Octonore::Template do\n\n describe \"default attributes\" do\n\n it \"should have httparty methods\" do\n Octonore::Template.should include(HTTParty...
ruby
chosen
[ { "from": "system", "value": "Change spec to properly handle constant.\n" }, { "from": "human", "value": "# coding: utf-8\n\nrequire 'spec_helper'\n\nRSpec.describe TTY::ProgressBar, 'custom' do\n let(:output) { StringIO.new('', 'w+') }\n\n it \"allows for custom tag\" do\n progress = TTY::...
ruby
chosen
[ { "from": "system", "value": "Add error handling in Configuration::from_file and set the config_loaded flag to true.\n" }, { "from": "human", "value": "module Servitude\n module Configuration\n\n def self.included( base )\n base.extend ClassMethods\n\n base.class_eval do\n c...
ruby
chosen
[ { "from": "system", "value": "Improve Cannon.root ability to get root directory\n" }, { "from": "human", "value": "module Cannon\n class App\n attr_reader :routes, :app_binding\n attr_accessor :middleware, :public_path\n\n def initialize(app_binding, middleware: [], public_path: 'publi...
ruby
chosen
[ { "from": "system", "value": "Use a valid version dependency for Podspec\n" }, { "from": "human", "value": "#\n# Be sure to run `pod lib lint LayerUIKit.podspec' to ensure this is a\n# valid spec and remove all comments before submitting the spec.\n#\n# Any lines starting with a # are optional, ...
ruby
chosen
[ { "from": "system", "value": "Change email address on gemspec\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"gov_uk_date_fields/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new d...
ruby
chosen
[ { "from": "system", "value": "Add customer update API method\n" }, { "from": "human", "value": "require 'doorkeeper/grape/helpers'\n\nmodule API\n module V1\n class Customers < Grape::API\n helpers Doorkeeper::Grape::Helpers\n\n helpers do\n\n def current_customer\n ...
ruby
chosen
[ { "from": "system", "value": "Set year to a string for now\n" }, { "from": "human", "value": "class ShowsController < ApplicationController\n def index\n @year = params[:year] || DateTime.now.year\n @shows = Show.performed.for_year(@year)\n end\n\n def show\n @show = Show.performed.f...
ruby
chosen
[ { "from": "system", "value": "Update Users Controller for icon Update\n\nAdd actions to the Users controller to handle updating the User's icon.\n" }, { "from": "human", "value": "class UsersController < ApplicationController\n def edit\n redirect_to new_user_session_path unless user_signed_...
ruby
chosen
[ { "from": "system", "value": "Fix typo in user controller\n" }, { "from": "human", "value": "class UsersController < ApplicationController\n\n\n def show\n @trips = @user.trips\n end\n\n def new\n @user = User.new\n end\n\n def create\n @user = User.new(user_params)\n if @user.s...
ruby
chosen
[ { "from": "system", "value": "Use the correct API for blob assignment\n" }, { "from": "human", "value": "class ActionText::RichText < ActiveRecord::Base\n self.table_name = \"action_text_rich_texts\"\n\n serialize :body, ActionText::Content\n delegate :to_s, to: :body\n \n belongs_to :recor...
ruby
chosen
[ { "from": "human", "value": "Add extremely simple HAML renderer.\n\nAllows you to render a file from the specified templates directory.\nSince it passes itself in as the render context, this allows partials to\nbe rendered as well from within a template.\n" }, { "from": "gpt", "value": "require ...
ruby
chosen
[ { "from": "human", "value": "[CHEF-1910] Manage node environments with knife\n" }, { "from": "gpt", "value": "#\n# Author:: Jimmy McCrory (<jimmy.mccrory@gmail.com>)\n# Copyright:: Copyright (c) 2014 Jimmy McCrory\n# License:: Apache License, Version 2.0\n#\n# Licensed under the Apache License, ...
ruby
chosen
[ { "from": "system", "value": "Change misleading field name [ci skip]" }, { "from": "human", "value": "# frozen_string_literal: true\nmodule GraphQL\n module Types\n # This scalar takes `Date`s and transmits them as strings,\n # using ISO 8601 format.\n #\n # Use it for fields or arg...
ruby
chosen
[ { "from": "system", "value": "Fix Jekyll version below 3.5.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path(\"../lib/jekyll-index-pages/version\", __FILE__)\n\nGem::Specification.new do |spec|\n spec.name = \"jekyll-index-pages\"\n spec.version = Je...
ruby
chosen
[ { "from": "system", "value": "Fix const_get is looking at the wrong place\n" }, { "from": "human", "value": "require \"json\"\n\nrequire \"omise/object\"\nrequire \"omise/error\"\n\nmodule Omise\n module Util module_function\n def typecast(object)\n klass = begin\n const_get(obje...
ruby
chosen
[ { "from": "system", "value": "Change before def to subject\n" }, { "from": "human", "value": "require 'calc'\n\nRSpec.describe Calc do\n before do\n @calc = Calc.new\n end\n\n it \"given 2 and 3, returns 5\" do\n expect(@calc.add(2, 3)).to eq(5)\n expect(@calc.add(2, 3)).not_to eq(8)...
ruby
chosen
[ { "from": "system", "value": "Upgrade rubicure version to 0.2.7\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'rubicure_fuzzy_match/version'\n\nGem::Specification.new do |spec|\n s...
ruby
chosen
[ { "from": "system", "value": "Remove some optional attributes from gemspec.\n\nRemove unnecessary attributes to reduce maintenance overhead.\n" }, { "from": "human", "value": "# Generated by jeweler\n# DO NOT EDIT THIS FILE DIRECTLY\n# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gems...
ruby
chosen
[ { "from": "system", "value": "Work around safe_yaml's evil breakage of fog by setting SafeYAML::OPTIONS[:deserialize_symbols] if SafeYAML::OPTIONS is defined.\n" }, { "from": "human", "value": "# Copyright (c) 2012 Ryan J. Geyer\n#\n# Permission is hereby granted, free of charge, to any person o...
ruby
chosen
[ { "from": "system", "value": "Remove option code that wasn't being applied and isn't required\n" }, { "from": "human", "value": "class Categories < ComfortableMexicanSofa::Content::Tag::Fragment\n def initialize(context:, params: [], source: nil)\n super\n @group_name = params.first\n ...
ruby
chosen
[ { "from": "system", "value": "Update network tests for sdc-vmtools and new build process\n" }, { "from": "human", "value": "require 'spec_helper'\n\n# Tests to validate network and interfaces are properly configured \n\n# Make sure we cang ping out etc. \ndescribe host('google.com') do\n\tit { s...
ruby
chosen
[ { "from": "system", "value": "Add spec to describe initializing a sleep data set object with sleep values.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe RubyJawbone::DataSet::Sleep do\n #\nend\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe ...
ruby
chosen
[ { "from": "system", "value": "Write spec to Point class to check for read only\n" }, { "from": "human", "value": "describe Geometry::Point do\n describe \"#initialize\" do\n it \"should create a point when given co-ordinates\" do\n expect{\n point = Geometry::Point.new(2,3)\n ...
ruby
chosen
[ { "from": "human", "value": "Add tests for project sorting\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\ndescribe Project do\n\n describe \"next\" do\n before do\n @first = create(:project)\n @second = create(:project)\n @third = create(:project)\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Replace stub_model with real instance\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe Session do\n it { should be_a(ApplicationRecord) }\n\n it { should define_enum_for(:device).with([:ios, :android]) }\n\n it { should belong_to(:user) }\n\n...
ruby
chosen
[ { "from": "system", "value": "Remove unused class in dsl spec\n" }, { "from": "human", "value": "require 'spec_helper'\n\nrequire 'pagetience/dsl'\n\nclass FirstPage\n include PageObject\n include Pagetience\nend\n\nclass SecondPage < FirstPage; end\n\ndescribe Pagetience::DSL do\n let(:brows...
ruby
chosen
[ { "from": "system", "value": "Include validity as criterion for loopback.\n" }, { "from": "human", "value": "module Geocoder\n class IpAddress < String\n def loopback?\n (self == \"0.0.0.0\" or self.match(/\\A127/))\n end\n\n def valid?\n !!self.match(/\\A(::ffff:)?(\\d{1,3})...
ruby
chosen
[ { "from": "system", "value": "Add dependency for javascript helpers\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__)) + '/lib/'\nrequire 'jqgrid_rails/version'\nGem::Specification.new do |s|\n s.name = 'jqgrid_rails'\n s.version = JqGridRails::VERSI...
ruby
chosen
[ { "from": "human", "value": "Add migration: Make non nullable timestamp of associtation tables\n" }, { "from": "gpt", "value": "class NonNullableAssociationsTimestamps < ActiveRecord::Migration[4.2]\n def change\n [:playlist_tracks,\n :album_tracks,\n :track_artists,\n :album_art...
ruby
chosen
[ { "from": "system", "value": "Exclude Node.js specific file from gemspec\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path(\"../lib\", __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire \"drugs/version\"\n\nGem::Specification.new do |spec|\n spe...
ruby
chosen
[ { "from": "system", "value": "Initialize AWS-S3 only in production environment\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'aws-sdk-s3'\n\n# AWS log level defaults to :info, you can set a different level here\n#Aws.config[:log_level] = :debug\n\n# Configure AWS cr...
ruby
chosen
[ { "from": "system", "value": "Change users to user on belongs_to\n" }, { "from": "human", "value": "class Game < ActiveRecord::Base\n has_many :gamevenues\n had_many :venues, through: :gamevenues\n has_many :usergames\n has_many :users, through: :usergames\n belongs_to :users\nend\n" }, ...
ruby
chosen
[ { "from": "system", "value": "Add link method to Page model.\n\nSigned-off-by: Peter Berkenbosch <51b70fe95cd023174431b055755b7ef384a4462b@me.com>" }, { "from": "human", "value": "class Page < ActiveRecord::Base\n validates_presence_of :title\n validates_presence_of [:slug, :body], :if => :not...
ruby
chosen
[ { "from": "system", "value": "Choose between html and text body\n" }, { "from": "human", "value": "class Post < ActiveRecord::Base\n belongs_to :user\n validates_presence_of :title, :body, :user_id\n default_scope order('created_at DESC')\n\n def self.create_from_postmark(mitt)\n api_toke...
ruby
chosen
[ { "from": "system", "value": "Add icon as attr_accessible for User\n\nUpdate the User model to make the icon attribute attr_accessible for\nupdates.\n" }, { "from": "human", "value": "class User < ActiveRecord::Base\n devise :database_authenticatable, :registerable,\n :recoverable, :rem...
ruby
chosen
[ { "from": "human", "value": "Add test for submitter sign up, create event and availability\n" }, { "from": "gpt", "value": "require 'test_helper'\n\nclass SubmitEventTest < Capybara::Rails::TestCase\n include CapybaraHelper\n\n setup do\n @conference = create(:three_day_conference)\n cre...
ruby
chosen
[ { "from": "system", "value": "Change test of subscription box in footer layout\n\nThe test must be changed because bd2bc92a89 disables subscription box\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire \"test_helper\"\n\nclass HomePageTest < ActionDispatch::IntegrationT...
ruby
chosen
[ { "from": "system", "value": "Update the description of the gemspec\n" }, { "from": "human", "value": "# Provide a simple gemspec so you can easily use your enginex\n# project in your rails apps through git.\nGem::Specification.new do |s|\n s.name = \"asset_hash\"\n s.summary = \"Asset hasher ...
ruby
chosen
[ { "from": "system", "value": "Fix db server connection example, use the hping3 instead mysql2 gem\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'mysql2'\nrequire 'cloud_conductor_utils/consul'\n\ndescribe service('iptables') do\n it { should_not be_enabled }\nend\n\ndescribe...
ruby
chosen
[ { "from": "system", "value": "Cut off accents on gem descriptions\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/brid/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Halan Pinheiro\"]\n gem.email = [\"halan...
ruby
chosen
[ { "from": "system", "value": "Fix data bag missing error message.\n" }, { "from": "human", "value": "#\n# Cookbook Name:: user\n# Recipe:: data_bag\n#\n# Copyright 2011, Fletcher Nichol\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in...
ruby
chosen
[ { "from": "system", "value": "Allow connections in on docker0.\n" }, { "from": "human", "value": "# encoding: utf-8\n#\n# Cookbook Name:: octohost\n# Recipe:: firewall\n#\n# Copyright (C) 2014, Darron Froese <darron@froese.org>\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\...
ruby
chosen
[ { "from": "system", "value": "Fix adapters work without `dry` option\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Adapters\n class Base\n attr_reader :options\n\n def initialize(options)\n @options = options\n end\n\n def dry?\n @dry ||= @opti...
ruby
chosen
[ { "from": "system", "value": "Disable inactive test for JRuby\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe \"Inactive Appsignal::Railtie\" do\n it \"should not insert itself into the middleware stack\" do\n # This uses a hack because Rails really dislikes you trying t...
ruby
chosen
[ { "from": "human", "value": "Add test to 'create test case' feature\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\ndescribe \"Create a quetsion\", type: :feature do\n let(:question) { build(:question) }\n before do\n login_as create(:user)\n exercise = create(:exercise)\n ...
ruby
chosen
[ { "from": "system", "value": "Improve the readability of Dough::Helpers\n" }, { "from": "human", "value": "require 'dough/helpers/form_row'\nrequire 'dough/helpers/renderer'\n\nrequire 'active_support/core_ext'\n\nmodule Dough\n module Helpers\n def method_missing(method_name, *args, &block)...
ruby
chosen
[ { "from": "system", "value": "Add Publisher sentry context to ErrorHandler\n" }, { "from": "human", "value": "# Send handled exceptions to Sentry (which normally only sends unhandled exceptions).\n# See https://stackoverflow.com/questions/16567243/rescue-all-errors-of-a-specific-type-inside-a-mo...
ruby
chosen
[ { "from": "system", "value": "Add a task to change id-like usernames\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nnamespace :users do\n desc 'Renames users with email-like usernames'\n task remove_email_like_usernames: :environment do\n target = User.where(\"username ...
ruby
chosen
[ { "from": "system", "value": "Add gem metadata for unwrappr\n\n - https://guides.rubygems.org/specification-reference/#metadata\n - https://github.com/envato/unwrappr\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/zxcvbn/version', __FILE__)\n\nGem:...
ruby
chosen
[ { "from": "system", "value": "Add note to self about refactoring Homework\n" }, { "from": "human", "value": "module Xapi\n # Homework gets all of a user's currently pending problems.\n class Homework\n attr_reader :key, :languages, :path\n def initialize(key, languages, path)\n @key...
ruby
chosen
[ { "from": "system", "value": "Add march_hare as a runtime dependency if running under jruby\n" }, { "from": "human", "value": "require File.expand_path('../lib/hutch/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.add_runtime_dependency 'bunny', '>= 1.7.0'\n gem.add_runtime_depend...
ruby
chosen
[ { "from": "system", "value": "Use local name servers on longma\n" }, { "from": "human", "value": "name \"nchc\"\ndescription \"Role applied to all servers at NCHC\"\n\ndefault_attributes(\n :accounts => {\n :users => {\n :steven => { :status => :administrator },\n :ceasar => { :sta...
ruby
chosen
[ { "from": "system", "value": "Create an idea to show in idea view test.\n\nWhen the idea 'show' page is implemented, it will need an idea to\nshow. Otherwise, everything on the page will be nil when trying\nto display idea information.\n" }, { "from": "human", "value": "require 'spec_helper'\n\n...
ruby
chosen
[ { "from": "system", "value": "Fix ElectricMarket => ElectricUtility relationship\n" }, { "from": "human", "value": "require 'earth/locality'\n\nclass ElectricUtility < ActiveRecord::Base\n self.primary_key = \"eia_id\"\n \n belongs_to :state, :foreign_key => 'state_postal_abbreviation'\n has...
ruby
chosen
[ { "from": "system", "value": "Remove superfluous else clause when logging with a prefix\n" }, { "from": "human", "value": "# frozen_string_literal: true\nrequire 'logger'\nrequire 'kubernetes-deploy/deferred_summary_logging'\n\nmodule KubernetesDeploy\n class FormattedLogger < Logger\n inclu...
ruby
chosen
[ { "from": "system", "value": "Change name of plugin sample\n" }, { "from": "human", "value": "module Locomotive\n module Common\n module Plugins\n\n class Notifier\n def initialize(exception)\n exception.notifier.extend(UiDevNull)\n end\n\n module UiWithBee...
ruby
chosen
[ { "from": "system", "value": "Update Cli Class to include several methods to test that spec is working.\n" }, { "from": "human", "value": "class StlPublicServices::CliController\n\nend" }, { "from": "gpt", "value": "class StlPublicServices::CliController\n\n\tdef call\n\t\tstart\n\te...
ruby
chosen
[ { "from": "system", "value": "Remove URL expiry config value\n" }, { "from": "human", "value": "CarrierWave.configure do |config|\n if Rails.env.production?\n config.storage :fog\n config.fog_public = false\n config.fog_directory ...
ruby
chosen
[ { "from": "system", "value": "Remove HTTPStatusError as it's used nowhere anymore\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Discordrb\n # Custom errors raised in various places\n module Errors\n # Raised when authentication data is invalid or incorrect.\n ...
ruby
chosen
[ { "from": "system", "value": "Set ellipsis as the only truncation character\n" }, { "from": "human", "value": "class String\n def truncate(position, omission = '…')\n if self.length > position\n self.slice(0, position).concat(omission)\n else\n self\n end\n end\nend\n" }, ...
ruby
chosen
[ { "from": "system", "value": "Update Railtie initializer to run before config intializers\n" }, { "from": "human", "value": "require 'geocoder/models/active_record'\n\nmodule Geocoder\n if defined? Rails::Railtie\n require 'rails'\n class Railtie < Rails::Railtie\n initializer 'geoco...
ruby
chosen
[ { "from": "system", "value": "Revert \"avoid mutating datum in idempontent\"\n\nThis reverts commit dc635a574ab70385e2fecc05d41a67e4b2636214.\n" }, { "from": "human", "value": "module Excon\n module Middleware\n class Idempotent < Excon::Middleware::Base\n def error_call(datum)\n ...
ruby
chosen
[ { "from": "system", "value": "Remove default value for register_contract\n\nThere is no need to register a nil contract\n" }, { "from": "human", "value": "module Pacto\n class ContractRegistry\n def register_contract(contract = nil, *tags)\n tags << :default if tags.empty?\n\n tags...
ruby
chosen
[ { "from": "system", "value": "Add default setting to help of take command.\n" }, { "from": "human", "value": "require 'pebbles/tokyu_ruby_kaigi'\nrequire 'thor'\n\nmodule Pebbles\n module TokyuRubyKaigi\n class CLI < Thor\n desc \"next\", \"show next target day of TokyuRubyKaigi\"\n ...
ruby
chosen
[ { "from": "system", "value": "Replace view file by relative path.\n" }, { "from": "human", "value": "module RorVsWild\n module Plugin\n class ActionView\n def self.setup\n return if @installed\n return unless defined?(::ActiveSupport::Notifications.subscribe)\n Acti...
ruby
chosen
[ { "from": "human", "value": "Add rake task for seeding RW contests + contest categories for a season\n" }, { "from": "gpt", "value": "namespace :jmd do\n namespace :contests do\n desc \"Seed first-round (RW) contests for all hosts\"\n task seed_rw: :environment do\n puts \"What seaso...
ruby
chosen
[ { "from": "system", "value": "Add a sample array implementation, commented out.\n" }, { "from": "human", "value": "require 'rdf'\nrequire 'enumerator'\n\nmodule RDF\n class MyRepository < ::RDF::Repository\n\n def initialize(options = {})\n #TODO: Configure initialization\n raise N...
ruby
chosen
[ { "from": "system", "value": "Use primary_key for create/update rather than hardcoded :id\n" }, { "from": "human", "value": "module Commands\n\n class Create\n include Concord.new(:relation, :input, :validator)\n\n def self.build(relation, definition)\n new(relation, definition.input...
ruby
chosen
[ { "from": "system", "value": "Add source requirement to fileutils module.\n" }, { "from": "human", "value": "require 'logging'\nrequire 'optparse'\nrequire 'raml_parser'\nrequire 'json'\n\nmodule RamlPoliglota\n module Support\n\n class SourceLoader\n\n def initialize\n @ignorabl...
ruby
chosen
[ { "from": "system", "value": "Implement get top level method\n" }, { "from": "human", "value": "require \"snmpjr/version\"\n\nmodule Snmpjr\n # Your code goes here...\nend\n" }, { "from": "gpt", "value": "require \"snmpjr/version\"\nrequire \"snmpjr/pdu\"\nrequire \"snmpjr/session\"...
ruby
chosen