conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Make sure that the style guide renders all partials successfully\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe StyleGuidesController, type: :controller do\n describe 'GET #index' do\n def make_request\n get :index\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Add case of revival children first\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe PermanentRecords do\n let(:house) { House.create }\n let(:room) { house.rooms.create }\n\n describe '#revive' do\n context 'child validate presence of pa...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary call to dup\n" }, { "from": "human", "value": "module ActiveEncode\n module EngineAdapters\n class TestAdapter\n def initialize\n @encodes = {}\n end\n\n def create(input_url, options = {})\n new_encode = ActiveEnc...
ruby
chosen
[ { "from": "system", "value": "Allow initializing Instance with a preexisting server\n" }, { "from": "human", "value": "module Conjure\n class Instance\n attr_reader :origin, :ip_address, :rails_environment\n\n def initialize(options)\n @origin = options[:origin]\n @ip_address = ...
ruby
chosen
[ { "from": "system", "value": "Put extra payload in the args instead\n\npayload.merge! does not work in this case\n" }, { "from": "human", "value": "require 'travis/addons/handlers/base'\nrequire 'travis/addons/handlers/task'\nrequire 'travis/addons/handlers/github_status'\n\nmodule Travis\n mod...
ruby
chosen
[ { "from": "system", "value": "Support ruby http gem v1.0.0+\n" }, { "from": "human", "value": "module HTTP\n class Response\n def to_webmock\n webmock_response = ::WebMock::Response.new\n\n webmock_response.status = [status.to_i, reason]\n webmock_response.body = body.to_s...
ruby
chosen
[ { "from": "system", "value": "Update example to use predefinedAcl parameter\n" }, { "from": "human", "value": "# All examples presume that you have a ~/.fog credentials file set up.\n# More info on it can be found here: http://fog.io/about/getting_started.html\n\nrequire \"bundler\"\nBundler.req...
ruby
chosen
[ { "from": "human", "value": "Test for setting attributes that the receiver doesn't have\n" }, { "from": "gpt", "value": "require_relative 'spec_init'\n\nmodule Fixture\n module SetNotPresent\n class Example\n attr_accessor :some_attribute\n end\n\n def self.data\n data = {\n ...
ruby
chosen
[ { "from": "human", "value": "Update broadcast_id primary and foreign keys to bigint\n" }, { "from": "gpt", "value": "class ChangeBroadcastIdToBigint < ActiveRecord::Migration[6.0]\n def up\n change_column :broadcasts, :id, :bigint\n\n change_column :replies, :broadcast_id, :bigint\n ch...
ruby
chosen
[ { "from": "system", "value": "Fix broken restart with new Opsworks\n" }, { "from": "human", "value": "# Adapted from rails::configure: https://github.com/aws/opsworks-cookbooks/blob/master/rails/recipes/configure.rb\n\ninclude_recipe \"deploy\"\ninclude_recipe \"opsworks_sidekiq::service\"\nincl...
ruby
chosen
[ { "from": "system", "value": "Remove an old-ish commented-out line\n" }, { "from": "human", "value": "# frozen_string_literal: true\nrequire 'sequel'\nrequire 'sequel/model'\n\nmodule JobBoard\n module Models\n autoload :Image, 'job_board/models/image'\n\n class << self\n def db\n ...
ruby
chosen
[ { "from": "system", "value": "Simplify a weird conditional in chef-config\n\nif with ! is a brain twister.\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "#\n# Copyright:: Copyright (c) Chef Software Inc.\n# License:: Apache Licen...
ruby
chosen
[ { "from": "system", "value": "Add secret_key_base to the dummy app\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\n# Your secret key for verifying the integrity of signed cookies.\n# If you change this key, all old signed cookies will become inva...
ruby
chosen
[ { "from": "system", "value": "Fix intermittent section spec failure\n" }, { "from": "human", "value": "shared_context 'Section Progress Report' do\n let(:sections) { [] }\n let(:units) { [] }\n let(:classrooms) { [] }\n let(:students) { [] }\n let(:topics) { [] }\n before do\n ActivityS...
ruby
chosen
[ { "from": "system", "value": "Use Kernel.printf in Kernel.printf specs\n" }, { "from": "human", "value": "require_relative '../../spec_helper'\nrequire_relative 'fixtures/classes'\nrequire_relative 'shared/sprintf'\nrequire \"stringio\"\n\ndescribe \"Kernel#printf\" do\n it \"is a private metho...
ruby
chosen
[ { "from": "system", "value": "Print failed commands at debug log level\n" }, { "from": "human", "value": "module Lita\n module External\n class Robot < ::Lita::Robot\n\n class Ballot\n attr_accessor :veto\n def initialize\n @veto = false\n end\n end\n\...
ruby
chosen
[ { "from": "system", "value": "Revert \"Newer versions of acts_as_list changed default to 1.\"\n\nThis reverts commit 2f88c2d2abe94b074a30f9fd4751ea3d47355ba8.\n" }, { "from": "human", "value": "module Spree\n class Asset < Spree::Base\n belongs_to :viewable, polymorphic: true, touch: true\n ...
ruby
chosen
[ { "from": "system", "value": "Apply same logic for long line above\n" }, { "from": "human", "value": "module RightOn\n module RoleModel\n def self.included(base)\n base.module_eval 'has_and_belongs_to_many :roles, :class_name => \"RightOn::Role\"'\n Role.module_eval do\n has...
ruby
chosen
[ { "from": "system", "value": "Add Spree::Gateway::KomojuBankTransfer to spree payment methods\n" }, { "from": "human", "value": "module SpreeKomoju\n class Engine < Rails::Engine\n require 'spree/core'\n isolate_namespace Spree\n engine_name 'spree_komoju'\n\n initializer \"spree.ga...
ruby
chosen
[ { "from": "system", "value": "Fix for rake tasks to be able to process string IDs, not only integer ones\n" }, { "from": "human", "value": "namespace :friendly_id do\n desc \"Make slugs for a model.\"\n task :make_slugs => :environment do\n FriendlyId::TaskRunner.new.make_slugs do |record|\...
ruby
chosen
[ { "from": "human", "value": "Add ErrorCodes constants to avoid magic numbers\n" }, { "from": "gpt", "value": "module Twitter\n #If error code is missing see https://dev.twitter.com/docs/error-codes-responses\n module ErrorCodes\n AUTHENTICATION_PROBLEM = 32\n RESOURCE_NOT_FOUND ...
ruby
chosen
[ { "from": "system", "value": "Update message for Asset Packager test\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + '/../test/test_helper'\n\n# Test that helpers from Synthesis::AssetPackagerHelper are properly escaped.\nclass AssetPackagerTest < Test::Unit::TestCase\n\n $a...
ruby
chosen
[ { "from": "human", "value": "Add test for `edit` command\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nrequire \"./test/helper\"\n\nclean_describe \"edit\" do\n subject do\n stdout, stderr, status = Open3.capture3(\n \"EDITOR=cat bundle exec bin/friends --colorless -...
ruby
chosen
[ { "from": "system", "value": "Remove garbage from extracted content\n" }, { "from": "human", "value": "class PostIndexer\n include ApplicationHelper\n\n def initialize\n @sites = Groonga['Sites']\n @categories = Groonga['Categories']\n @participants = Groonga['Participants']\n @pos...
ruby
chosen
[ { "from": "system", "value": "Correct login URL in user notifier email\n" }, { "from": "human", "value": "class UserNotifier < ActionMailer::Base\n def forgot_password(user)\n recipients user.email_with_name\n from \"#{ASSOCIATION.short_name} <#{ASSOCIATION.email}>\"\n subject ...
ruby
chosen
[ { "from": "system", "value": "Dummy: Set ActiveText renderer for current request\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\nend\n" }, { "from": "gpt", "value": "class ApplicationController < ActionController::Base\n before_action :set_ac...
ruby
chosen
[ { "from": "system", "value": "Change error messages so errors will display under the answer form\n" }, { "from": "human", "value": "class AnswersController < ApplicationController\n def create\n @answer = Answer.new(params[:answer].permit(:content))\n @answer.question = Question.find(para...
ruby
chosen
[ { "from": "system", "value": "Remove policy default date filter\n\nThis is no longer needed and wasn't used when the new Policies went\nlive.\n" }, { "from": "human", "value": "require 'gds_api/helpers'\n\nclass FindersController < ApplicationController\n include GdsApi::Helpers\n before_filte...
ruby
chosen
[ { "from": "system", "value": "Add authorization helper function to Player model\n" }, { "from": "human", "value": "class PlayersController < ApplicationController\n\n def index\n @players = Player.all\n end\nend\n" }, { "from": "gpt", "value": "class PlayersController < Applicat...
ruby
chosen
[ { "from": "system", "value": "Add schools instance variable to index controller; use gon gem to also call all schools\n" }, { "from": "human", "value": "class SchoolsController < ApplicationController\n\n\tdef index\n\t\t@schools = School.all\n\tend\n\nend" }, { "from": "gpt", "value...
ruby
chosen
[ { "from": "system", "value": "Add method show to schools controller for each school\n" }, { "from": "human", "value": "class SchoolsController < ApplicationController\n\n\tdef search\n\t\t@location = Location.find_by(loc_code: params[\"loc_code\"])\n\t\tif @location.loc_code == \"nyc\"\n\t\t\t@r...
ruby
chosen
[ { "from": "system", "value": "Fix one more schema discrepancy\n" }, { "from": "human", "value": "class Types::TicketTypeType < Types::BaseObject\n field :id, Integer, null: false\n field :name, String, null: true\n field :publicly_available, Boolean, null: false\n field :counts_towards_conve...
ruby
chosen
[ { "from": "system", "value": "Fix assignee change in Issues::UpdateService\n\nSigned-off-by: Dmitriy Zaporozhets <be23d75b156792e5acab51b196a2deb155d35d6a@gmail.com>\n" }, { "from": "human", "value": "module Issues\n class UpdateService < BaseService\n def execute(issue)\n state = param...
ruby
chosen
[ { "from": "system", "value": "Drop performance tests for now :(\n" }, { "from": "human", "value": "require \"test_helper\"\n\ndescribe SecureCompare do\n it \"should return true for equal strings\" do\n SecureCompare.secure_compare(\"abc\", \"abc\").must_equal(true)\n end\n\n it \"should r...
ruby
chosen
[ { "from": "system", "value": "Change .tstudio => .studio. Now returns random recent post\n" }, { "from": "human", "value": "require 'nokogiri'\nrequire 'open-uri'\n\nclass Thestudio\n include Cinch::Plugin\n\n match /(tstudio)$/, prefix: /^(\\.)/\n match /(help tstudio)$/, method: :help, pref...
ruby
chosen
[ { "from": "system", "value": "Use a method to get the struct class.\n\nRather than depend on a constant naming convention, use an accessor method\nto retrieve a class's struct class.\n" }, { "from": "human", "value": "require 'ffi'\nrequire 'forwardable'\n\nmodule Blub\n class Struct < FFI::Str...
ruby
chosen
[ { "from": "system", "value": "Add rake to test dependencies.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/exponential_backoff/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Paweł Pacana\"]\n gem.email = ...
ruby
chosen
[ { "from": "system", "value": "Remove old model from migration\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass AddDescriptionToIssues < ActiveRecord::Migration[5.1]\n def change\n add_column :issues, :description_translations, :jsonb\n Issue.update_all(description...
ruby
chosen
[ { "from": "system", "value": "Fix date to ISO format\n" }, { "from": "human", "value": "require 'sinatra'\nrequire 'json'\nrequire 'config/db/seed'\n\nget '/projects' do\n JSON.dump(Seed::DB[:projects].map { |project|\n project_with_execution_cycle = project.clone\n project_with_execution...
ruby
chosen
[ { "from": "system", "value": "Fix a bug that gets the verify_credentials to each event\n" }, { "from": "human", "value": "# coding: utf-8\n\nrequire \"twitter\"\n\nclass Account\n attr_reader :rest\n\n def initialize(token)\n @rest = Twitter::REST::Client.new(token)\n @stream = Twitter::...
ruby
chosen
[ { "from": "system", "value": "Add minimum version restraints to omniauth and omniauth-google-oauth2\n\nRecently on several projects, when running `bundle update` we noticed\nthat all oauth* dependencies were getting severely downgraded. The only\nthing I can think of is that since we don't have a minimum ve...
ruby
chosen
[ { "from": "system", "value": "Add two test to search_form spec\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe SearchForm do\n\n let(:search) { SearchForm.new(location: '83 S King St., Seattle, WA', beverage: 'Beer', distance: 5) }\n\n describe '#generate_flights' do\n\n ...
ruby
chosen
[ { "from": "system", "value": "Change back the port offset.\n" }, { "from": "human", "value": "# Copyright 2010-2012 RethinkDB, all rights reserved.\n$LOAD_PATH.unshift('./lib')\nload 'rethinkdb.rb'\ninclude RethinkDB::Shortcuts\n$port_offset = 14850\n$c = r.connect('localhost', $port_offset + 28...
ruby
chosen
[ { "from": "system", "value": "Use maruku instead of rdiscount for JRuby compatibility\n" }, { "from": "human", "value": "# encoding: utf-8\nrequire File.expand_path('../lib/futures_pipeline/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.add_dependency 'faraday', '~> 0.7'\n gem.ad...
ruby
chosen
[ { "from": "system", "value": "Add watchOS target to podspec\n" }, { "from": "human", "value": "Pod::Spec.new do |spec|\n spec.name = 'Argo'\n spec.version = '2.0.0'\n spec.summary = 'Functional JSON parsing library for Swift.'\n spec.homepage = 'https://github.com/thoughtbot/Argo'\n spec.li...
ruby
chosen
[ { "from": "human", "value": "Add script for converting dictionary.txt to .hpp\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\n# convert dictionary.txt to an embeded C++ header\n\nexit unless File.exists? 'dictionary.txt'\n\nheader = <<HPP\n#include <map>\n#include <string>\n\nstatic const ...
ruby
chosen
[ { "from": "system", "value": "Return eligble fees with primary fee first\n\nCould do with a refactor - possibly to use the\nexisting `position` attribute for the fixed fee\ntypes.\n" }, { "from": "human", "value": "module Claims\n class FetchEligibleFixedFeeTypes\n def initialize(claim)\n ...
ruby
chosen
[ { "from": "system", "value": "Build payment method if present.\n" }, { "from": "human", "value": "# frozen_string_literal: true\njson.array! @subscriptions do |subscription|\n json.call subscription,\n :id,\n :billing_day_of_month,\n :created_at,\n :a...
ruby
chosen
[ { "from": "system", "value": "Fix `LineItemBuilder` assuming `subscribable_class` is `Spree::Variant`\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n# This class is responsible for taking SubscriptionLineItems and building\n# them into Spree::LineItems which can be added to ...
ruby
chosen
[ { "from": "system", "value": "Correct silly typo... agp => agb\n" }, { "from": "human", "value": "require 'cinch'\nrequire_relative 'bin/plugins'\n\nyong_bot = Cinch::Bot.new do\n configure do |c|\n c.server = \"#{ENV['SERVER']}\"\n c.channels = [\n \"#{ENV['CHANNEL_1']}\",\n \"...
ruby
chosen
[ { "from": "system", "value": "Check exit statuses against defined constants\n" }, { "from": "human", "value": "require \"example_helper\"\n\nFeature \"show metadata\" do\n in_order_to \"know about the application\"\n as_a \"user\"\n i_want_to \"see application metadata\"\n\n Scenario \"see v...
ruby
chosen
[ { "from": "human", "value": "Test for email confirmation page.\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe 'devise/mailer/confirmation_instructions.html.erb', :type => \"view\" do\n\n context \"logged in\" do\n before(:each) do\n @resource = mock_model(User)\n ...
ruby
chosen
[ { "from": "system", "value": "Add parenthesis to match for port\n" }, { "from": "human", "value": "require_relative 'spec_helper'\n\ndescribe 'Drone with custom configuration' do\n\n describe file('/etc/drone/drone.toml') do\n its(:content) { should match /port = \":443\"/ }\n end\n\n desc...
ruby
chosen
[ { "from": "system", "value": "Allow Payment Method Serializers to receive options\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Api\n module Admin\n class PaymentMethodSerializer < ActiveModel::Serializer\n delegate :serializable_hash, to: :method_serializer...
ruby
chosen
[ { "from": "system", "value": "Remove set_lang params and auto translating after setting\n" }, { "from": "human", "value": "module ChineseT2s\n module Middleware\n class TranslationT2s\n def initialize(app)\n @app = app\n end\n\n def call(env)\n set_lang = env['QU...
ruby
chosen
[ { "from": "system", "value": "Simplify the prefix extraction in TemplateHelper\n" }, { "from": "human", "value": "module Deface\n module TemplateHelper\n def self.lookup_context\n @lookup_context ||= ActionView::LookupContext.new(\n ActionController::Base.view_paths, {:formats =>...
ruby
chosen
[ { "from": "system", "value": "Update FC109s name per convo with coderanger\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "rule \"FC109\", \"Package resources should not specify the provider\" do\n tags %w{correctness}\n recipe ...
ruby
chosen
[ { "from": "system", "value": "Use threequals so avoid running afoul of BasicObjects\n" }, { "from": "human", "value": "module Impasta\n class MissingMethod < ::NoMethodError\n def initialize spy, parent_exception\n @spy, @parent_exception = spy, parent_exception\n @secrets = spy.im...
ruby
chosen
[ { "from": "human", "value": "Make NewRelic works with Unicorn\n" }, { "from": "gpt", "value": "# Ensure the agent is started using Unicorn\n# This is needed when using Unicorn and preload_app is not set to true.\n# See http://support.newrelic.com/kb/troubleshooting/unicorn-no-data\nNewRelic::Age...
ruby
chosen
[ { "from": "system", "value": "Enable feature test for redirect after login\n" }, { "from": "human", "value": "# coding: utf-8\n\nrequire 'rails_helper'\n\nRSpec.describe \"Users\", type: :feature do\n before do\n OauthProvider.create! name: 'facebook', key: 'dummy_key', secret: 'dummy_secret...
ruby
chosen
[ { "from": "system", "value": "Fix spec failure for line\n\nChanges in requirements for painter to run weren't set properly in this spec.\n" }, { "from": "human", "value": "require 'swt_shoes/spec_helper'\n\ndescribe Shoes::Swt::Line do\n include_context \"swt app\"\n\n let(:container) { double...
ruby
chosen
[ { "from": "human", "value": "Add tests for table and renderer integration.\n" }, { "from": "gpt", "value": "# -*- encoding: utf-8 -*-\n\nrequire 'spec_helper'\n\ndescribe TTY::Table, '#to_s' do\n let(:header) { ['h1', 'h2', 'h3'] }\n let(:rows) { [['a1', 'a2', 'a3'], ['b1', 'b2', 'b3']] }\n l...
ruby
chosen
[ { "from": "system", "value": "FIX: Fix heisentest caused by float operations.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'rails_helper'\n\nRSpec.describe PostCreator do\n let(:topic) { Fabricate(:post).topic }\n\n before do\n SiteSetting.queue_jobs = true\n ...
ruby
chosen
[ { "from": "system", "value": "Remove characters from the title that broke the test in 1.9\n" }, { "from": "human", "value": "require_relative \"shared/enumerable_shared\"\n\ndescribe \"Enumerable#grep\" do\n\tinclude_context \"Enumerable shared\"\n \n \n context \"if no block is given\" do\n ...
ruby
chosen
[ { "from": "system", "value": "Update primary key for dl_keyed_join\n\nThe primary_key for the `dl_keyed_join` relation was incorrect. It\nexpected to use a `joins_key` attribute on the parent record in order\nto link to the `dl_keyed_join` record. The parent class does not have a\n`joins_key` attribute at ...
ruby
chosen
[ { "from": "system", "value": "Fix the redirect problem when signing up.\n" }, { "from": "human", "value": "class User::RegistrationsController < ApplicationController\n \n def create\n # creates a user with an email / password.\n params[:user][:seed_code] = session[:seed_code] unless par...
ruby
chosen
[ { "from": "system", "value": "Make repo maintainence workers unique by repo\n\nThis should avoid a deadlock case that we've happened to hit\n" }, { "from": "human", "value": "# frozen_string_literal: true\nclass RepositoryMaintenanceStatWorker\n include Sidekiq::Worker\n sidekiq_options qu...
ruby
chosen
[ { "from": "system", "value": "Fix podspec to remove duplicate symbol link errors\n\n- Changed the podspec to eliminate Xcode 5 linker errors due to duplication\n symbols.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"NJKWebViewProgress\"\n s.version = \"0.2...
ruby
chosen
[ { "from": "human", "value": "Add Process Monitor API tracing monitor support.\n" }, { "from": "gpt", "value": "module RCI\n module Tracers\n class ProcessMonitor\n\n def initialize\n # FIXME ensure :name matches and is :active\n @tracer = RCI::CONFIG[:tracer][:exe]\n ...
ruby
chosen
[ { "from": "system", "value": "Change to allow nil data for exit error\n" }, { "from": "human", "value": "# encoding: utf-8\n\nmodule TTY\n class Command\n # An ExitError reports an unsuccessful exit by command.\n #\n # The error message includes:\n # * the name of command executed\...
ruby
chosen
[ { "from": "system", "value": "Add missing double for zendesk sso spec\n\nSigned-off-by: Will Fisher <392743f9dc9e2aef3201bd7129e55eb620ce557e@chef.io>\n" }, { "from": "human", "value": "require 'cgi'\nrequire 'uri'\nrequire 'spec_helper'\n\ndescribe ZendeskSSOURL do\n subject(:zendesk_sso_url) ...
ruby
chosen
[ { "from": "system", "value": "Fix hidden budget investments restore feature\n\nAdd recursive restore option to restore all soft deleted relations.\n" }, { "from": "human", "value": "class Admin::HiddenCommentsController < Admin::BaseController\n has_filters %w{without_confirmed_hide all with_co...
ruby
chosen
[ { "from": "system", "value": "Implement save with strong_parameters with fallback when unavailable.\n" }, { "from": "human", "value": "require_dependency \"datatable_state/application_controller\"\n\nmodule DatatableState\n class StoreController < ApplicationController\n respond_to :json\n ...
ruby
chosen
[ { "from": "system", "value": "Fix a unit test of Retryable job extension.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe QueueingRabbit::JobExtensions::Retryable do\n\n let(:test_job) {\n Class.new(QueueingRabbit::AbstractJob) do\n include QueueingRabbit::JobExtens...
ruby
chosen
[ { "from": "system", "value": "Use stable icon for Mattermost integration\n" }, { "from": "human", "value": "class Projects::MattermostsController < Projects::ApplicationController\n include TriggersHelper\n include ActionView::Helpers::AssetUrlHelper\n\n layout 'project_settings'\n\n before_...
ruby
chosen
[ { "from": "human", "value": "Remove guides from search index that were reverted to draft.\n\nThe data migration 20121008103408_revert_detailed_guides_to_draft\nremoved a number of guides from the public site without removing\nthem from the search index. This fixes that omission.\n" }, { "from": "gp...
ruby
chosen
[ { "from": "system", "value": "Handle seed text with only one word\n" }, { "from": "human", "value": "# This class, given a seed text and a dictionary, will attempt to construct a new text.\nmodule MarkovChain\n class TextBuilder\n attr_reader :seed_text, :dictionary\n def initialize(seed_...
ruby
chosen
[ { "from": "system", "value": "Add X-Request-Id header in response\n" }, { "from": "human", "value": "require 'securerandom'\n\nmodule Superintendent::Request\n class Id\n X_REQUEST_ID = 'HTTP_X_REQEUST_ID'.freeze\n\n def initialize(app)\n @app = app\n end\n\n def call(env)\n ...
ruby
chosen
[ { "from": "system", "value": "Remove dependency on devise_group (v3.3)" }, { "from": "human", "value": "module DoorkeeperSsoClient\n module Mixins\n module ControllerHelpers\n extend ActiveSupport::Concern\n\n module ClassMethods\n def activate_sso(scope, options = {})\n ...
ruby
chosen
[ { "from": "system", "value": "Add cucumber and rspec dependencies\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'seed_scatter/version'\n\nGem::Specification.new do |spec|\n spec.na...
ruby
chosen
[ { "from": "system", "value": "Correct target of firehose spec tests\n\nThe tests for the firehose instance group were targetting the\nprometheus2 instance group instead.\n" }, { "from": "human", "value": "RSpec.describe \"Monitor CF\" do\n it \"adds the firehose instance_group\" do\n firehos...
ruby
chosen
[ { "from": "system", "value": "Update only builds that need to be updated in pull_request_data rake task\n" }, { "from": "human", "value": "namespace :build do\n namespace :migrate do\n task :pull_request_data do\n require 'travis'\n Travis::Database.connect\n\n Build.pull_requ...
ruby
chosen
[ { "from": "system", "value": "Clean up InstallBuckets action a bit\n" }, { "from": "human", "value": "require_relative '../bucket'\n\nmodule VagrantPlugins\n module Cachier\n class Action\n class InstallBuckets\n def initialize(app, env)\n @app = app\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Work around ruby 1.8 mimetype conflict\n\nThinking we should just drop support entirely since there is a ton of\ncommunity outrage around this.\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"gyoku/version\"\n\nGem::Speci...
ruby
chosen
[ { "from": "system", "value": "Add user email scope to OmniAuth initializer\n\n* Add user email scope to OmniAuth initializer to gain read access to email\n* addresses of GitHub users whose email addresses are private\n" }, { "from": "human", "value": "Rails.application.config.middleware.use Omni...
ruby
chosen
[ { "from": "system", "value": "Test environment now uses memory repository\n" }, { "from": "human", "value": "# Settings specified here will take precedence over those in config/environment.rb\n\n# The test environment is used exclusively to run your application's\n# test suite. You never need t...
ruby
chosen
[ { "from": "system", "value": "Add 'dm-transactions' as gem dependency\n\n* For the time-being this is required.\n\nSigned-off-by: Alex Coles <60c6d277a8bd81de7fdde19201bf9c58a3df08f4@alexcolesportfolio.com>\n" }, { "from": "human", "value": "require File.expand_path('../lib/friendly_id/datamappe...
ruby
chosen
[ { "from": "system", "value": "Make validate a private method of Constant\n\nThis means we now have an invariant with Constants - that any\nConstant visible to the rest of the system (that is, with Constant.new)\nis valid since validation is performed during init.\n" }, { "from": "human", "value"...
ruby
chosen
[ { "from": "system", "value": "Add filename for multi reports\n" }, { "from": "human", "value": "class Dossier::MultiReport\n include Dossier::Model\n\n attr_accessor :options\n\n class << self\n attr_accessor :reports\n end\n\n def self.combine(*reports)\n self.reports = reports\n en...
ruby
chosen
[ { "from": "system", "value": "Improve formatting of help message\n" }, { "from": "human", "value": "require 'optparse'\nmodule Lifelike\n module CLI\n class Options\n def self.parse!(argv)\n new.parse!(argv)\n end\n\n def initialize\n @options = default_options\n...
ruby
chosen
[ { "from": "system", "value": "Test for translation_metadata before using it.\n" }, { "from": "human", "value": "require \"paperclip/globalize3/version\"\nrequire \"paperclip/globalize3/attachment\"\n\nrequire \"globalize\"\nrequire \"paperclip\"\n\nPaperclip.interpolates(:locale) { |attachment, ...
ruby
chosen
[ { "from": "system", "value": "Fix name method in error for RRJTask class\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n# @author VAILLANT Jeremy <jeremy.vaillant@dazzl.tv>\n\nmodule RubyRabbitmqJanus\n # Define all error in gem\n module Errors\n # Define a super class ...
ruby
chosen
[ { "from": "system", "value": "Add get_servers method to Project model.\n" }, { "from": "human", "value": "module Semaphoreapp\n class Project < Base\n\n def get_branches\n Semaphoreapp::Branch.all_by_project_hash_id(hash_id)\n end\n\n def master_branch_status\n branches.find{...
ruby
chosen
[ { "from": "system", "value": "Add conekta payments to spree payment methods\n" }, { "from": "human", "value": "module SpreeConekta\n class Engine < ::Rails::Engine\n require 'spree'\n\n engine_name 'spree_gateway'\n\n config.autoload_paths += %W(#{config.root}/lib)\n\n # use rspec f...
ruby
chosen
[ { "from": "system", "value": "Set default breadcrumb prefix to empty\n" }, { "from": "human", "value": "class BreadcrumbConf < Conf\n acts_as_configurable do |c|\n c.string :prefix, :default => I18n.t('breadcrumb_conf.default.prefix')\n c.string :separator, :default =...
ruby
chosen
[ { "from": "system", "value": "Validate access tokens against the WOO API\n\nSometimes access tokens become invalid although they are not expired yet\n" }, { "from": "human", "value": "module WooApi\n module AppApi\n class Base\n def self.build_request(path, configuration = {})\n ...
ruby
chosen
[ { "from": "human", "value": "Add file for ruby review\n" }, { "from": "gpt", "value": "# I worked on this challenge [by myself, with: ].\n# This challenge took me [#] hours.\n\n# Pseudocode\n\n\n\n# Initial Solution\n\ndef is_fibonacci?(num)\n\nend\n\n\n\n# Refactored Solution\n\n\n\n\n\n\n\n# R...
ruby
chosen
[ { "from": "system", "value": "Fix up the Less converter for the newer version\n" }, { "from": "human", "value": "# Build .less files into CSS\n#\n\nmodule Jekyll\n require 'less'\n class LessConverter < Converter\n safe true\n priority :normal\n\n def matches(ext)\n ext =~ /less/...
ruby
chosen
[ { "from": "system", "value": "Update gem requirements to indicate node.js dependency.\n\nWe explicitly use node.js for the r.js build; ExecJS can use runtimes\nunsupported by r.js.\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:...
ruby
chosen
[ { "from": "system", "value": "Add spec for `markdo --version`\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'stringio'\nrequire 'markdo/cli'\n\nmodule Markdo\n describe CLI do\n describe 'given \"version\"' do\n it 'prints the version' do\n out, err, env = bui...
ruby
chosen