conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add test that checks that the only two options in the item form department select are the one that has manage_items as true and the empty option present (:options is an exact match)\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe Item do\...
ruby
chosen
[ { "from": "system", "value": "Update the version test to just check format\n\nIt's good to have a test to make sure VERSION is set, but asserting that\nit is equal to a specific version just means we have to change the\nversion in two places. This updates the test to just check that it's a\nX.Y.Z version.\...
ruby
chosen
[ { "from": "system", "value": "Fix error handling for EOFError\n" }, { "from": "human", "value": "# coding: utf-8\n\nrequire \"twitter\"\n\nmodule TwitterBot\n class Account\n attr_reader :rest, :user\n\n def initialize(token)\n @rest = Twitter::REST::Client.new(token)\n @stream ...
ruby
chosen
[ { "from": "system", "value": "Add throttle policy to Telemetry channel\n" }, { "from": "human", "value": "# A singleton that runs on a separate process than the web server.\n# Listens to *ALL* incoming logs and stores them to the DB.\n# Also handles throttling.\nclass TelemetryService < Abstract...
ruby
chosen
[ { "from": "system", "value": "Add dependent => nullify to display_fomat\n" }, { "from": "human", "value": "class DisplayFormat < ActiveRecord::Base\n attr_accessible :name\n has_many :categorical_traits\n has_many :continuous_traits\n def format_value(value)\n case name\n when 'integ...
ruby
chosen
[ { "from": "system", "value": "Fix of hash that does not retain expression value in production mode." }, { "from": "human", "value": "module ActiveRecord::Olap\n \n class Category\n \n attr_reader :dimension, :label, :conditions, :info \n \n # initializes a category, given the dime...
ruby
chosen
[ { "from": "system", "value": "Check method definitions for Tag\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe LastFM::Tag do\n it \"should define unrestricted methods\" do\n LastFM::Tag.unrestricted_methods.should == [:get_similar, :get_top_albums, :get_top_artists, :...
ruby
chosen
[ { "from": "system", "value": "Refactor JoystickAxisMoved specs a bit.\n" }, { "from": "human", "value": "\n# Prefer local library over installed version.\n$:.unshift( File.join( File.dirname(__FILE__), \"..\", \"lib\" ) )\n$:.unshift( File.join( File.dirname(__FILE__), \"..\", \"ext\", \"rubygam...
ruby
chosen
[ { "from": "system", "value": "Improve test coverage for Location model\n" }, { "from": "human", "value": "require \"rails_helper\"\n\nRSpec.describe Location do\n describe \"validations\" do\n context \"#base_path\" do\n it \"should be an absolute path\" do\n subject.base_path = ...
ruby
chosen
[ { "from": "human", "value": "Add regression test about intersect(minus)\n" }, { "from": "gpt", "value": "require 'test_helpers'\ndescribe Alf do\n\n it 'should meet union/intersect priorities' do\n db.connect do |conn|\n rel = conn.query{\n r1 = union(\n restrict(su...
ruby
chosen
[ { "from": "system", "value": "Revert \"Replace XML version of SOAP response from 1.0 to 1.1\"\n\nThis reverts commit 506d87c076293fae1ae85d2545fc7c7e84f52a5f.\n" }, { "from": "human", "value": "=begin\n This file is part of Viewpoint; the Ruby library for Microsoft Exchange Web Services.\n\n C...
ruby
chosen
[ { "from": "system", "value": "Add support for muting notifications in MuteService\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass MuteService < BaseService\n def call(account, target_account)\n return if account.id == target_account.id\n FeedManager.instance.clea...
ruby
chosen
[ { "from": "system", "value": "Fix Dynamic Routes after recent name change\n\nVersion class is called VersionInfo now\n" }, { "from": "human", "value": "module LLT\n module Core::Api::VersionRoutes\n def add_version_route_for(route, params)\n dependencies = params[:dependencies]\n\n ...
ruby
chosen
[ { "from": "system", "value": "Revert \"Devise provider- don't store sign_in details\"\n\nThis reverts commit e6147fb8e51e4293a5b00aa6862aec4ca711b7ec.\n" }, { "from": "human", "value": "module SwitchUser\n module Provider\n class Devise < Base\n def initialize(controller)\n @cont...
ruby
chosen
[ { "from": "human", "value": "Add rake task for creating missing MR refs\n\nRun it like this:\n bundle exec rake fix_missing_mr_refs PROJECT_SLUG=foo REPO_NAME=bar MR_NUMBER=123\n" }, { "from": "gpt", "value": "#--\n# Copyright (C) 2014 Gitorious AS\n#\n# This program is free software: you...
ruby
chosen
[ { "from": "human", "value": "Add hash join and split transforms\n" }, { "from": "gpt", "value": "module Transproc\n SEPARATOR = ' '.freeze\n \n # Join keys together using a default separator token (single space)\n register(:join_keys) do |hash, mapping|\n Transproc(:join_keys!, mapping)[Ha...
ruby
chosen
[ { "from": "system", "value": "Revert \"remove concept results from student profile until we can make a less expensive query\"\n\nThis reverts commit 36d11739c8e24c9c7f0e3335e3a2bc7ff8ecb132.\n" }, { "from": "human", "value": "require \"rails_helper\"\n\ndescribe ConceptHelper, type: :helper do\n...
ruby
chosen
[ { "from": "system", "value": "Fix spec that depends on environment variable\n" }, { "from": "human", "value": "require \"rails_helper\"\n\nRSpec.describe ContactMailer, type: :mailer do\n describe \"#send_contact_message\" do\n let(:email) { ContactMailer.send_contact_message(\"John Doe\", \...
ruby
chosen
[ { "from": "system", "value": "Change basic spec for broggle model\n" }, { "from": "human", "value": "describe Broggle do\n let(:broggle) { build(:broggle) }\n\n it 'points to master' do\n expect(broggle.repo.head.name).to eq('refs/heads/master')\n end\nend\n" }, { "from": "gpt", ...
ruby
chosen
[ { "from": "system", "value": "Add some basic move tests\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe TicTacToe::AI::Minimax do\n it 'wins when it has two in a row' do\n board = TicTacToe::Board.from([\" \", \" \", \" \",\n \" \", \" \...
ruby
chosen
[ { "from": "human", "value": "Add a state_machine patch for rails 4.1.\n" }, { "from": "gpt", "value": "# This is a patch to address the issue in https://github.com/pluginaweek/state_machine/issues/251\n# where gem 'state_machine' was not working for Rails 4.1\nmodule StateMachine\n module Integ...
ruby
chosen
[ { "from": "system", "value": "Use official SPDX ID for license\n\nhttps://spdx.org/licenses/" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path(\"../lib\", __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire \"vault/version\"\n\nGem::Specification.ne...
ruby
chosen
[ { "from": "system", "value": "Remove useless new action definition inside UserSessionsController\n" }, { "from": "human", "value": "class Spree::UserSessionsController < Devise::SessionsController\n include SslRequirement\n helper 'spree/users', 'spree/base', 'spree/store'\n if defined?(Spree...
ruby
chosen
[ { "from": "system", "value": "Fix argument passing on subscribe\n" }, { "from": "human", "value": "require 'concord/version'\nrequire 'concord/configuration'\nrequire 'concord/publisher'\nrequire 'concord/subscriber'\n\nmodule Concord\n def self.config(&block)\n @config ||= Configuration.new...
ruby
chosen
[ { "from": "system", "value": "Fix irb hook for ruby-2.6+\n\nFixes #158\n\nAlso make sure, that future changes on irb.cmd will raise a build failure.\n" }, { "from": "human", "value": "self.import_files.merge!({\n \"resources/files/irbrc_predefiner.rb\" => \"lib/ruby/site_ruby/#{package.rubyver2...
ruby
chosen
[ { "from": "system", "value": "Fix path to parser for gem\n" }, { "from": "human", "value": "# encoding: UTF-8\n\nrequire 'v8'\nrequire 'commonjs'\n\nrequire './lib/esprima/parser'\n\nmodule Esprima\n def self.load_path\n @load_path ||= File.expand_path(File.join(File.dirname(__FILE__), \"../...
ruby
chosen
[ { "from": "system", "value": "Allow the taxonomy attributes to be overridden in host app\n" }, { "from": "human", "value": "module Sprangular\n class TaxonomySerializer < BaseSerializer\n attributes :id, :name\n\n has_one :root, embed: :objects,\n serializer: Sprangular:...
ruby
chosen
[ { "from": "system", "value": "Fix homepage to use SSL in Electrum-LTC Cask\n\nThe HTTP URL is already getting redirected to HTTPS. Using the HTTPS URL directly\nmakes it more secure and saves a HTTP round-trip.\n" }, { "from": "human", "value": "cask :v1 => 'electrum-ltc' do\n version '1.9.8.6'...
ruby
chosen
[ { "from": "system", "value": "Use rails_12factor in development instead of setting Rails.logger.\n" }, { "from": "human", "value": "if Rails.env.development?\n Rails.logger = Logger.new(STDOUT) # Get logs to spit out when using foreman/puma.\n Rails.application.config.assets.debug = false\n #...
ruby
chosen
[ { "from": "system", "value": "Install package via run context resource collection\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\nrequire 'chef/run_context'\nrequire 'chef/client'\nrequire 'chef/recipe'\nrequire 'chef/resource'\nrequire 'chef/providers'\n\n$client = nil\n\ndef rebuild_no...
ruby
chosen
[ { "from": "system", "value": "Use update_attributes inside \"should undefeault the previous default tax category\" spec ,as we *do* care about callbacks in this instance\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Spree::TaxCategory do\n context '#mark_deleted!' do\n ...
ruby
chosen
[ { "from": "system", "value": "Fix the benchmark of Mustache without caching\n" }, { "from": "human", "value": "require 'erb'\n\n$LOAD_PATH.unshift File.dirname(__FILE__)\nrequire 'helper'\n\n$LOAD_PATH.unshift File.dirname(__FILE__) + '/../examples'\nrequire 'complex_view'\n\n## erb\ntemplate = ...
ruby
chosen
[ { "from": "system", "value": "Test courses index in the last page\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.feature 'System: Administration: Courses' do\n let(:instance) { create(:instance) }\n\n with_tenant(:instance) do\n let!(:courses) do\n courses = create_...
ruby
chosen
[ { "from": "system", "value": "Order of reducer input values is not deterministic.\n" }, { "from": "human", "value": "module CombinedTextTest\n class Mapper < Humboldt::Mapper\n input :long, :text\n output :text, :text\n\n setup do\n puts \"!!! combined mapper setup\"\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Update chef client to 11.16.2-1\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] = \"11.1.3-1\"\n\n# Set ...
ruby
chosen
[ { "from": "system", "value": "Allow non-logged in to view leaderboard\n" }, { "from": "human", "value": "class PagesController < ApplicationController\n before_action :authenticate_user!, except: [:index, :help]\n def index\n @latest_battles = Battle.order(\"updated_at desc\").includes(:are...
ruby
chosen
[ { "from": "system", "value": "Send to subscriber first in case debug is sluggish.\n" }, { "from": "human", "value": "require 'json'\nrequire 'faraday'\n\nmodule Bnr\n module Webhooks\n class Notifier\n include Bnr::Webhooks::Signing\n\n attr_reader :event, :source, :subscriber, :ht...
ruby
chosen
[ { "from": "system", "value": "Fix \"edit load profile\" page\n\ntechnologies_select_options should take an argument specifying the\nselected technology, if applicable.\n" }, { "from": "human", "value": "module LoadProfilesHelper\n def load_profile_categories_select_options(profile)\n load_pr...
ruby
chosen
[ { "from": "system", "value": "Make test helper work more like a real Client\n\nClient#deliver receives a block that allows the caller\nto know the status of the HTTP call after the callback\nfires.\n\nBy default we return a successful response using an\nOpenStruct.\n" }, { "from": "human", "valu...
ruby
chosen
[ { "from": "system", "value": "Remove this enable as well\n" }, { "from": "human", "value": "# -*- encoding : utf-8 -*-\n# This middleware removes all keyframes before frame 0, and skips trackers entirely if they are all before frame 0\nclass Tracksperanto::Middleware::StartTrim < Tracksperanto::...
ruby
chosen
[ { "from": "system", "value": "Change mail address to andrew's address\n" }, { "from": "human", "value": "class UserMailer < ActionMailer::Base\n default from: \"from@example.com\"\n\n def event_notification(event)\n @event = event\n mail(to: 'anders.e.howerton@gmail.com', subject: \"New ...
ruby
chosen
[ { "from": "system", "value": "Add GPS 2.3 solution to the file\n" }, { "from": "human", "value": "# Your Names\n# 1) Stephanie Major\n# 2)\n\n# We spent [#] hours on this challenge.\n\n# Bakery Serving Size portion calculator.\n\ndef serving_size_calc(item_to_make, num_of_ingredients)\n library...
ruby
chosen
[ { "from": "system", "value": "Remove useless commented out tests\n" }, { "from": "human", "value": "require \"test_helper\"\n\nclass CaseStudyTest < ActiveSupport::TestCase\n include DocumentBehaviour\n include ActionDispatch::TestProcess\n\n test \"should be able to relate to policies\" do\n...
ruby
chosen
[ { "from": "system", "value": "Add counter cache to flaggable\n" }, { "from": "human", "value": "module MakeFlaggable\n class Flagging < ActiveRecord::Base\n belongs_to :flaggable, :polymorphic => true\n belongs_to :flagger, :polymorphic => true\n scope :with_flag, lambda { |flag| where...
ruby
chosen
[ { "from": "system", "value": "Remove ability to dig into instance variables\n\nThe data object should provide access via its methods instead.\n" }, { "from": "human", "value": "module Handlebars\n module Context\n def get(path)\n items = path.split('.'.freeze)\n\n current = @data\n...
ruby
chosen
[ { "from": "system", "value": "Use instead of and add a documentation comment\n" }, { "from": "human", "value": "module Runoff\n # Commands that can be executed by the application.\n module Commands\n # The base class for every runoff command.\n class Command\n def self.get_file_wr...
ruby
chosen
[ { "from": "system", "value": "Use the local copy of host on each thread\n" }, { "from": "human", "value": "require 'thread'\n\nmodule SSHKit\n\n module Runner\n\n class Parallel < Abstract\n def execute\n threads = []\n hosts.each do |host|\n threads << Thread.new...
ruby
chosen
[ { "from": "system", "value": "Use RbConfig instead of Config, latter is deprecated\n" }, { "from": "human", "value": "require 'rbconfig'\nrequire 'mario'\n\nmodule Vagrant\n module Util\n # This class just contains some platform checking code.\n class Platform\n class << self\n ...
ruby
chosen
[ { "from": "human", "value": "Add TV Show Tracker Widget 1.3.3\n" }, { "from": "gpt", "value": "class TvShowTracker < Cask\n url 'http://www.pixelperfectwidgets.com/tvshowtracker/download/tvshowtracker_1.3.3.zip'\n homepage 'http://www.pixelperfectwidgets.com/'\n version '1.3.3'\n sha1 '81e61...
ruby
chosen
[ { "from": "system", "value": "Upgrade Vagrant Manager.app to v2.5.4\n" }, { "from": "human", "value": "cask 'vagrant-manager' do\n version '2.5.3'\n sha256 'c2780c3560f7f27a0a87fa01983ec329ed13b7cb139515cf70415ae959b99562'\n\n # github.com/lanayotech/vagrant-manager was verified as official w...
ruby
chosen
[ { "from": "system", "value": "Update ZeroBrane Studio to 1.30\n" }, { "from": "human", "value": "cask 'zerobranestudio' do\n version '1.20'\n sha256 '1ad9bc8b4c636f4a2c8bf6adb55ba0b4327c134ced0058744496ac6accc8265e'\n\n url \"https://download.zerobrane.com/ZeroBraneStudioEduPack-#{version}-ma...
ruby
chosen
[ { "from": "system", "value": "Fix rubocop error in 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 'yabfi/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Add seed data for Posts.\n" }, { "from": "human", "value": "\nUser.create([\n {email: 'green@mail.com', \n password: '12345678', password_confirmation: '12345678'},\n {email: 'pink@mail.com', \n password: '12345678', password_confirmation: '12345678'}\...
ruby
chosen
[ { "from": "system", "value": "Switch to Team number schema\n" }, { "from": "human", "value": "class Team\n\tinclude Mongoid::Document\n\tinclude Mongoid::Timestamps\n\n\tfield :name, type: String\n\tfield :location, type: String\n\n\thas_many :participations\n\thas_many :records\nend\n" }, {...
ruby
chosen
[ { "from": "system", "value": "Add server prefix to directory for pulling JAR\n" }, { "from": "human", "value": "name \"loom-server\"\ndefault_version \"develop\"\n\nsource :git => \"git://github.com/continuuity/loom.git\"\nrelative_path 'server'\n\nbuild do\n command \"mkdir -p #{install_dir}/s...
ruby
chosen
[ { "from": "system", "value": "Use swift version 4.0 for podspec\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'FDChessboardView'\n s.version = '1.0.0'\n s.license = 'MIT'\n s.summary = 'A view controller for chess boards'\n s.homepage = 'https://github.com/fulldecent/FD...
ruby
chosen
[ { "from": "system", "value": "Add first test for redemption api\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndef app\n ApplicationApi\nend\n\ndescribe RedemptionsApi do\n include Rack::Test::Methods\n\n describe 'e.g. GET, POST, PUT, etc.' do\n it 'needs tests to be written!...
ruby
chosen
[ { "from": "system", "value": "Remove sha check and version from FirefoxAurora\n\nSha is likely to change without notice even for the same dmg filename (was currently broken because of this)" }, { "from": "human", "value": "class FirefoxAurora < Cask\n version '35.0a2'\n sha256 'c27899ebdb9d3b4...
ruby
chosen
[ { "from": "system", "value": "Fix test Outputs::OFX missing require.\n" }, { "from": "human", "value": "require 'bigdecimal'\n\nrequire_relative '../../../test_helper'\nrequire_relative '../../../../lib/bank-account-statement/outputs'\n\n\n{\n BankAccountStatement::Outputs::OFX::V_2_1_1 => [\n ...
ruby
chosen
[ { "from": "human", "value": "Add Cask for LastPass Universal Mac OS X\n\nThis patch adds support for the LastPass Universal\nInstaller for Mac, which is a .dmg containing\nall of the LastPass browser extensions.\n" }, { "from": "gpt", "value": "class LastpassUniversal < Cask\n url 'https://last...
ruby
chosen
[ { "from": "human", "value": "Change in amount precision for spree adjustments\n\nFixes #2715\nFixes #2716\n" }, { "from": "gpt", "value": "class ChangeAdjustmentsAmountPrecision < ActiveRecord::Migration\n def change\n \n change_column :spree_adjustments, :amount, :decimal, :precision => ...
ruby
chosen
[ { "from": "system", "value": "Remove relationship to stats data set\n\nThis DfT publication has an association to a statistical data set\nfrom DCLG on a completely irrelevant subject. We're assuming this\nis not intended. The data set is also superseded so remove the\nrelationship.\n" }, { "from": "...
ruby
chosen
[ { "from": "system", "value": "Add Rake to development dependencies so Bundler doesn't freak out\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/big_decimal_helper/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Sam L...
ruby
chosen
[ { "from": "system", "value": "Add depends_on & name stanzas to EclipseJEE Kepler" }, { "from": "human", "value": "cask :v1 => 'eclipse-jee-kepler' do\n version '4.3.2'\n sha256 'd18c5b4249a782a36c2d7bb377871393acd5dd552a195fc49b5b944f04874fbf'\n\n url 'http://www.eclipse.org/downloads/downloa...
ruby
chosen
[ { "from": "system", "value": "Update faraday_middleware dependnacy to 0.8\n" }, { "from": "human", "value": "# encoding: utf-8\nrequire File.expand_path('../lib/fcc_reboot/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.add_dependency 'faraday', '~> 0.7'\n gem.add_dependency 'fara...
ruby
chosen
[ { "from": "system", "value": "Change name of test class and change local variables into object variables for clarity.\n" }, { "from": "human", "value": "require File.expand_path(File.dirname(__FILE__) + '/helper')\n\nclass TestWepayRails < ActiveSupport::TestCase\n def teardown\n delete_wepa...
ruby
chosen
[ { "from": "system", "value": "Comment out part of test that breaks in test ENV (for now)\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe DashboardController do\n include Devise::Test::ControllerHelpers\n\n render_views\n\n describe 'ACME endpoint' do\n it \"has a fallb...
ruby
chosen
[ { "from": "human", "value": "Include unit test for numeric class\n" }, { "from": "gpt", "value": "require File.expand_path(\"../../../base\", __FILE__)\n\nrequire \"vagrant/util/numeric\"\n\ndescribe Vagrant::Util::Numeric do\n include_context \"unit\"\n before(:each) { described_class.reset! ...
ruby
chosen
[ { "from": "system", "value": "Add newline, so shell doesn't get confused when calling via curl.\n" }, { "from": "human", "value": "class ApiController < ApplicationController\n\n skip_before_filter :login_required\n \n def import\n json = request.body.read\n begin\n ProjectImporter...
ruby
chosen
[ { "from": "system", "value": "Refactor Timeslot date format methods to helper\n" }, { "from": "human", "value": "module ApplicationHelper\nend\n" }, { "from": "gpt", "value": "module ApplicationHelper\n\n def start_day_time(timeslot)\n Time.zone.at(timeslot.start).strftime(\"%A a...
ruby
chosen
[ { "from": "system", "value": "Add center tag so titles are centered\n" }, { "from": "human", "value": "module ApplicationHelper\n BASE_TITLE = 'Ecotone | OSU-Cascades'.freeze\n\n def full_title(page_title = '')\n page_title.empty? ? BASE_TITLE : \"#{page_title} | #{BASE_TITLE}\"\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Include vars to be sent over to mail template\n" }, { "from": "human", "value": "class NewRequestMailer < BaseMandrillMailer\n def notify(request, user)\n subject = \"#{request.requester.first_name} needs a neighbor!\"\n merge_vars = {\n \"\"\n }\n ...
ruby
chosen
[ { "from": "system", "value": "Test to_s method on address\n" }, { "from": "human", "value": "require_relative '../spec_helper'\n\nclass AddressSpec < Skr::TestCase\n\n it \"can be instantiated\" do\n model = Address.new\n model.must_be_instance_of(Address)\n end\n\nend\n" }...
ruby
chosen
[ { "from": "system", "value": "Make the game test use new instead of new_game\n\nThis way the new_game constructor can not take an injected board.\nCurrently it's sort of confusing that new game takes a board since it\nalso calls reset. If only new takes an injected board though, then this\nconfustion will g...
ruby
chosen
[ { "from": "system", "value": "Fix issue in podspec github url.\n\nFixed lint warning \"WARN | github_sources: Github repositories should end in `.git`.\", added `.git`.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"ReactiveReSwift\"\n s.version = ...
ruby
chosen
[ { "from": "system", "value": "Use temporary redirect in root/index, since destination may change soon\n" }, { "from": "human", "value": "class RootController < ApplicationController\n def index\n redirect_to Journey::SiteOptions.site_root(logged_in?), 307\n end\nend\n" }, { "from": ...
ruby
chosen
[ { "from": "system", "value": "Use `delegate` instead of explicit delegation\n\nThis commit makes ManualPresenter consistent with SectionPresenter by\nusing the same delegation style introduced in 20cd0833.\n" }, { "from": "human", "value": "class ManualPresenter\n def initialize(manual)\n @m...
ruby
chosen
[ { "from": "system", "value": "Add Recommendations & Sections To Item Serializer\n" }, { "from": "human", "value": "class ItemSerializer < ActiveModel::Serializer\n attributes :id, :title, :ward, :number\n\n has_one :item_type\nend\n" }, { "from": "gpt", "value": "class ItemSerializ...
ruby
chosen
[ { "from": "system", "value": "Refactor routes by adding after filter\n" }, { "from": "human", "value": "class DayController < ApplicationController\n get '/:date?', authentication: true do |date_string|\n @date_string = date_string || Date.today.to_s\n date = Date.parse(@date_string)\n ...
ruby
chosen
[ { "from": "system", "value": "Update badge helper to customize CSS class\n" }, { "from": "human", "value": "module ApplicationHelper\n\n def glyph(icon, size = 1, classes = \"\")\n content_tag(:i, '', :class => \"icon-#{icon} #{size > 1 ? \"icon-#{size}x\" : nil} #{classes}\".strip)\n end\n...
ruby
chosen
[ { "from": "system", "value": "Add moderable concern to GobiertoPlans::Node\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire_dependency \"gobierto_plans\"\n\nmodule GobiertoPlans\n class Node < ApplicationRecord\n has_and_belongs_to_many :categories, class_name: \"G...
ruby
chosen
[ { "from": "system", "value": "Add a comment to explain how global survey works.\n" }, { "from": "human", "value": "# this class has 2 sub-classes: CourseSurveyResponseMap and AssignmentSurveyResponseMap\n# The reviewed_object id is either assignment or course id;\n# The reviewer_id is either ass...
ruby
chosen
[ { "from": "system", "value": "Make cache validity check private\n" }, { "from": "human", "value": "module LokalebasenSettingsClient\n class SettingsCache\n attr_reader :cache\n attr_accessor :cache_time\n private :cache\n\n def initialize\n @cache_time = 60 * 60 # 1 Hour\n\n ...
ruby
chosen
[ { "from": "system", "value": "Return stats on the collection\n" }, { "from": "human", "value": "# encoding: utf-8\nmodule Mongoid #:nodoc:\n module Collections #:nodoc:\n module Operations #:nodoc:\n # Constant definining all the read operations available for a\n # Mongo:Collection...
ruby
chosen
[ { "from": "human", "value": "Add task to fix missing wiki repos\n" }, { "from": "gpt", "value": "desc \"Creates missing wiki repositories\"\ntask :fix_missing_wiki_repos => :environment do\n repo_project_ids = Repository.where(:kind => Repository::KIND_WIKI).pluck(:project_id)\n project_ids = ...
ruby
chosen
[ { "from": "system", "value": "Enable (silent) logging in test suite.\n" }, { "from": "human", "value": "if ENV[\"COVERAGE\"]\n require 'simplecov'\n SimpleCov.start do\n add_filter 'spec'\n\n add_group \"BSON\", 'lib/moped/bson'\n add_group \"Protocol\", 'lib/moped/protocol'\n add_...
ruby
chosen
[ { "from": "system", "value": "Load Kaminari gem's spec/support files\n" }, { "from": "human", "value": "$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))\n$LOAD_PATH.unshift(File.join(Gem.loaded_specs['kaminari'].gem_dir, 'spec'))\n$LOAD_PATH.unshift(File.dirname(__FILE__))\n\nb...
ruby
chosen
[ { "from": "system", "value": ":nail_care: Set coverage directory for CircleCI\n" }, { "from": "human", "value": "require 'simplecov'\nSimpleCov.start if ENV.fetch('CODECLIMATE_REPO_TOKEN', nil)\n\nrequire 'pry'\n\nrequire 'fluent/load'\nrequire 'fluent/test'\nrequire 'fluent/plugin/out_graylog'\...
ruby
chosen
[ { "from": "system", "value": "Update RSpec's 'filter_run' config syntax" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\n\nrequire 'enumerate_it'\n\nrequire 'active_support/all'\nrequire 'active_record'\n\nDir['./spec/support/**/*.rb'].each { |f| requi...
ruby
chosen
[ { "from": "system", "value": "Add vendor filter for proper CI coverage\n" }, { "from": "human", "value": "require 'simplecov'\nrequire 'scrutinizer/ocular'\nrequire \"scrutinizer/ocular/formatter\"\nrequire \"codeclimate-test-reporter\"\nrequire \"sidekiq/testing\"\nrequire 'textris/delay/sideki...
ruby
chosen
[ { "from": "system", "value": "Remove require on undeclared dependency, pry.\n" }, { "from": "human", "value": "require_relative '../lib/story_branch'\nrequire 'pry'\n\nRSpec.configure do |config|\n # some (optional) config here\nend\n\ndef copy_config_file(filename, empty_contents=false)\n Fil...
ruby
chosen
[ { "from": "system", "value": "Update rspec helper to load dotenv variables (thanks, Alan)\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'spork'\nrequire 'webmock/rspec'\nrequire 'vcr'\nrequire \"factory_girl_rails\"\nrequire 'blacklight'\nFactoryGirl.find_definitions\n\nENV['RAI...
ruby
chosen
[ { "from": "system", "value": "Revert \"initial commit - very few specs\"\n\nThis reverts commit 36d046967608439307f862cdfc3d525d17903e6b.\n" }, { "from": "human", "value": "require 'bundler'\nBundler.setup(:default, :test)\n\nrequire 'rspec'\nrequire 'rspec/autorun'\nrequire 'howrah_renderer'\n\...
ruby
chosen
[ { "from": "system", "value": "Fix a typo and narrow the begin block that hid the typo.\n" }, { "from": "human", "value": "module Kakasi\n module Lib\n if defined?(::FFI::Platform)\n LIBPREFIX = ::FFI::Platform::LIBPREFIX\n LIBSUFFIX = ::FFI::Platform::LIBSUFFIX\n else\n LIB...
ruby
chosen
[ { "from": "system", "value": "Change default locale to english\n" }, { "from": "human", "value": "require File.expand_path('../boot', __FILE__)\n\nrequire 'rails/all'\n\n# Require the gems listed in Gemfile, including any gems\n# you've limited to :test, :development, or :production.\nBundler.re...
ruby
chosen
[ { "from": "system", "value": "Make name a precomputed attribute for nicer inspects" }, { "from": "human", "value": "module Mellon\n class Keychain\n class << self\n def find(name)\n quoted = Regexp.quote(name)\n regexp = Regexp.new(quoted, Regexp::IGNORECASE)\n\n ke...
ruby
chosen
[ { "from": "system", "value": "Update SoundK plugin (new source url)\n" }, { "from": "human", "value": "require 'nokogiri'\nrequire 'open-uri'\n\nmodule Cinch\n module Plugins\n class Soundk\n include Cinch::Plugin\n\n match /(soundk)$/\n match /(help soundk)$/, method: :help\n...
ruby
chosen
[ { "from": "system", "value": "Raise error if config vars are missing\n" }, { "from": "human", "value": "module Puffery\n class Client\n\n USER_AGENT = \"Puffery Ruby #{Puffery::VERSION}\"\n\n attr_accessor :url, :key\n\n def initialize(url, key)\n self.url = url\n self.key = ...
ruby
chosen
[ { "from": "system", "value": "Remove accessor to quell ruby warnings\n" }, { "from": "human", "value": "module Tunit\n class Runnable\n def self.runnable_methods\n fail NotImplementedError, \"subclass responsibility\"\n end\n\n def self.runnables\n @@runnables ||= []\n end...
ruby
chosen
[ { "from": "human", "value": "Add component smoke testing, using fixtures\n\n https://en.wikipedia.org/wiki/Smoke_testing_(software)\n\nEach component has a set of fixture data that is used to generate\nexamples within govuk-component-guide, and show example usage.\n\nUse this example data to run smoke test...
ruby
chosen