conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Configure koppie to use Hyrax::ValkyriePersistDerivatives\n" }, { "from": "gpt", "value": "ActiveSupport::Reloader.to_prepare do\n Hydra::Derivatives.config.output_file_service = Hyrax::ValkyriePersistDerivatives\n Hydra::Derivatives.config.source_file_service = Hy...
ruby
chosen
[ { "from": "system", "value": "Fix wrong variable name in API view\n" }, { "from": "human", "value": "json.array! data do |phytosanitary_usage|\n json.call(phytosanitary_usage, :id,\n :product_id,\n :ephy_usage_phrase,\n :crop,\n :species,\n ...
ruby
chosen
[ { "from": "system", "value": "Update contact email in Gemspec\n" }, { "from": "human", "value": "# encoding: utf-8\n\nGem::Specification.new do |s|\n s.name = \"jekyll-theme-architect\"\n s.version = \"0.0.1\"\n s.authors = [\"Jason Long\"]\n s.email = [\"support...
ruby
chosen
[ { "from": "system", "value": "Test a resource collection defined via the interface\n" }, { "from": "human", "value": "require 'spec_helper'\n\nclass Convection::Model::Template\n describe ResourceCollection do\n let(:template) do\n Convection.template do\n description 'ResourceCo...
ruby
chosen
[ { "from": "system", "value": "Increase git timeout a bit.\n" }, { "from": "human", "value": "require 'childprocess'\nrequire 'shellwords'\n\nmodule Citrus\n module Core\n class GitAdapter\n TIMEOUT = 10\n\n def clone_repository(source, destination)\n run %W(git clone #{shell...
ruby
chosen
[ { "from": "system", "value": "Update string to trigger changelog check\n" }, { "from": "human", "value": "module Fastlane\n module Helper\n class ChangelogHelper\n # class methods that you define here become available in your action\n # as `Helper::ChangelogHelper.your_method`\n ...
ruby
chosen
[ { "from": "human", "value": "Add basic test for DNS class\n\nEnsure that the file is formatted correctly.\n" }, { "from": "gpt", "value": "require_relative '../../../../spec_helper'\n\ndescribe 'performanceplatform::dns', :type => :class do\n\n let (:params) {{\n 'hosts' => \"5.6.7.8 box...
ruby
chosen
[ { "from": "system", "value": "Add on method in handler\n" }, { "from": "human", "value": "require 'ruboty/Fizzbuzz/actions/fizzbuzz'\n\nmodule Ruboty\n module Handler\n class Fizzbuzz < Base\n end\n end\nend\n" }, { "from": "gpt", "value": "require 'ruboty/Fizzbuzz/actions/fi...
ruby
chosen
[ { "from": "system", "value": "Allow normalize address to fail quietly.\n" }, { "from": "human", "value": "Spree::CheckoutController.class_eval do\n helper Spree::AddressesHelper\n \n after_filter :normalize_addresses, :only => :update\n before_filter :set_addresses, :only => :update\n \n p...
ruby
chosen
[ { "from": "system", "value": "Fix performance specs and bump allocation limit on initializer\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe Mobility::Translations, orm: 'none' do\n describe \"initializing\" do\n specify {\n expect { described_class.new(backend: :...
ruby
chosen
[ { "from": "system", "value": "Fix API data hooks spec\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Travis::Api::V2::Http::Hooks do\n include Travis::Testing::Stubs\n\n let(:data) { Travis::Api::V2::Http::Hooks.new([repository]).data }\n\n it 'hooks' do\n data['hooks...
ruby
chosen
[ { "from": "system", "value": "Remove duplicate user authentication helper\n\nWe can use the one specified and mixed-in from the helper file.\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.feature 'Resource manager manages groups' do\n scenario 'Viewing existing groups' do\n ...
ruby
chosen
[ { "from": "system", "value": "Add more specs for mock controller." }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe Duckrails::MocksController, type: :controller do\n\nend\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\nmodule Duckrails\n RSpec.des...
ruby
chosen
[ { "from": "system", "value": "Move content hint icon to after the name\n\nThis way it does not conflict with warnings\nthat might be displayed as well and it aligns\nnicely with the essence boolean\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Alchemy\n module Admin...
ruby
chosen
[ { "from": "system", "value": "Fix the title on the index page\n" }, { "from": "human", "value": "module Prosperity\n module ApplicationHelper\n def app_name\n \"Prosperity\" \n end\n\n def link_to_metric(metric)\n link_to metric.to_s.underscore.humanize, metric_path(id: metri...
ruby
chosen
[ { "from": "system", "value": "Correct date range for role appointments\n\nAccording to the style guide\n(https://www.gov.uk/designprinciples/styleguide#dates-and-times), date\nranges should use 'to' and not an en-dash.\n" }, { "from": "human", "value": "class RoleAppointmentPresenter < Draper::B...
ruby
chosen
[ { "from": "system", "value": "Use new apache conf fragment support for SSL config\n" }, { "from": "human", "value": "#\n# Cookbook Name:: apache\n# Recipe:: ssl\n#\n# Copyright 2011, OpenStreetMap Foundation\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not u...
ruby
chosen
[ { "from": "system", "value": "Check if project manager role for corresponding project already exists\n" }, { "from": "human", "value": "class ProjectMember < ActiveRecord::Base \n belongs_to :user\n belongs_to :project\n belongs_to :project_role\n\n validate :only_one_manager_per_project\n\...
ruby
chosen
[ { "from": "human", "value": "Complete NameWith... subclasses\nAdd NameWithObservationsInSpeciesList\n" }, { "from": "gpt", "value": "class Query::NameWithObservationsInSpeciesList < Query::Name\n def parameter_declarations\n super.merge(\n species_list: SpeciesList,\n has_specimen?...
ruby
chosen
[ { "from": "human", "value": "Implement spec for locale accessors\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\nclass AccessorTest\n include RailsLocaleDetection::LocaleAccessors\nend\n\ndescribe RailsLocaleDetection::LocaleAccessors do\n subject :object do\n AccessorTest.new\n ...
ruby
chosen
[ { "from": "system", "value": "Fix method override to include block\n\nCompatibility with upcoming navigation changes.\n" }, { "from": "human", "value": "Spree::Admin::NavigationHelper.module_eval do\n def tab_with_legacy_return_authorizations(*args)\n if args.first == :orders\n options ...
ruby
chosen
[ { "from": "system", "value": "Exclude system's message from Most Liked Post report\n" }, { "from": "human", "value": "module AdminStatisticsDigest\nend\n\nrequire_relative '../admin_statistics_digest/base_report'\n\nclass AdminStatisticsDigest::MostLikedPost < AdminStatisticsDigest::BaseReport\n...
ruby
chosen
[ { "from": "system", "value": "Index count starting at 1\n" }, { "from": "human", "value": "module ShowOff\n module Parsers\n\n class MarkdownSlideSplitter\n\n #\n # Splits the markdown content into separate slide files based on the\n # separator defined by this class.\n #...
ruby
chosen
[ { "from": "system", "value": "Include tag helper for rails 2.x\n" }, { "from": "human", "value": "require 'sprockets'\n\nmodule Sprockets\n module Rails\n # Backports of AssetTagHelper methods for Rails 2.x and 3.x.\n module LegacyAssetTagHelper\n def javascript_include_tag(*sources)...
ruby
chosen
[ { "from": "human", "value": "Add relation between assistant_registered_to_given_courses and lab_has_groups\n" }, { "from": "gpt", "value": "class AssistantHasLabHasGroup < ActiveRecord::Migration\n def up\n create_table :assistant_registered_to_given_courses_lab_has_groups, id: false do |t|\...
ruby
chosen
[ { "from": "human", "value": "Add spec for checking warnings.\n\nCredits go to:\nhttps://github.com/psyho/bogus/blob/459c02ce069ee8e246f2e7869964e29d0b061236/spec/bogus/clean_ruby_spec.rb\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe 'Ruby syntax' do\n\n it 'is clean' do\n ...
ruby
chosen
[ { "from": "system", "value": "Use template path in users/index view spec\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe \"/users\" do\n fixtures :users, :events\n\n it \"should not include admin column by default\" do\n assigns[:users] = [users(:aaron), users(:quentin)...
ruby
chosen
[ { "from": "system", "value": "Use poltergeist as the driver for Capybara\n" }, { "from": "human", "value": "require 'coveralls'\nCoveralls.wear_merged!('rails')\n\nrequire 'pry'\n\n# Require and include helper modules\n# in feature/support/helpers and its subdirectories.\nDir[Rails.root.join(\"f...
ruby
chosen
[ { "from": "system", "value": "Add MiqRequest factory with MiqApproval\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :miq_request do\n requester { create(:user) }\n\n factory :miq_host_provision_request, :class => \"MiqHostProvisionRequest\"\n factory :servi...
ruby
chosen
[ { "from": "system", "value": "Add sleep before clicking confirm button\n" }, { "from": "human", "value": "module PayPal\n def open_popup\n return window_opened_by do\n find(\".braintree-sheet__button--paypal\").click\n end\n end\n\n def open_popup_and_complete_login(&block)\n pa...
ruby
chosen
[ { "from": "system", "value": "Add details to search by days interval\n" }, { "from": "human", "value": "require_relative '../../boot'\n\n# Search Subscriptions by days interval\n# PS: Since it has receipt some notification in the interval\n#\n# You need to give AccountCredentials (EMAIL, TOKEN) ...
ruby
chosen
[ { "from": "system", "value": "Fix generators missing from gem" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"wicked_pdf\"\n s.version = \"0.8.0\"\n s.date = Time.now.strftime('%Y-%m-%d')\n s.summary = \"PDF generator ...
ruby
chosen
[ { "from": "system", "value": "Add inline_svg as a Spree dependency\n" }, { "from": "human", "value": "# encoding: UTF-8\nrequire_relative '../core/lib/spree/core/version.rb'\n\nGem::Specification.new do |s|\n s.platform = Gem::Platform::RUBY\n s.name = 'spree_frontend'\n s.version ...
ruby
chosen
[ { "from": "system", "value": "Update pod version for done button bug fix\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"OOPhotoBrowser\"\n s.summary = \"Photo Browser / Viewer inspired by Facebook's and Tweetbot's with ARC support, swipe-to-dismiss, image...
ruby
chosen
[ { "from": "system", "value": "Update specs to reflect notices.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Archivable::Controller do\n\n let(:controller) { FakesController.new }\n\n subject { controller }\n\n it { should respond_to(:archive) }\n\n describe '.archive'...
ruby
chosen
[ { "from": "system", "value": "Use a local variable Regexp\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'String#gsub' do\n it 'handles recursive gsub' do\n PassSlotRx = /{(\\d+)}/\n def recurse_gsub text\n text.gsub(PassSlotRx) {\n index = $1.to_i\n ...
ruby
chosen
[ { "from": "system", "value": "Fix wrong reference to Errors::NFSNoHostonlyNetwork introduced in 022c1da [GH-1437].\n" }, { "from": "human", "value": "module VagrantPlugins\n module ProviderVirtualBox\n module Action\n class PrepareNFSSettings\n def initialize(app,env)\n ...
ruby
chosen
[ { "from": "system", "value": "Add the third parameter to recPosts and textSearch in the mock backend\n" }, { "from": "human", "value": "require 'ostruct'\n\nmodule Backend\n module RecommenderMock\n class Client\n def initialize(protocol)\n @user_terms = Hash.new([])\n end\n...
ruby
chosen
[ { "from": "system", "value": "Update rubocop requirement to ~> 0.52.0\n\nUpdates the requirements on [rubocop](https://github.com/bbatsov/rubocop) to permit the latest version.\n- [Release notes](https://github.com/bbatsov/rubocop/releases)\n- [Changelog](https://github.com/bbatsov/rubocop/blob/master/CHANG...
ruby
chosen
[ { "from": "system", "value": "Fix calls to Stock::Quantifier in AvailabilityValidator\n- Spree 2.2.2+ Stock::Quantifier expects to be initialized with a variant and\n not a variant id\n" }, { "from": "human", "value": "module Spree\n module Stock\n # Overridden from spree core to make it al...
ruby
chosen
[ { "from": "system", "value": "Add pdf used for reference.\n" }, { "from": "human", "value": "module PanicBoardData\n\n GRAPH_TYPES = [:bar, :line]\n COLORS = [:yellow, :green, :red, :purple, :blue, :mediumGray, :pink, :aqua, :orange, :light_gray]\n\n class Graph\n\n attr_accessor :title, :...
ruby
chosen
[ { "from": "system", "value": "Use constants instead magic numbers\n" }, { "from": "human", "value": "module RelativeTime\n class InWords\n def call(time_to)\n diff = Time.now - time_to\n return 'less than a minute' if diff.abs.round <= 59\n\n date_string = verb_agreement(resol...
ruby
chosen
[ { "from": "system", "value": "Make sure asset routes are absolute, so we can load them when it's a gem\n" }, { "from": "human", "value": "module Rubots\n module Graphics\n class Assets\n PEW_SOUND = \"media/pew.wav\"\n ROBOT_IMG = \"media/robot.png\"\n GUN_IMG = \"media/gun....
ruby
chosen
[ { "from": "system", "value": "Fix the factory so it doesnt break other tests\n" }, { "from": "human", "value": "FactoryBot.define do\n factory :alert do\n school\n alert_type\n run_on { Date.today }\n rating { 5.0 }\n priority_data {\n {'time_of_year_relevance' => 5.0}\n ...
ruby
chosen
[ { "from": "system", "value": "Add no robots header AAIB Report urls\n\nBefore we do anything stop crawlers hitting aaib-reports urls, or anything else in our exclusion list for that matter!\n" }, { "from": "human", "value": "class FindersController < ApplicationController\n def show\n end\n\np...
ruby
chosen
[ { "from": "system", "value": "Add prelim code to Repairs controller\n" }, { "from": "human", "value": "class RepairsController < ApplicationController\n def new\n end\n\n def show\n end\nend\n" }, { "from": "gpt", "value": "class RepairsController < ApplicationController\n befor...
ruby
chosen
[ { "from": "system", "value": "Set more reasonable daily and weekly boundaries\n" }, { "from": "human", "value": "module TarsnapPruner\n\n class Scheduler\n\n def initialize(archives, daily_boundary=182, weekly_boundary=730)\n @archives = archives.sort_by(&:date)\n @daily_boundary =...
ruby
chosen
[ { "from": "system", "value": "Unpublish business readiness document finder\n" }, { "from": "human", "value": "require \"publishing_api_finder_publisher\"\nrequire \"publishing_api_topic_finder_publisher\"\n\nnamespace :publishing_api do\n desc \"Publish document finder.\"\n task :publish_docum...
ruby
chosen
[ { "from": "system", "value": "Fix image output file name.\n" }, { "from": "human", "value": "require 'cookbook_sdk/rake_tasks'\nrequire 'json'\n\nnamespace :jenkins do\n desc 'Generate attribute json file for image creation'\n task :pipeline_version do\n attributes_file = File.join('provisi...
ruby
chosen
[ { "from": "system", "value": "Comment is joined by ;\n" }, { "from": "human", "value": "class UserAgent\n module Browsers\n class InternetExplorer < Base\n def self.extend?(agent)\n agent.application &&\n agent.application.comment &&\n (agent.application.comment[1] ...
ruby
chosen
[ { "from": "system", "value": "Add documentation or error classes.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\nmodule WebsocketSequentialClient\n class Error < StandardError\n end\n\n class SocketAlreadyClosed < Error\n end\n\n class HandshakeFailed < Error\n end\n\n clas...
ruby
chosen
[ { "from": "human", "value": "Add a spec for explicit relationship joining\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe 'Relationship - One To One - Explicit Loading' do\n before(:all) do\n setup_db\n\n insert_user 1, 'John', 18\n insert_user 2, 'Jane', 21\n i...
ruby
chosen
[ { "from": "system", "value": "Fix typo in Operations test class\n" }, { "from": "human", "value": "require \"helpers/integration_test_helper\"\n\nclass TestRoutes < FogIntegrationTest\n def setup\n @subject = Fog::Compute[:google].operations\n end\n\n def test_all\n # TODO: what if this...
ruby
chosen
[ { "from": "system", "value": "Use \"change\" format for migration\n" }, { "from": "human", "value": "require 'skr/core/db/migration_helpers'\n\nclass CreateSkrSalesOrders < ActiveRecord::Migration\n def up\n\n create_skr_table \"sales_orders\" do |t|\n t.skr_visible_id\n ...
ruby
chosen
[ { "from": "human", "value": "Add migration: Create track_identities table\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nclass CreateTrackIdentities < ActiveRecord::Migration[5.1]\n def change\n create_table :track_identities, id: :uuid, default: \"uuid_generate_v4()\" do ...
ruby
chosen
[ { "from": "human", "value": "Set existing new_discussion event sequence ids to nil\n" }, { "from": "gpt", "value": "class FixNewDiscussionSequences < ActiveRecord::Migration\n def up\n Event.where('kind = ? AND sequence_id IS NOT NULL', :new_discussion).update_all(sequence_id: nil)\n end\ne...
ruby
chosen
[ { "from": "human", "value": "Add http start state tests.\n" }, { "from": "gpt", "value": "# encoding: UTF-8\n\nrequire 'vines'\nrequire 'minitest/autorun'\n\nclass HttpStartTest < MiniTest::Unit::TestCase\n def setup\n @stream = MiniTest::Mock.new\n @state = Vines::Stream::Http::Start.new...
ruby
chosen
[ { "from": "human", "value": "Add URLs to archive model\n" }, { "from": "gpt", "value": "class AddUrlsToArchive < ActiveRecord::Migration\n def change\n add_column :archives, :dcmUrl, :string\n add_column :archives, :cbpUrl, :string\n add_column :archives, :gcdUrl, :string\n add_colu...
ruby
chosen
[ { "from": "system", "value": "Add wait for what we're actually waiting for\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire_relative 'admin_page.rb'\n\nclass ItemTypes < AdminPage\n def visit\n @browser.goto intranet(:item_types)\n self\n end\n\n def show_all\n @browse...
ruby
chosen
[ { "from": "human", "value": "Add first draft of 6.5 pp\n" }, { "from": "gpt", "value": "# RELEASE 2: NESTED STRUCTURE GOLF\n\n# I worked on this assignment with Walter Kerr\n\n# RELEASE 2: NESTED STRUCTURE GOLF\n# Hole 1\n# Target element: \"FORE\"\n\narray = [[1,2], [\"inner\", [\"eagle\", \"pa...
ruby
chosen
[ { "from": "human", "value": "Add nested data file for 6.5\n" }, { "from": "gpt", "value": "# RELEASE 2: NESTED STRUCTURE GOLF\n# Hole 1\n# Target element: \"FORE\"\n\narray = [[1,2], [\"inner\", [\"eagle\", \"par\", [\"FORE\", \"hook\"]]]]\n\n# attempts:\n# p array[1][1][3][0]\np array[1][1][2][...
ruby
chosen
[ { "from": "system", "value": "Revert \"chore(script/sql): make systems table use bigint ID\"\n\nThis reverts commit 4735c01931c83dfb48142319c669f99b1da8ae3f.\n" }, { "from": "human", "value": "Sequel.migration do\n up do\n execute(\"ALTER TABLE values ALTER COLUMN timestamp TYPE bigint...
ruby
chosen
[ { "from": "human", "value": "Fix the column type for amount.\n\nChange-Id: I68dd23ae22c1cbb6aa51314ad632466178d1b96d\n" }, { "from": "gpt", "value": "class FixDecimalTypeForPreorderPrices < ActiveRecord::Migration\n def up\n change_column :spree_preorder_prices, :amount, :decimal, :precision...
ruby
chosen
[ { "from": "system", "value": "Refactor overrides to use prepend.\n\nThe alias_method_chain doesn't mix will with the `decorator` pattern\nfound in Spree apps. `prepend` is re-entrant (when using a named module)\nand relies on inheritance instead of method renaming resulting in a\ncleaner way to do this type...
ruby
chosen
[ { "from": "system", "value": "Update user relation in place factory.\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :place do\n name \"Test Place\"\n address \"Alexanderplatz 1\"\n city \"Berlin\"\n latitude 52.500556\n longitude 13.398889\n is_established ...
ruby
chosen
[ { "from": "human", "value": "Add results importer for TSV files\n" }, { "from": "gpt", "value": "require_relative '../models'\nrequire 'pp'\n# $ ruby scripts/import-results-tsv.rb [ELECTION ID] [TSV FILENAME]\n\n# Import a TSV file of election results for a specified election\n# The election for...
ruby
chosen
[ { "from": "human", "value": "Update variable_id primary and foreign keys to bigint\n" }, { "from": "gpt", "value": "class ChangeVariableIdToBigint < ActiveRecord::Migration[6.0]\n def up\n change_column :variables, :id, :bigint\n\n change_column :variable_forms, :variable_id, :bigint\n ...
ruby
chosen
[ { "from": "system", "value": "Delete card from store credit payments.\n" }, { "from": "human", "value": "module SpreeStoreCredits::AdminPaymentsControllerDecorator\n def self.prepended(base)\n base.before_action :load_user_store_credits, only: :new\n base.before_action :handle_store_credi...
ruby
chosen
[ { "from": "system", "value": "Revert \"Return webp if browser supports it\"\n\nThis reverts commit 0db9ec7fadc8c51cd74fb3c0731c18f4a4abc27b.\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": "system", "value": "Update UpdateAlleleRegistryIds jobs to only run weekly and only update clinvar IDs for variants that already have one and where the ID changed\n" }, { "from": "human", "value": "require 'rbconfig'\n\nclass UpdateAlleleRegistryIds < ActiveJob::Base\n def perform(rec...
ruby
chosen
[ { "from": "system", "value": "Use delegate to access subscription shop\n" }, { "from": "human", "value": "class SubscriptionEstimator\n def initialize(subscription)\n @subscription = subscription\n end\n\n def estimate!\n assign_price_estimates\n end\n\n private\n\n attr_accessor :su...
ruby
chosen
[ { "from": "system", "value": "Add another one connection for pubsub\n" }, { "from": "human", "value": "require 'redis'\n\nclass RedisUserConnector\n def self.connect(hash)\n @connect = hash\n end\n\n def self.get(key)\n connection.hgetall(\"#{namespace}:#{key}\")\n end\n\n def self.se...
ruby
chosen
[ { "from": "system", "value": "Fix filtering bug in TripleCrownWinner calc\n" }, { "from": "human", "value": "module BaseballStats\n module Calculators\n class TripleCrownWinner\n include Calculators\n\n def calculate\n al_winner = find_winner(AMERICAN_LEAGUE)\n nl_win...
ruby
chosen
[ { "from": "system", "value": "Refactor the URL relativizer to work with the new templates" }, { "from": "human", "value": "require File.dirname(__FILE__) + '../../../resolver'\n\nmodule HtmlMockup::Release::Processors\n class UrlRelativizer < Base\n \n def initialize(options={})\n @o...
ruby
chosen
[ { "from": "system", "value": "Update rspec requirement from ~> 3.8.0 to ~> 3.9.0\n\nUpdates the requirements on [rspec](https://github.com/rspec/rspec) to permit the latest version.\n- [Release notes](https://github.com/rspec/rspec/releases)\n- [Commits](https://github.com/rspec/rspec/compare/v3.8.0...v3.9....
ruby
chosen
[ { "from": "system", "value": "Use has_role? not admin? to check for user admin ability in ProductsControllerDecorator\n\nFixes #1562\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Spree::ProductsController do\n let!(:product) { create(:product, :available_on => 1.year.from...
ruby
chosen
[ { "from": "human", "value": "Add Ruleset class and APIs\n" }, { "from": "gpt", "value": "require \"Storm/Base/model\"\nrequire \"Storm/Base/sodserver\"\nrequire \"Storm/Server/server\"\n\nmodule Storm\n module Network\n module Firewall\n class Ruleset < Storm::Base::Model\n attr_...
ruby
chosen
[ { "from": "system", "value": "Use FOCUSED_FILE_PATH constant instead of explicit file name\n" }, { "from": "human", "value": "require 'guard/rspec'\nrequire 'rspec/core/formatters/base_formatter'\n\nmodule Guard::RSpec::Formatters\n class Focuser < ::RSpec::Core::Formatters::BaseFormatter\n\n ...
ruby
chosen
[ { "from": "system", "value": "Use stdin instead of tempfile\n" }, { "from": "human", "value": "require \"open3\"\nrequire \"tempfile\"\nrequire \"shellwords\"\n\nmodule LanguageServer\n module Linter\n class Error\n attr_reader :line_num, :message, :type\n\n def initialize(line_num...
ruby
chosen
[ { "from": "system", "value": "Add missing update action to discount item\n" }, { "from": "human", "value": "module NetSuite\n module Records\n class DiscountItem\n include Support::Fields\n include Support::RecordRefs\n include Support::Records\n include Support::Actions\...
ruby
chosen
[ { "from": "system", "value": "Fix SerializationError in Regenerate Derivatives job\n\nCreateDerivativesJob expects a FileID of type String instead of a Hydra::PCDM::File object. \r\nsee https://github.com/samvera/hyrax/blob/main/app/jobs/create_derivatives_job.rb#L6\r\n\r\nRunning the task as-is gives me t...
ruby
chosen
[ { "from": "system", "value": "Add a task to import weights\n" }, { "from": "human", "value": "namespace :usda do\n desc 'Import the latest USDA nutrition data'\n task import: :environment do\n UsdaNutrientDatabase::Importer.new('tmp/usda', 'sr25').import\n end\nend" }, { "from": "g...
ruby
chosen
[ { "from": "system", "value": "Add documents for \"TrySailBlogNotification::HTTP\" class\n" }, { "from": "human", "value": "require 'net/http'\nrequire 'net/https'\nrequire 'uri'\n\nmodule TrySailBlogNotification\n class HTTP\n\n def initialize(url)\n @url = url\n @uri = URI.parse(U...
ruby
chosen
[ { "from": "human", "value": "Add custom OID type to active record for participants.\n" }, { "from": "gpt", "value": "ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.class_eval do\n def initialize_type_map_with_postgres_oids mapping\n initialize_type_map_without_postgres_oids mapping\n ...
ruby
chosen
[ { "from": "system", "value": "Update error messages in config validation to point to the correct filepath for config/cassandra.yml\n" }, { "from": "human", "value": "# encoding: utf-8\nrequire 'cassandra'\n\nmodule CassandraMigrations\n module Cassandra\n module KeyspaceOperations\n\n d...
ruby
chosen
[ { "from": "system", "value": "[TTPLAT-1044] Fix data migrations for role labels.\n" }, { "from": "human", "value": "class UpdateCoreRoleLabels < ActiveRecord::DataMigration\n def up\n Role.where(name: [:user, :manager]).update_all(label: 'Staff')\n Role.find_or_create_by(name: :super_mana...
ruby
chosen
[ { "from": "human", "value": "Add disabled_at and provider_data into mail_marketing_lists\n" }, { "from": "gpt", "value": "class AdjustsOnMailMarketingLists < ActiveRecord::Migration\n def change\n add_column :mail_marketing_lists, :disabled_at, :datetime\n add_column :mail_marketing_lists...
ruby
chosen
[ { "from": "system", "value": "Make sure the user exists\n" }, { "from": "human", "value": "class RevertDetailedGuidesToDraft < ActiveRecord::Migration\n def up\n user = User.find_by_name(\"Automatic Data Importer\")\n PaperTrail.enabled = false\n data.each do |row|\n guide = Docum...
ruby
chosen
[ { "from": "human", "value": "Add spec coverage on CommandLineRunner\n" }, { "from": "gpt", "value": "require \"spec_helper\"\nrequire \"cc/engine/duplication\"\n\nmodule CC::Engine::Analyzers\n RSpec.describe CommandLineRunner do\n describe \"#run\" do\n it \"runs the command on the inp...
ruby
chosen
[ { "from": "human", "value": "Add stub rspec test to phantomjs module\n" }, { "from": "gpt", "value": "require_relative '../../../../spec_helper'\n\ndescribe 'phantomjs', :type => :class do\n\n it { is_expected.to compile }\n\n it { is_expected.to compile.with_all_deps }\n\n it { is_expected.t...
ruby
chosen
[ { "from": "human", "value": "Add unit test for group normalization in ChefFS\n" }, { "from": "gpt", "value": "#\n# Author:: Ryan Cragun (<ryan@getchef.com>)\n# Copyright:: Copyright (c) 2014 Opscode, Inc.\n# License:: Apache License, Version 2.0\n#\n# Licensed under the Apache License, Version 2...
ruby
chosen
[ { "from": "system", "value": "Update subdomain helper for controller\n" }, { "from": "human", "value": "require \"rack/mock\"\nrequire \"houser/middleware\"\n\nmodule LockerRoom\n module Testing\n module Controller\nmodule SubdomainHelpers\n def within_subdomain(subdomain)\n subdomain_ho...
ruby
chosen
[ { "from": "system", "value": "Fix \"missing trait :with_order\" in NU\n\nNU overrides the `nufs_account` factory, and it doesn’t actually\noverride the individual attributes and traits it actually replaces it.\n" }, { "from": "human", "value": "overridable_factory :nufs_account do\n sequence(:a...
ruby
chosen
[ { "from": "system", "value": "Move legal name validation to TransitAgency and update spatial factory.\n" }, { "from": "human", "value": "FactoryBot.define do\n\n factory :organization do\n customer_id { 1 }\n address1 { '100 Main St' }\n city { 'Harrisburg' }\n state { 'PA' }\n z...
ruby
chosen
[ { "from": "system", "value": "Update cms_admin spec work after Spree 1.3 upgrade broke it\n" }, { "from": "human", "value": "require 'spec_helper'\n\nfeature %q{\n In order to provide content to users of the site\n As an administrator\n I want to access the CMS admin site\n} do\n inclu...
ruby
chosen
[ { "from": "system", "value": "Fix insane tests using relative paths\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'rspec'\nrequire 'provision'\nrequire 'provision/vm/virsh'\nrequire 'provision/core/machine_spec'\n\ndescribe Provision::VM::Virsh do\n before do\n end\n\n it 'cr...
ruby
chosen
[ { "from": "human", "value": "Create helper methods for feature specs\n" }, { "from": "gpt", "value": "def log_in_user(user)\n visit root_path\n fill_in 'user_email', with: @user.email\n fill_in 'user_password', with: @user.password\n click_button('Sign In')\nend" } ]
ruby
chosen
[ { "from": "human", "value": "Add day 03: Delivery Grid\n" }, { "from": "gpt", "value": "require 'set'\n\n# Unknown grid size\n# we'll assume they won't exceed approx 1<<29 in each direction.\n# Two coordinates; (1<<60).object_id indicates it is still Fixnum, not Bignum.\nCOORD = 30\nY = 1 << 30\...
ruby
chosen
[ { "from": "system", "value": "Add clazz function to rabbitmq\n" }, { "from": "human", "value": "require 'stackbuilder/stacks/namespace'\n\nmodule Stacks::Services::VirtualRabbitMQService\n def self.extended(object)\n object.configure\n end\n\n attr_reader :proxy_vhosts\n attr_reader :prox...
ruby
chosen
[ { "from": "system", "value": "Configure data_bag key on integration tests\n" }, { "from": "human", "value": "require 'chef/encrypted_data_bag_item'\n\nmodule EncryptedDataBag\n def setup\n super\n FileUtils.cp $base_dir.join('support', 'data_bag_key'), 'data_bag_key'\n FileUtils.cp_r $...
ruby
chosen