conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Bring calculator factories from spree_core\n" }, { "from": "human", "value": "FactoryBot.define do\n sequence(:calculator_amount)\n factory :calculator_per_item, class: Calculator::PerItem do\n preferred_amount { generate(:calculator_amount) }\n end\n\n facto...
ruby
chosen
[ { "from": "system", "value": "Remove aws-sdk from the gemspec file\n" }, { "from": "human", "value": "require_relative 'lib/redshift_connector/version'\n\nGem::Specification.new do |s|\n s.platform = Gem::Platform::RUBY\n s.name = 'redshift-connector'\n s.version = RedshiftConnector::VERSION\...
ruby
chosen
[ { "from": "system", "value": "Remove logging of request in test\n" }, { "from": "human", "value": "describe Travis::API::V3::Services::User::Logout, set_app: true do\n let(:user) { Travis::API::V3::Models::User.find_by_login('svenfuchs') }\n\n let(:token) { Travis::Api::App::AccessToken.crea...
ruby
chosen
[ { "from": "system", "value": "Add uploads to :pet factory.\n" }, { "from": "human", "value": "require 'faker'\n\nFactoryGirl.define do\n\n sequence :pet_sample do |n|\n Faker::Pet.pets[n%Faker::Pet.pets.size]\n end\n\n factory :pet do\n ignore do\n sample { OpenStruct.new(generate ...
ruby
chosen
[ { "from": "system", "value": "Add initial specs for Findrepos.list\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Findrepos do\n it 'has a version number' do\n expect(Findrepos::VERSION).not_to be nil\n end\n\n it 'does something useful' do\n expect(false).to eq(tr...
ruby
chosen
[ { "from": "system", "value": "Update after sign up redirection link\n" }, { "from": "human", "value": "class Teammates::RegistrationsController < Devise::RegistrationsController\n before_filter :configure_sign_up_params, only: [:create]\n before_filter :configure_account_update_params, only: [...
ruby
chosen
[ { "from": "human", "value": "Add cask for IntelliJ IDEA 14.0 (old version).\n" }, { "from": "gpt", "value": "cask :v1 => 'intellij-idea14_0' do\n version '14.0.4'\n sha256 'b733aa89ffc48ee9b487bc6afb1f3efad79ae0de4e1ab0bb5b3fd840bc5cc52c'\n\n url \"https://download.jetbrains.com/idea/ideaIU-#...
ruby
chosen
[ { "from": "system", "value": "Upgrade Plex Home Theater to v1.2.1.314 and add 64bits version\n" }, { "from": "human", "value": "class PlexHomeTheater < Cask\n version '1.0.9.180'\n sha256 'f7c51b212febafbca77e0af193819c7d7035a38600d65550db1362edadee31b7'\n\n url 'http://downloads.plexapp.com/...
ruby
chosen
[ { "from": "system", "value": "Fix migration NameError in rails env helper\n\nWe need to use double quotes within the command, as the entire command is\nwrapped in single quotes.\n\nChangelog: fixed\n" }, { "from": "human", "value": "class GitlabRailsEnvHelper\n class << self\n # Get the db v...
ruby
chosen
[ { "from": "system", "value": "Make ajax calls work. Maybe too agressive?\n" }, { "from": "human", "value": "# Filters added to this controller apply to all controllers in the application.\n# Likewise, all the methods added will be available for all controllers.\n\nclass ApplicationController < A...
ruby
chosen
[ { "from": "system", "value": "Rename get_article to retrieve_article for clarity\n" }, { "from": "human", "value": "module ArticlesHelper\n def article_params \n params.require(:article).permit(:title, :body)\n end \n\n def get_article \n @article = Article.find(params[:id])\n @artic...
ruby
chosen
[ { "from": "system", "value": "Add until terminate loop, structure.\n" }, { "from": "human", "value": "module PPCurses\n\n # noinspection RubyClassVariableUsageInspection\n class Application\n\n @@shared_app\n\n def initialize\n @screen = PPCurses::Screen.new\n\n @menubar = PPCu...
ruby
chosen
[ { "from": "human", "value": "Allow marshalled legacy objects to work\n\nWhere a Deferred::Visitor has been marshalled, it can't be unmarshalled\nunless the similarly-named class exists. The simplest solution is to\ncreate a namespaced subclass.\n\nThis can be removed in due course, once no legacy marshalled...
ruby
chosen
[ { "from": "system", "value": "Fix deploys controller user info\n" }, { "from": "human", "value": "class DeploysController < ApplicationController\n include ChunksHelper\n\n before_action :load_stack\n before_action :load_deploy, only: :show\n before_action :load_until_commit, only: :create\n...
ruby
chosen
[ { "from": "human", "value": "Add gemspec for placeholder reg engine\n" }, { "from": "gpt", "value": "Gem::Specification.new do |s|\n s.name = \"registration_engine\"\n s.version = \"0.0.1\"\n s.authors = [ \"Scott Willson\" ]\n s.email = [ \"scott.willson@gmail.com\" ]\n...
ruby
chosen
[ { "from": "system", "value": "Clear after_signin_url from session after using it so it's not used next time.\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n\tdef create\n\t\tuser = User.from_omniauth(env[\"omniauth.auth\"])\n\t\tsession[:user_id] = user.id\n...
ruby
chosen
[ { "from": "system", "value": "Fix instrument project path bug\n" }, { "from": "human", "value": "class VersionsController < ApplicationController\n def index\n @project = Project.find(params[:project_id])\n @instrument = Instrument.find(params[:instrument_id])\n end\n\n def show\n @i...
ruby
chosen
[ { "from": "system", "value": "Add surveys/:id/questions index route in surveys controller\n" }, { "from": "human", "value": "get '/surveys' do\n @surveys = Survey.all\n erb :\"surveys/index\"\nend\n\nget '/surveys/new' do\n erb :\"surveys/new\"\nend\n\npost '/surveys' do\n @survey = Survey.n...
ruby
chosen
[ { "from": "system", "value": "Modify my_stories action in writers controller and fix white list error\n" }, { "from": "human", "value": "class WritersController < ApplicationController\n before_action :authenticate_user!, except: [:index, :show]\n before_action :get_user, only: :show\n before...
ruby
chosen
[ { "from": "system", "value": "Use URI::DEFAULT_PARSER.make_regexp instead of URI.regexp\n" }, { "from": "human", "value": "module FrancisCms\n class Syndication < ActiveRecord::Base\n belongs_to :syndicatable, polymorphic: true\n\n validates :url, :name, presence: true\n validates :url...
ruby
chosen
[ { "from": "system", "value": "Use map instead of pluck as it gives non-deterministic behaviour.\n" }, { "from": "human", "value": "class SalaryBookingTemplate < BookingTemplate\n # Obligation flags\n def self.saldo_inclusion_flags\n SalaryBookingTemplate.tag_counts_on(:include_in_saldo).plu...
ruby
chosen
[ { "from": "system", "value": "Add spec coverage for unknown flags and debug output\n" }, { "from": "human", "value": "require_relative '../helper'\n\ndescribe 'sfn' do\n def be_sh(command, options={})\n result = `bundle exec #{command}`\n unless($?.success?)\n unless(options[:fail] =...
ruby
chosen
[ { "from": "system", "value": "Use sufficient a regexp anchor to check `@response.content_type.to_s`\n\nThis commit follows up of ea9bc06c9a47b839d5e2db94ba6bf7e29c8f0ae9.\nTo check `@response.content_type.to_s` is ended with `\"xml\"`,\nto use `\\z` is sufficient.\n" }, { "from": "human", "value...
ruby
chosen
[ { "from": "system", "value": "Remove support for Rails 5" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'serial_preference/version'\n\nGem::Specification.new do |gem|\n gem....
ruby
chosen
[ { "from": "system", "value": "Add swift_version declaration to podspec\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"KYDrawerController\"\n s.version = \"2.1.0\"\n s.summary = \"KYDrawerController is a side drawer navigation container view controller.\...
ruby
chosen
[ { "from": "system", "value": "Truncate unit on order listing\n" }, { "from": "human", "value": "module OrdersPlugin::PriceHelper\n\n protected\n\n def price_with_unit_span price, unit, detail=nil\n return nil if price.blank?\n detail ||= ''\n detail = \" (#{detail})\" unless detail.bl...
ruby
chosen
[ { "from": "system", "value": "Fix bug in AdminChapter model (symbol instead of variable identifier)\n" }, { "from": "human", "value": "class AdminChapter < ActiveRecord::Base\n belongs_to :admin\n belongs_to :chapter\n\n def self.authorized?(admin_id, chapter_id)\n if AdminChapter.where(ad...
ruby
chosen
[ { "from": "system", "value": "Check that congress message is enabled\n" }, { "from": "human", "value": "class Admin::EventsController < Admin::ApplicationController\n include DateRange\n\n def index\n if params[:type].blank?\n @data = events.group_by_type_in_range(start_date, end_date)...
ruby
chosen
[ { "from": "system", "value": "Use stop type in finding stops in area\n" }, { "from": "human", "value": "class Gazetteer \n \n def self.find_stops_from_attributes(attributes)\n localities = Locality.find_all_by_name(attributes[:area])\n localities.map{ |locality| locality.stops }.flatten....
ruby
chosen
[ { "from": "system", "value": "Change formatting of `Check it out` link\n" }, { "from": "human", "value": "class NewPropNotification < BaseNotification\n include Rails.application.routes.url_helpers\n\n pattr_initialize :prop_receivers, :prop_giver, :content\n\n def body\n \"#{prop_giver} j...
ruby
chosen
[ { "from": "system", "value": "Add output logging to Aruba tests.\n" }, { "from": "human", "value": "require 'aruba/cucumber'" }, { "from": "gpt", "value": "require 'aruba/cucumber'\n%x'rm -rf ../Build/log'\n%x'mkdir ../Build/log'\n\nAfter do |scenario|\n\t%x'cp -R ../Build/tmp ../Bui...
ruby
chosen
[ { "from": "system", "value": "Validate presence of export_url, token, and external_id for Practice" }, { "from": "human", "value": "module Comptroller\n class Practice\n include Her::Model\n use_api BILLING_API\n collection_path 'practices'\n include_root_in_json true\n\n def eql...
ruby
chosen
[ { "from": "human", "value": "Add spec for add row performance\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nrequire \"rspec-benchmark\"\n\nRSpec.describe TTY::Table, \"#<<\" do\n include RSpec::Benchmark::Matchers\n\n let(:array) { [] }\n let(:table) { described_class.new ...
ruby
chosen
[ { "from": "system", "value": "Update for the new udev rule location\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "#\n# Cookbook Name:: smith-hardware\n# Recipe:: default\n#\n# Copyright 2015, Tim Smith\n#\n# Licensed under the A...
ruby
chosen
[ { "from": "system", "value": "Update for newer versions of Tilt.\n" }, { "from": "human", "value": "require \"compass\"\nrequire \"tilt/css\"\n\nmodule Pith\n module Compass\n\n module Initialize\n\n def initialize(file=nil, line=1, options={}, &block)\n options = options.merge(:...
ruby
chosen
[ { "from": "system", "value": "Add Sentry debug env var\n" }, { "from": "human", "value": "Sentry.init do |config|\n config.dsn = ENV[\"SENTRY_DSN\"]\n config.breadcrumbs_logger = [:active_support_logger, :http_logger]\n config.enabled_environments = %w[production]\nend\n" }, { "from":...
ruby
chosen
[ { "from": "system", "value": "Reorganize usings, remove unnecessary lines.\n" }, { "from": "human", "value": "require \"discourse_api/version\"\nrequire \"discourse_api/client\"\nrequire \"set\"\n\nmodule DiscourseApi\nend\n" }, { "from": "gpt", "value": "require \"discourse_api/clie...
ruby
chosen
[ { "from": "human", "value": "Add spec to test configured_system_provision button\n" }, { "from": "gpt", "value": "describe ApplicationHelper::Button::ConfiguredSystemProvision do\n let(:view_context) { setup_view_context_with_sandbox({}) }\n subject { described_class.new(view_context, {}, {'re...
ruby
chosen
[ { "from": "system", "value": "Remove drop_table line from Venue migration\n" }, { "from": "human", "value": "class CreateVenues < ActiveRecord::Migration[5.2]\n def change\n drop_table :venues\n create_table :venues do |t|\n t.string :name\n t.string :purpose\n t.string :gr...
ruby
chosen
[ { "from": "system", "value": "Remove taggins.tag_context column if exists\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass CreateTags < ActiveRecord::Migration[4.2]\n def change\n unless table_exists?(:tags)\n create_table :tags do |t|\n t.string :name, n...
ruby
chosen
[ { "from": "system", "value": "Update model patch example to include the default_letter param override\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/envi...
ruby
chosen
[ { "from": "system", "value": "Add some units columns and remove some comments\n" }, { "from": "human", "value": "require 'data_miner'\n\nmodule BrighterPlanet\n module Purchase\n module Data\n def self.included(base)\n base.data_miner do\n schema do\n integer ...
ruby
chosen
[ { "from": "system", "value": "Use user location filter incase a search not provided\n" }, { "from": "human", "value": "class PrepareSearchParams\n attr_reader :params, :current_recruiter\n\n def initialize(params, current_recruiter)\n @params = params\n @current_recruiter = current_recru...
ruby
chosen
[ { "from": "system", "value": "Increase points after round rather than replace\n" }, { "from": "human", "value": "require 'pp'\n\nclass CardPlayed < Event\n POINTS_PER_TRICK = 10\n\n def apply(game_state)\n @game_state = game_state\n\n game_state.hand(player).delete(card)\n trick.play(...
ruby
chosen
[ { "from": "system", "value": "Use Release::VERSION_STORAGE_FORMAT to validate semver, not Release::VERSION_INPUT_FORMAT\n" }, { "from": "human", "value": "# Rake task \"requires\" this.\n\nmodule Releases\n class Create < Mutations::Command\n required do\n # \"https://github.com/FarmBot...
ruby
chosen
[ { "from": "system", "value": "Fix a mistake in the scope example.\n" }, { "from": "human", "value": "# The administrations controller is nested under organizations (ie. /organizations/3214/administrations)\nclass PagesController < ApplicationController\n # The following rule only allows @authen...
ruby
chosen
[ { "from": "system", "value": "Fix mailer settings using new format\n" }, { "from": "human", "value": "class PantographMailer < ActionMailer::Base\n default from: Settings.admin.email\n\n def tweet_failed(message)\n @message = message\n\n mail(\n to: Settings.monitoring.email,\n ...
ruby
chosen
[ { "from": "system", "value": "Add image attribute and fix currency unit\n" }, { "from": "human", "value": "module Api\n module Presenter\n class User\n def initialize(user)\n @user = user\n end\n\n def as_json(options = {})\n {\n id: @user.id.to_s,\n ...
ruby
chosen
[ { "from": "system", "value": "Implement functional_sum for special case of 3 and 5\n" }, { "from": "human", "value": "#!/usr/local/bin/ruby\n\n\nclass FactorSum\n attr_accessor :factors\n\n @factors = []\n @highest = 0\n @sum = nil\n\n class << self\n def imperative\n new(factors, h...
ruby
chosen
[ { "from": "system", "value": "Add current group subdomain shared context.\n\nDon't need to do before and after setting with it.\n" }, { "from": "human", "value": "shared_context \"with subdomain\", use: :subdomain do\n def set_subdomain(subdomain)\n @original_default_host = Capybara.default_...
ruby
chosen
[ { "from": "human", "value": "Add unit tests for Status class\n" }, { "from": "gpt", "value": "require 'hashie/mash'\n\ndescribe Twterm::Status do\n let(:status) { described_class.new(Twitter::Tweet.new(json)) }\n let(:json) { JSON.parse(fixture('status.json'), symbolize_names: true) }\n\n des...
ruby
chosen
[ { "from": "system", "value": "Add volume methods for CargoCarriage\n" }, { "from": "human", "value": "require_relative 'carriage.rb'\n\nclass CargoCarriage < Carriage \n def initialize\n @type = :cargo\n end\nend" }, { "from": "gpt", "value": "require_relative 'carriage.rb'\n\nc...
ruby
chosen
[ { "from": "system", "value": "Remove warning messages about multiple include\n" }, { "from": "human", "value": "module ApiMonkey::FilterScopes\n extend ActiveSupport::Concern\n\n included do\n OPERANDS = {\n 'eq' => '=',\n 'gt' => '>',\n 'lt' => '<',\n 'geq' => '>=',\n ...
ruby
chosen
[ { "from": "human", "value": "Add matcher for javascript error checking\n" }, { "from": "gpt", "value": "module Capybara\n module Webkit\n module RspecMatchers\n extend RSpec::Matchers::DSL\n\n matcher :have_errors do |expected|\n match do |actual|\n actual = resolve...
ruby
chosen
[ { "from": "system", "value": "Add display name for guest device\n" }, { "from": "human", "value": "class GuestDevice < ApplicationRecord\n belongs_to :hardware\n\n has_one :vm_or_template, :through => :hardware\n has_one :vm, :through => :hardware\n has_one :miq_template, :thro...
ruby
chosen
[ { "from": "system", "value": "Use Mobility.query_method instead of hard-coding i18n scope\n" }, { "from": "human", "value": "module Mobility\n module ActiveRecord\n class UniquenessValidator < ::ActiveRecord::Validations::UniquenessValidator\n def validate_each(record, attribute, value)...
ruby
chosen
[ { "from": "system", "value": "Update holding row selector based on Bootstrap 3\n" }, { "from": "human", "value": "module GetItFeatures\n module HoldingHelper\n def primo_id_for_holding_state(state)\n PrimoId.new(state).id\n end\n\n def primo_referrer_id_for_holding_state(state)\n ...
ruby
chosen
[ { "from": "system", "value": "Add a test for the 9 problem.\n\nThe original C implementation contained a bug misclassifying the number 9 as\nbeing in the SYMBOLS_OTHER group, not the NUMBERS group. Add a test to\ncheck for this.\n\nSigned-off-by: brian m. carlson <738bdd359be778fee9f0fc4e2934ad72f436ceda@c...
ruby
chosen
[ { "from": "system", "value": "Add pivotal tracker project id to config\n" }, { "from": "human", "value": "module HerokuFeatureDeployments\n class Configuration\n attr_accessor :heroku_api_key, :dnsimple_username, :dnsimple_api_key,\n :addons, :env_vars, :logger, :pivotal_tracker_api_key...
ruby
chosen
[ { "from": "system", "value": "Refactor to make the code simpler.\n" }, { "from": "human", "value": "require_relative 'mayusculas'\n\nmodule Identificamex\n module Nombre\n\n # Clase base para normalizar las cadenas de nombres y apellidos. La clase\n # se encarga de convertir a mayúsculas ...
ruby
chosen
[ { "from": "human", "value": "Add automation engine service model for SwiftManager\n\nOmitted from prior commits.\n" }, { "from": "gpt", "value": "module MiqAeMethodService\n class MiqAeServiceManageIQ_Providers_StorageManager_SwiftManager < MiqAeServiceManageIQ_Providers_StorageManager\n exp...
ruby
chosen
[ { "from": "system", "value": "Raise exception if isn't string\n" }, { "from": "human", "value": "module Embulk\n module Guess\n\n class JoniRegexp < GuessPlugin\n Plugin.register_guess(\"joni_regexp\", self)\n \n def guess(config, sample_buffer)\n parser_config = config[...
ruby
chosen
[ { "from": "system", "value": "Fix currency order in rate and add reversed rate\n" }, { "from": "human", "value": "require 'kazakhstan_national_bank/version'\nrequire 'money'\nrequire 'open-uri'\nrequire 'rss'\n\nclass Money\n module Bank\n class KazakhstanNationalBank < Money::Bank::Variable...
ruby
chosen
[ { "from": "system", "value": "Refactor get() to reflect changes in memcached\n" }, { "from": "human", "value": "#\n# Allow get method to returns value + entry's flags\n# This is useful to set compression flag.\n#\nmodule GetWithFlags\n def get(keys, marshal=true, with_flags=false)\n if keys....
ruby
chosen
[ { "from": "system", "value": "Fix GP test crash by changing table names\n" }, { "from": "human", "value": "module Rake\n module TableTask\n module TableCreation\n OLDTABLE = \"old\"\n NEWTABLE = \"new\"\n\n def create_timed_tables(old_table, *new_tables)\n return if (Ta...
ruby
chosen
[ { "from": "system", "value": "Add basic details to the 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 'rails_nlp/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Change API env var name\n" }, { "from": "human", "value": "GDS::SSO.config do |config|\n config.user_model = \"User\"\n config.oauth_id = ENV['PUBLISHER_OAUTH_ID'] || \"abcdefghjasndjkasndpublisher\"\n config.oauth_secret = ENV['PUBLISHER_OAUTH_SECRET'] || ...
ruby
chosen
[ { "from": "human", "value": "Add initializer and rely on ENV var to store Rollbar token\n" }, { "from": "gpt", "value": "Rollbar.configure do |config|\n # Without configuration, Rollbar is enabled in all environments.\n # To disable in specific environments, set config.enabled=false.\n\n conf...
ruby
chosen
[ { "from": "system", "value": "Reset elasticsearch to use default port\n\n- config/initializers/searchbox.rb - The defauult host & port should\n be \"http://localhost:9200\", not \"http://localhost:8081\". Fixed\n the initializer to reflect that\n\nUpdates #894\n" }, { "from": "human", "value":...
ruby
chosen
[ { "from": "system", "value": "Add sqlite3 gem dev dependency\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'p4/chips/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Fix one instance of `render(:text => ....)`\n\nThis has been deprecated https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#removed-deprecated-support-to-text-and-nothing-in-render\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe \"render...
ruby
chosen
[ { "from": "system", "value": "Simplify ENV vars for cukes.\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'bundler'\nBundler.setup\n\nrequire 'ruby-debug' if !defined?(RUBY_ENGINE) && RUBY_VERSION != '1.9.3' && !ENV['CI']\n\nrequire 'aruba/cucumber'\n\ncucumer_helpers_file = '../...
ruby
chosen
[ { "from": "system", "value": "Add headers for Internet Explorer (particularly over HTTPS)." }, { "from": "human", "value": "module ActionView\n module TemplateHandlers\n class Prawn < TemplateHandler\n include Compilable\n\n def compile(template)\n %Q{\n controller....
ruby
chosen
[ { "from": "system", "value": "Upgrade MySQL 5.6 to 5.7\n" }, { "from": "human", "value": "namespace :host do\n\n desc 'Setup MySQL'\n task setup_mysql: [:mysql_install, :mysql_configure, :mysql_enable]\n\n\n task :mysql_configure do\n on roles(:all) do\n upload_file(\"#{config_dir}/my...
ruby
chosen
[ { "from": "system", "value": "Fix wrong local variable name\n" }, { "from": "human", "value": "# encoding: utf-8\n\nmodule Rubocop\n module Cop\n module Lint\n # This cop checks for comparison of something with itself.\n #\n # @example\n #\n # x.top >= x.top\n ...
ruby
chosen
[ { "from": "system", "value": "Remove nesting from wombat order serizalizer\n" }, { "from": "human", "value": "module Serializers\n module Wombat\n class OrderSerializer\n def self.serialize(wombat_order)\n output = {}\n wombat_order.attributes.each do |key, value|\n ...
ruby
chosen
[ { "from": "system", "value": "Make the tmp dir unless it already exists.\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe Backend::WebserverController do\n before(:each) do\n @admin = create(:admin)\n session[:admin_id] = @admin.id\n end\n\n describe 'POST restart' ...
ruby
chosen
[ { "from": "human", "value": "Add specs for tenant product feature in tree node\n" }, { "from": "gpt", "value": "describe TreeNode::MiqProductFeature do\n subject { described_class.new(object, nil, {}) }\n let(:tenant) { FactoryBot.create(:tenant) }\n\n let(:feature_type) { \"tenant\" }\n\n l...
ruby
chosen
[ { "from": "system", "value": "Allow nokogiri up to 2.x\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'mobiledoc_html_renderer/version'\n\nGem::Specification.new do |spec|\n spec.na...
ruby
chosen
[ { "from": "system", "value": "Update simplecov requirement from ~> 0.17.1 to ~> 0.18.0\n\nUpdates the requirements on [simplecov](https://github.com/colszowka/simplecov) to permit the latest version.\n- [Release notes](https://github.com/colszowka/simplecov/releases)\n- [Changelog](https://github.com/colszo...
ruby
chosen
[ { "from": "system", "value": "Fix gemnasium accept rails 4.1.1\n" }, { "from": "human", "value": "$LOAD_PATH.push File.expand_path('../lib', __FILE__)\nrequire 'active_portal/version'\n\nGem::Specification.new do |s|\n s.name = 'activeportal'\n s.version = ActivePortal::VERSION\n s...
ruby
chosen
[ { "from": "system", "value": "Fix building using native extensions\n" }, { "from": "human", "value": "$:.push File.join(File.dirname(__FILE__), 'lib')\n\nrequire 'concurrent/version'\n\nGem::Specification.new do |s|\n s.name = 'concurrent-ruby-ext'\n s.version = Concurrent::VERSION\...
ruby
chosen
[ { "from": "system", "value": "Refactor Filters::Selector to avoid duplication in subclasses\n" }, { "from": "human", "value": "module DnzHarvester\n module Filters\n class Selector\n attr_reader :record, :regexp, :scope\n\n def initialize(record, regexp, scope=:first)\n @rec...
ruby
chosen
[ { "from": "human", "value": "Add pdf generator job specs\n" }, { "from": "gpt", "value": "require \"rails_helper\"\n\nRSpec.describe ChangesHistoryPdfGeneratorJob, type: :job do\n include ActiveJob::TestHelper\n\n let(:aru){ FactoryGirl.create(:annual_report_upload) }\n subject(:job) { descri...
ruby
chosen
[ { "from": "human", "value": "Add a tool to extract the specified trace from trace log\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\n\nif ARGV.size < 1\n puts(\"Usage: #{$0} TARGET_SQL TRACE_LOG_PATH\")\n exit(false)\nend\n\ntarget_sql = ARGV.shift\nstart_pattern = /\\AT@\\d+: \\| \\| q...
ruby
chosen
[ { "from": "human", "value": "Add controller RSpec tests for AttachedFiles" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe AttachedFilesController do \n before(:each) do\n generate_default_project_and_jnlps_with_mocks\n \n @attached_file = Factory.create(:attached_file...
ruby
chosen
[ { "from": "system", "value": "Allow accepting nested attributes for seo_datum" }, { "from": "human", "value": "module Caffeine\n module Concerns\n module SeoFriendly\n extend ActiveSupport::Concern\n\n included do\n if defined?(::ActsAsSeoFriendly)\n acts_as_seo_fri...
ruby
chosen
[ { "from": "system", "value": "spec: Reset DB counter in set_up, not tear_down\n\nThis avoids a problem where, if the tear_down doesn't happen (say, if\nthe process is aborted), things wouldn't have been reset for the next\nrun. By doing it in the set_up, we can always count on IDs starting\nat 1 every time ...
ruby
chosen
[ { "from": "system", "value": "Update default avatar URL to image on CDN" }, { "from": "human", "value": "class Author < ActiveRecord::Base\n has_many :unit_templates\n\n DEFAULT_AVATAR_URL = 'http://jaredsilver.name/headshot.jpg'\n\n def avatar_url\n self.avatar.blank? ? DEFAULT_AVATAR_URL...
ruby
chosen
[ { "from": "system", "value": "Fix describe for media types to use the accessor display_name instead of the instance value, to pickup the default string.\n\nSigned-off-by: Josep M. Blanquer <843d9a062ab1c6792ebebca5589f22ce86ac85ce@rightscale.com>\n" }, { "from": "human", "value": "module Praxis\...
ruby
chosen
[ { "from": "human", "value": "Fix the label of the error message output\n" }, { "from": "gpt", "value": "require 'pathname'\n\n# This is the base class on which other providers are based.\nclass Puppet::Provider::IIS_PowerShell < Puppet::Provider # rubocop:disable all\n require Pathname.new(__FI...
ruby
chosen
[ { "from": "system", "value": "Kill mutation in Relation.build (:heart: mutant)\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'spec_helper'\n\ndescribe Relation, '.build' do\n subject { described_class.build(relation, mapper) }\n\n fake(:relation) { Axiom::Relation }\n ...
ruby
chosen
[ { "from": "system", "value": "Add better examples for ContextFactory\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'test_doubles'\n\nclass AdditionOrganizerContextFactory\n def self.make_for(action, number)\n LightService::Testing::ContextFactory\n .make_from(TestDou...
ruby
chosen
[ { "from": "system", "value": "Add NoMethodError to remove raise_error warning after RSpec 3.4 Update\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe ApplicationController do\n # if this test fails, check wether you need the rack_hotfix.rb still\n it \"should include the ra...
ruby
chosen
[ { "from": "system", "value": "Fix resume data fetcher spec\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'resume/cli/resume_data_fetcher'\n\nmodule Resume\n module CLI\n RSpec.describe ResumeDataFetcher do\n describe '.fetch' do\n let(:basename) { 'resume.en.j...
ruby
chosen
[ { "from": "system", "value": "Fix spec for uncommunicative-method-name smell.\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'reek/smells/uncommunicative_method_name'\nrequire 'reek/smells/smell_detector_shared'\nrequire 'reek/core/code_parser'\nrequire 'reek/core/sniffer'\n\n...
ruby
chosen
[ { "from": "system", "value": "Add message to OpenstackInfra event\n\nAdd message to OpenstackInfra event\n" }, { "from": "human", "value": "module EmsEvent::Parsers::OpenstackInfra\n def self.event_to_hash(event, ems_id)\n log_header = \"MIQ(#{self.name}.event_to_hash)\"\n log_header << \...
ruby
chosen
[ { "from": "system", "value": "Change tarball url for the Streaming Auditor\n\n\nFormer-commit-id: 40b2972cea5baa90efc8ad3317afb5b3995fb4a0 [formerly f675eb234f7b0f23c49a57a7ef984d456b2b0c5b] [formerly 4541bffb492d40a4fbda4116bea872f856450c18 [formerly e494ead3b9c72ef278436d27d723bd6a0c006913]]\nFormer-commi...
ruby
chosen
[ { "from": "system", "value": "Hide charts with an unsatisfied area dependency\n\nCloses #1645\n" }, { "from": "human", "value": "class OutputElementsController < ApplicationController\n layout false\n\n before_filter :find_output_element, :only => [:show, :zoom]\n\n # Returns all the data req...
ruby
chosen
[ { "from": "system", "value": "Add the `<app_root>/test` dir to the `$LOAD_PATH` as a string:\n\n- [Rails <= 5.0](https://github.com/rails/rails/blob/5-0-stable/railties/lib/rails/commands/test.rb#L6) used to add the `<app_root>/test` as a string; this behaviour changed in rails 5.1, it's appending a `Pathna...
ruby
chosen