conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Use an attr_reader rather than an explicit method.\n" }, { "from": "human", "value": "require 'fileutils'\n\nmodule VCR\n class Cassette\n class StorageBackends\n module FileSystem\n extend self\n\n def storage_location\n @storage_loc...
ruby
chosen
[ { "from": "system", "value": "Print newline after exit hooks\n\nPrevents the Pry shell from overwriting content from stdout that was not written with a newline." }, { "from": "human", "value": "class << PryRescue\n def exit_callbacks\n @exit_callbacks ||= []\n end\n\n def run_exit_callback...
ruby
chosen
[ { "from": "system", "value": "Fix missing syntax highlighting for ecmascript\n\nThe rouge gem doesn't recognize ecmascript as a language,\nthis adds a hack so that it considers ecmascript as javascript.\n\nFixes exercism/xecmascript#34\n" }, { "from": "human", "value": "require 'exercism/markdow...
ruby
chosen
[ { "from": "system", "value": "Write integration tests for time zone\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass TimeZoneFlowsTest < ActionDispatch::IntegrationTest\n # test \"the truth\" do\n # assert true\n # end\nend\n" }, { "from": "gpt", "value": "requi...
ruby
chosen
[ { "from": "system", "value": "Add description method in bill description\n" }, { "from": "human", "value": "module SUNAT\n module Delivery\n class BillResponse\n CORRECT_CODE = 0\n RESPONSE_CODE_KEY = 'cbc:ResponseCode'\n\n attr_reader :content\n\n def initialize(response...
ruby
chosen
[ { "from": "system", "value": "[BUGFIX] Fix JSON::ParseError when server responded with an HTML\n" }, { "from": "human", "value": "module WoocommerceAPI\n class ClientError < StandardError\n attr_accessor :code\n def initialize(code, response)\n @code = code\n message = case code...
ruby
chosen
[ { "from": "system", "value": "Debug scanner, please use TokenKinds.\n" }, { "from": "human", "value": "module CodeRay\nmodule Scanners\n\n # = Debug Scanner\n # \n # Interprets the output of the Encoders::Debug encoder.\n class Debug < Scanner\n\n register_for :debug\n title 'CodeRay T...
ruby
chosen
[ { "from": "system", "value": "Fix issue with Telnet login\n" }, { "from": "human", "value": "require 'net/telnet'\n\nmodule Net\n module Ops\n module Transport\n \n #\n class Telnet\n \n # Open a Telnet session to the specified host using net/ssh.\n #\n ...
ruby
chosen
[ { "from": "human", "value": "Create JSON Serializer according to Riak API." }, { "from": "gpt", "value": "module Ork::Encryption\n module Serializers\n\n # Implements the {Riak::Serializer} API for the purpose of\n # encrypting/decrypting Ork documents as JSON.\n #\n # @see Encrypti...
ruby
chosen
[ { "from": "system", "value": "Update HawkularClient to the new version.\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\nrequire \"manageiq/providers/hawkular/version\"\n\nGem::Specification.new do |s|\n s.name = \"manageiq-providers-hawkular\"\n s.ve...
ruby
chosen
[ { "from": "human", "value": "Add a helper to compare 2 URIs ignoring the order of request params\n" }, { "from": "gpt", "value": "# Compare 2 URIs ignoring the order of request parameters\nmodule Ruby\n module Toolbox\n\n class Uri\n\n def initialize(uri)\n @uri = uri\n end\...
ruby
chosen
[ { "from": "system", "value": "Replace retrieve by exists? in find method\n" }, { "from": "human", "value": "module S3\n module BucketsExtension\n # Builds new bucket with given name\n def build(name)\n Bucket.send(:new, proxy_owner, name)\n end\n\n # Finds the bucket with given...
ruby
chosen
[ { "from": "system", "value": "Add missing space in warning message\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Mobility\n module Plugins\n=begin\n\nDirty tracking for Mobility attributes. See class-specific implementations for\ndetails.\n\n@see Mobility::Plugins::...
ruby
chosen
[ { "from": "system", "value": "Print failure messages after line for better readability.\n" }, { "from": "human", "value": "require \"rubygems\"\nrequire \"term/ansicolor\"\ninclude Term::ANSIColor\nrequire \"strut/report\"\n\nmodule Strut\n class ReportPrinter\n def initialize(lines)\n ...
ruby
chosen
[ { "from": "system", "value": "Allow existing roles to be used like traits\n" }, { "from": "human", "value": "module Rolistic\n module ClassMethods\n def load(raw)\n case raw\n when self then raw\n when String, Symbol\n new(raw) unless raw.blank?\n else\n new...
ruby
chosen
[ { "from": "human", "value": "Add some tests for the securedrop app deployment\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\n['/var/www/securedrop','/var/lib/securedrop','/var/lib/securedrop/store','/var/lib/securedrop/keys'].each do |myDir|\n describe file(myDir) do\n it { should...
ruby
chosen
[ { "from": "system", "value": "Update Module Proposal spec to use new title\n" }, { "from": "human", "value": "require 'spec_helper'\n\nRSpec.feature \"Module Proposal Management\" do\n \n feature \"Module Proposal Creation\" do\n \n scenario \"new module proposal\" do\n #we need thi...
ruby
chosen
[ { "from": "system", "value": "Add spec for create new object with hash\n" }, { "from": "human", "value": "require \"spec_helper\"\n\nmodule Scanny::Checks\n describe MassAssignmentCheck do\n before do\n @runner = Scanny::Runner.new(MassAssignmentCheck.new)\n @message = \"Create ob...
ruby
chosen
[ { "from": "system", "value": "Return elements in api controller ordered by position\n\nThis would be expected anyway and fixes a flaky sepc.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Alchemy\n class Api::ElementsController < Api::BaseController\n # Returns al...
ruby
chosen
[ { "from": "system", "value": "Sort orgs by number of repos" }, { "from": "human", "value": "class GithubOrganisationsController < ApplicationController\n def index\n @most_repos = GithubOrganisation.most_repos.limit(20).to_a\n @most_stars = GithubOrganisation.most_stars.limit(20).to_a\n ...
ruby
chosen
[ { "from": "system", "value": "Fix batch email preview in test rails app with mongoid orm\n" }, { "from": "human", "value": "class ActivityNotification::MailerPreview < ActionMailer::Preview\n\n def send_notification_email_single\n target_notification = ActivityNotification::Notification.wher...
ruby
chosen
[ { "from": "human", "value": "Add some tests for ListDigest.\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe ListDigest do\n before :each do\n @list_digest = ListDigest.new \"Some Title\", \"A bunch of text\"\n end\n\n describe \"#new\" do\n it \"takes title and digest...
ruby
chosen
[ { "from": "system", "value": "Prepare code for Active Record 4\n" }, { "from": "human", "value": "class Notification < ActiveRecord::Base\n\n belongs_to :user\n belongs_to :submission\n\n scope :recent, order(at: :desc).limit(100)\n\n before_create do\n self.at ||= DateTime.now.utc\n ...
ruby
chosen
[ { "from": "system", "value": "Use 1 as default template id\n" }, { "from": "human", "value": "module RuleIo\n class Transactional < Base\n include Virtus.model(strict: true)\n\n attribute :transaction_type, String, default: \"email\"\n attribute :transaction_name, String, default: \"...
ruby
chosen
[ { "from": "system", "value": "Revert \"add confusing and untested method\"\n\nThis reverts commit 443edd39e330f85430384e650026ef6439b69c22.\n" }, { "from": "human", "value": "require 'syslog/logger'\nrequire 'json'\n\nmodule TangaServices\n # Logs json to syslog.\n # Automatically delegates st...
ruby
chosen
[ { "from": "system", "value": "Use https to download source tarballs\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule VagrantBindfs\n module Bindfs\n SOURCE_VERSION = '1.14.0'\n SOURCE_URLS = [\n 'http://bindfs.org/downloads/bindfs-%<bindfs_version>.tar....
ruby
chosen
[ { "from": "system", "value": "Create tmp/cache during CI setup\n" }, { "from": "human", "value": "namespace :ci do\n desc <<-DESC\n Runs tasks to prepare a CI build on Semaphore.\n DESC\n\n task :setup do\n cp 'config/email.sample.yml', 'config/email.yml'\n cp 'config/secrets.sampl...
ruby
chosen
[ { "from": "human", "value": "Add migration for NavItem link_to_first_child\n\n- added a migration to change nav_items.link_to_first_child to be a non null value (true/false).\n- updates folder nav items to change undefined values for link to first child to true to match current code which overrides that val...
ruby
chosen
[ { "from": "human", "value": "Remove null constraint from categories.order\n" }, { "from": "gpt", "value": "class RemoveNullConstraintCategoriesOrder < ActiveRecord::Migration\n def up\n change_column :categories, :order, :integer, null: true\n end\n\n def down\n change_column :categorie...
ruby
chosen
[ { "from": "human", "value": "Update data_encryption_key_id foreign key to bigint\n" }, { "from": "gpt", "value": "class ChangeDataEncryptionKeyIdToBigint < ActiveRecord::Migration[6.0]\n def up\n change_column :encrypted_fields, :data_encryption_key_id, :bigint\n end\n\n def down\n chan...
ruby
chosen
[ { "from": "system", "value": "Add exposed manager refresh method\n\nAdd exposed manager refresh method\n" }, { "from": "human", "value": "module MiqAeMethodService\n class MiqAeServiceEmsEvent < MiqAeServiceEventStream\n def refresh(*targets, sync)\n ar_method { @object.refresh(*targets...
ruby
chosen
[ { "from": "system", "value": "Fix typo in request logger middleware" }, { "from": "human", "value": "module Middleware\n class RequestLogger\n def initialize(app, logger = nil)\n @app = app\n @logger = logger || Logger.new(STDOUT)\n end\n\n def call(env)\n unless ENV[...
ruby
chosen
[ { "from": "system", "value": "Fix spec errors related to the User model due to factory refactoring\n" }, { "from": "human", "value": "describe User do\n it \"should respond to both examiner and assistent\" do\n examiner = create(:examiner)\n given_course = create(:given_course, examiners:...
ruby
chosen
[ { "from": "human", "value": "Complete The Calculator Example without ExtraCredits\n" }, { "from": "gpt", "value": "# @Author: Aswin Mohan <aswinmohan>\n# @Date: 2016-09-10T08:29:18+05:30\n# @Last modified by: aswinmohan\n# @Last modified time: 2016-09-10T08:38:14+05:30\n\n# Add two numbers\n...
ruby
chosen
[ { "from": "system", "value": "Set requried ruby version to 1.9+\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/snoo/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Jeff Sandberg\"]\n gem.email = [\"paradox4...
ruby
chosen
[ { "from": "system", "value": "Use @public interfaces between gems (get dm-types out of the validations business)." }, { "from": "human", "value": "require 'dm-core'\nrequire 'dm-types/support/flags'\n\nmodule DataMapper\n class Property\n class Enum < Integer\n\n include Flags\n\n ...
ruby
chosen
[ { "from": "system", "value": "Fix incorrectly named method in `Student` model\n\nReverse geocoding turns gps coordinates into an address. What we're\nactually doing is just normal geocoding.\n" }, { "from": "human", "value": "require 'net/http'\nrequire 'sequel'\nrequire 'json'\n\nclass Student...
ruby
chosen
[ { "from": "system", "value": "Change update permissions for API\n" }, { "from": "human", "value": "class Api::BookmarksController < ApplicationController\n respond_to :json\n\n def index\n render json: Bookmark.all\n end\n\n def show\n render json: Bookmark.find(params[:id])\n end\n\n...
ruby
chosen
[ { "from": "system", "value": "Add create new opening hours object in create method\n" }, { "from": "human", "value": "class OpeningHoursController < ApplicationController\n\tbefore_action :set_opening_hour, except: %i(index create)\n\n\tdef index\n\t\t@opening_hours = policy_scope(OpeningHour)\n...
ruby
chosen
[ { "from": "system", "value": "Replace require_relative to keep 1.8.7 compatibily\n" }, { "from": "human", "value": "require \"rails_db_info/engine\"\nrequire_relative \"rails/routes\"\n\nmodule RailsDbInfo\nend\n" }, { "from": "gpt", "value": "require \"rails_db_info/engine\"\nrequir...
ruby
chosen
[ { "from": "system", "value": "Stop transactions throwing an error when save failed - show error message instead\n" }, { "from": "human", "value": "class Admin::TransactionsController < Admin::BaseController\n def show\n @transaction = resource\n @latest_edition = resource.latest_edition\n...
ruby
chosen
[ { "from": "system", "value": "Add bot account ids to black list\n\n`Account.where(Account.arel_table[:following_count].gt(10_000)).ids`\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass FollowingAccountsController < ApplicationController\n include AccountControllerConcer...
ruby
chosen
[ { "from": "system", "value": "Fix namespace in moderation policy\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule GobiertoAdmin\n class ModerationPolicy < ::GobiertoAdmin::BasePolicy\n attr_reader :moderable\n\n def initialize(attributes)\n super(attributes)...
ruby
chosen
[ { "from": "system", "value": "Fix code coverage issue by introducing shutup blocks\n" }, { "from": "human", "value": "require \"test_helper\"\n\ndescribe Hbc::CLI::Reinstall do\n it \"allows reinstalling a Cask\" do\n Hbc::CLI::Install.run(\"local-transmission\")\n Hbc.load(\"local-transm...
ruby
chosen
[ { "from": "system", "value": "Test objects created by customer_return factory\n\nTest for issue fixed by https://github.com/solidusio/solidus/pull/697\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'spree/testing_support/factories/customer_return_factory'\n\nRSpec.describe 'cu...
ruby
chosen
[ { "from": "system", "value": "Refactor internals of Blogger::Authorizer for readability\n" }, { "from": "human", "value": "module RBlogger\n class Blogger::Authorizer\n def initialize(configuration)\n @configuration = configuration\n end\n\n attr_reader :configuration\n\n def a...
ruby
chosen
[ { "from": "system", "value": "Use confirmed user for admin fabricator\n" }, { "from": "human", "value": "Fabricator(:user) do\n # username \"martinisoft\"\n username { Fabricate.sequence(:username) { |i| \"martinisoft-#{i}\" } }\n email { Fabricate.sequence(:email) { |i| \"user+#{i}@example.c...
ruby
chosen
[ { "from": "system", "value": "Use lower() in index for urls\n" }, { "from": "human", "value": "class AddSearchIndexes < ActiveRecord::Migration[5.1]\n def up\n execute <<-SQL\n CREATE EXTENSION pg_trgm;\n\n CREATE INDEX notes_text_gin on notes using GIN(to_tsvector('english', text...
ruby
chosen
[ { "from": "system", "value": "Fix translation on project channel admin\n" }, { "from": "human", "value": "class Channels::Admin::ProjectsController < Admin::BaseController\n menu I18n.t('channels.admin.menu') => Rails.application.routes.url_helpers.admin_projects_path\n\n\n has_scope :by_id, :...
ruby
chosen
[ { "from": "system", "value": "Fix CocoaPods spec for FaceDetector" }, { "from": "human", "value": "require 'json'\n\npackage = JSON.parse(File.read(File.join(__dir__, 'package.json')))\n\nPod::Spec.new do |s|\n s.name = 'react-native-camera'\n s.version = package['version']\n ...
ruby
chosen
[ { "from": "system", "value": "Sort people on welcome controller\n" }, { "from": "human", "value": "module GobiertoPeople\n class WelcomeController < GobiertoPeople::ApplicationController\n include PoliticalGroupsHelper\n\n before_action :check_active_submodules\n\n def index\n @pe...
ruby
chosen
[ { "from": "system", "value": "Add comments to the controller\n" }, { "from": "human", "value": "#\n# == NewslettersController\n#\nclass NewslettersController < InheritedResources::Base\n before_action :set_newsletter_user, only: [:see_in_browser, :welcome_user]\n before_action :set_variables, ...
ruby
chosen
[ { "from": "system", "value": "Clean up digest migration script\n" }, { "from": "human", "value": "# Encoding: utf-8\n# Change hash to digest\nclass ChangeHashToDigest < ActiveRecord::Migration\n def self.up\n rename_column :submissions, :hash, :digest\n end\n def self.down\n rename_colu...
ruby
chosen
[ { "from": "system", "value": "Fix migration since select is always truthy (empty array).\n" }, { "from": "human", "value": "class RemoveUnusedUserFields < ActiveRecord::Migration\n def self.up\n if User.columns.select{|x| x.name == 'passphrase'}\n remove_column User.table_name, :passphr...
ruby
chosen
[ { "from": "system", "value": "Fix NameError when pg is not loaded\n\nMost apps only load a single db adapter gem.\n\nA MySQL app, for example will not load the pg gem.\n\nSee https://github.com/airblade/paper_trail/issues/1022\n" }, { "from": "human", "value": "require \"paper_trail/type_seriali...
ruby
chosen
[ { "from": "human", "value": "Add a fairly lame model spec\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\nrequire 'frecon/model'\n\ndescribe FReCon::Model do\n\tdescribe '.controller' do\n\t\tit 'properly converts the class name to a controller name' do\n\t\t\tallow(FReCon::Model).to r...
ruby
chosen
[ { "from": "system", "value": "Make sure trying to create the same customer twice fails\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe TresDelta::Vault do\n let(:config) { TresDelta::Config.config }\n let(:wsdl) { config[\"management_wsdl\"] }\n let(:customer) { TresDelta...
ruby
chosen
[ { "from": "system", "value": "Remove relationship association from email analysis\n" }, { "from": "human", "value": "class EmailRetrievalService\n def initialize(user)\n @user = user\n @gmail = Gmail.connect(:xoauth2, user.email, user.oauth_token)\n end\n\n def retrieve_emails(partner, ...
ruby
chosen
[ { "from": "system", "value": "Refactor BaseAttribute to have dump & load methods\n" }, { "from": "human", "value": "module ArDocStore\n module AttributeTypes\n class BaseAttribute\n attr_accessor :conversion, :predicate, :options, :model, :attribute, :default\n\n def self.build(mod...
ruby
chosen
[ { "from": "system", "value": "Modify install generator to require godmin when namespaced\n" }, { "from": "human", "value": "require \"godmin/generators/base\"\n\nclass Godmin::InstallGenerator < Godmin::Generators::Base\n def create_initializer\n create_file \"config/initializers/godmin.rb\"...
ruby
chosen
[ { "from": "system", "value": "Copy locale file upon install.\n" }, { "from": "human", "value": "require 'rails/generators'\nrequire 'rails/generators/named_base'\n\nmodule LinkToAction\n module Generators\n class InstallGenerator < Rails::Generators::Base\n desc \"Copy LinkToAction conf...
ruby
chosen
[ { "from": "system", "value": "Improve the query of unfetched pixiv cards\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass PixivCardUpdateWorker\n include Sidekiq::Worker\n\n sidekiq_options queue: 'pull', retry: false\n\n def perform(status_id)\n status = Status.fi...
ruby
chosen
[ { "from": "system", "value": "Fix for prev commit . Allow only /login and /users/auth/google_apps/callback when not signed in.\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n protect_from_forgery\n before_filter :authentication\n\n def authentication\...
ruby
chosen
[ { "from": "system", "value": "Make require_editor a little more strict\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n # Prevent CSRF attacks by raising an exception.\n # For APIs, you may want to use :null_session instead.\n protect_from_forgery with...
ruby
chosen
[ { "from": "system", "value": "Add active link to menu\n" }, { "from": "human", "value": "module BlueberryCMS\n module MenusHelper\n def render_menu(slug)\n menu = BlueberryCMS::Menu.find_by(slugs: slug)\n safe_join(menu_links(menu.links)) if menu.links.any?\n end\n\n private\...
ruby
chosen
[ { "from": "system", "value": "Remove de podspec description since it must not be equal to the summary.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"JsonDB\"\n s.version = \"0.2.0\"\n s.summary = \"A simple in process database to store, query and manipulate JSON documen...
ruby
chosen
[ { "from": "system", "value": "Fix statement so setting dotenv_role works\n" }, { "from": "human", "value": "Capistrano::Configuration.instance(:must_exist).load do\n _cset(:dotenv_path){ \"#{shared_path}/.env\" }\n\n symlink_args = (role = fetch(:dotenv_role, nil) ? {:roles => role} : {})\n\n ...
ruby
chosen
[ { "from": "system", "value": "Fix typo in Custom Standard format definition\n" }, { "from": "human", "value": "class FormatCustomStandard < FormatStandard\n def format_pretty_name\n \"Custom Standard\"\n end\n\n def include_custom_sets?\n true\n end\n\n def rotation_schedule\n {\n ...
ruby
chosen
[ { "from": "system", "value": "Test address should respond to directions\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Address do\n subject(:address) { Fabricate.build(:address) }\n\n it { should respond_to(:sponsor) }\n it { should respond_to(:flat) }\n it { should res...
ruby
chosen
[ { "from": "system", "value": "Add 'email' and 'password_digest' to create_users migration\n" }, { "from": "human", "value": "class CreateUsers < ActiveRecord::Migration\n def change\n create_table :users do |t|\n t.string :first_name\n t.string :last_name\n t.referen...
ruby
chosen
[ { "from": "system", "value": "Add Rspec matcher for conditional per-platform matches\n\nSupports the expected value of `eq` changing per platform based on a\ngiven map of options. This is to sort out random number variations\nacross platforms without having to introduce if/else conditions into the\ntest cas...
ruby
chosen
[ { "from": "system", "value": "Use updated configuration path variable in debugging mode\n\nCloses #179\n" }, { "from": "human", "value": "module RuboCop\n module RSpec\n # Because RuboCop doesn't yet support plugins, we have to monkey patch in a\n # bit of our configuration.\n module I...
ruby
chosen
[ { "from": "system", "value": "Use gsub_file in app template\n" }, { "from": "human", "value": "def install_devise\n generate(\"devise:install\")\n\n devise_sender = ask(\"Please provide a sender e-mail address to use when sending info to users \" +\n \"(in the case of ...
ruby
chosen
[ { "from": "system", "value": "Add tests for Timeslot model\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe Timeslot, type: :model do\n pending \"add some examples to (or delete) #{__FILE__}\"\nend\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\...
ruby
chosen
[ { "from": "system", "value": "Test for new dtracetools-lx package\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe package('ca-certificates') do\n it { should be_installed }\nend\n\ndescribe package('cron') do\n it { should be_installed }\nend\n\ndescribe package('gettext-b...
ruby
chosen
[ { "from": "system", "value": "Fix problem with delayed job\n" }, { "from": "human", "value": "Noosfero.default_locale = 'pt'\nFastGettext.locale = Noosfero.default_locale\nFastGettext.default_locale = Noosfero.default_locale\nI18n.locale = Noosfero.default_locale\nI18n.default_locale = Noosfero....
ruby
chosen
[ { "from": "system", "value": "SUBJ: Test fix\nMSG:\n1) Quick fix link for test\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass SessionsControllerTest < ActionDispatch::IntegrationTest\n test \"should get new\" do\n get sessions_new_url\n assert_response :success\n end\n...
ruby
chosen
[ { "from": "human", "value": "Add tests for base transport session class\n" }, { "from": "gpt", "value": "require 'spec_helper'\nrequire 'bootstrapper/transport'\n\ndescribe Bootstrapper::TransportSession do\n\n let(:options) { double(\"Options object\") }\n let(:ui) { double(\"UI Object\") }\n...
ruby
chosen
[ { "from": "system", "value": "Test if student school year defined in old data migration\n" }, { "from": "human", "value": "class RemoveStudentSchoolYearsWithoutStudents < ActiveRecord::Migration[4.2]\n def change\n StudentSchoolYear.find_each do |student_school_year|\n student_school_ye...
ruby
chosen
[ { "from": "system", "value": "Make markdown filter specs be tolerant of RDiscount.\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + '/../spec_helper'\n\ndescribe MarkdownFilter do\n it \"should be named Markdown\" do\n MarkdownFilter.filter_name.should == \"Markdown\"\n e...
ruby
chosen
[ { "from": "system", "value": "[Brightbox] Test error when required args missing\n\nThis adds a test to confirm existing behaviour that ArgumentError is\nraised when `brightbox_client_id` or `brightbox_secret` is omitted.\n" }, { "from": "human", "value": "require \"minitest/autorun\"\nrequire \"...
ruby
chosen
[ { "from": "system", "value": "Use concat on split words for sentence\n\nTo ensure no multiple word strings get added to the sentence via\nrandom_word, split strings as they come in and concat them to the\narray. Need to look into the handling of random_word to see if theres a\nway to get rid of the mostly w...
ruby
chosen
[ { "from": "system", "value": "Remove nil elements from result array" }, { "from": "human", "value": "module TwentyfourSevenOffice\n module Services\n class Service\n extend Savon::Model\n include TwentyfourSevenOffice::DataTypes\n include TwentyfourSevenOffice::Utils\n\n ...
ruby
chosen
[ { "from": "system", "value": "Reduce code complexity on operations with data\n" }, { "from": "human", "value": "require \"minuteman/keys_methods\"\nrequire \"minuteman/bit_operations/data\"\n\nclass Minuteman\n module BitOperations\n # Public: The class to handle operations with datasets\n ...
ruby
chosen
[ { "from": "system", "value": "Fix wrong name for order decorator class\n" }, { "from": "human", "value": "module PiggybakBraintree\n module PaymentDecorator\n extend ActiveSupport::Concern\n\n included do\n def add_line_items(cart)\n cart.update_quantities\n\n cart.sell...
ruby
chosen
[ { "from": "system", "value": "Define warden_message for Devise < 2.0\n" }, { "from": "human", "value": "# Redirect to the logout url when :warden is thrown,\n# so that a single_sign_out request can be initiated\nclass DeviseCasAuthenticatable::SingleSignOut::WardenFailureApp < Devise::FailureApp...
ruby
chosen
[ { "from": "system", "value": "Add :only_contained option to stagehand_synced?\n" }, { "from": "human", "value": "ActiveRecord::Base.class_eval do\n # SYNC CALLBACKS\n define_callbacks :sync\n\n def self.before_sync(method, options = {})\n set_callback :sync, :before, method, options\n end...
ruby
chosen
[ { "from": "human", "value": "Create rake task for adding contest categories to a contest\n" }, { "from": "gpt", "value": "namespace :jmd do\n namespace :contests do\n desc \"Add contest categories to a contest\"\n task add_ccs: :environment do\n puts \"What contest would you like to ...
ruby
chosen
[ { "from": "system", "value": "Add missing id attribute for Fee lines\n" }, { "from": "human", "value": "module WoocommerceAPI\n class FeeLine < Resource\n attribute :title\n attribute :taxable, Boolean\n attribute :tax_class\n attribute :total, Decimal\n attribute :total_tax, Dec...
ruby
chosen
[ { "from": "system", "value": "Add script & script type in mocks for advanced usage." }, { "from": "human", "value": "class CreateDuckrailsMocks < ActiveRecord::Migration\n def change\n create_table :mocks do |t|\n t.string :name, null: false\n t.text :description\n t.integer :...
ruby
chosen
[ { "from": "system", "value": "Fix podspec social media url\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"PhyreKit\"\n s.version = \"0.1.4\"\n s.summary = \"Common utilities for Phyre Inc.\"\n s.homepage = \"http://rallyapp.io\"\n ...
ruby
chosen
[ { "from": "system", "value": "Support Omniauth for single authentication \n - Signup doesn’t work with Omniauth\n\n[ref #80723326]" }, { "from": "human", "value": "module EhjobAuthentication\n class OmniauthCallbacksController < Devise::OmniauthCallbacksController\n def provider_callback\n ...
ruby
chosen
[ { "from": "system", "value": "Add route to create model via post\n\nSupport POST /{library}/{model} to create object" }, { "from": "human", "value": "Cenit::Application.routes.draw do\n mount RailsAdmin::Engine => '/data', as: 'rails_admin'\n\n root to: 'rails_admin/main#dashboard'\n # root ...
ruby
chosen
[ { "from": "system", "value": "Use header-item in classes for consistency\n" }, { "from": "human", "value": "module ActiveAdmin\n module Views\n class HeaderWithSubnav < Component\n\n def build(namespace, menu)\n super(id: \"header\")\n\n @namespace = namespace\n @me...
ruby
chosen
[ { "from": "system", "value": "Add raise! / enable! and lower! / enable! utility methods for boolean attributes\n" }, { "from": "human", "value": "module ActiveRecord\n module Properties\n module Extensions\n module Booleans\n def method_missing(*args, &block)\n method_na...
ruby
chosen
[ { "from": "system", "value": "Fix Member instance creation migration\n" }, { "from": "human", "value": "class CreateMemberInstancesForClubMembers < ActiveRecord::Migration\n # Temporary class used for migration\n class ClubMember < ActiveRecord::Base\n belongs_to :club\n end\n\n def up\n ...
ruby
chosen
[ { "from": "system", "value": "Allow the cuc steps to have variable names with spaces\n\nReplaces them with underscores before \"send\"ing it to the object\n" }, { "from": "human", "value": "DEFAULT_STARTING_SCORE = 10\nDEFAULT_STARTING_WORD = \"hangman\"\n\nGiven(/^I start a new game of hangman...
ruby
chosen
[ { "from": "system", "value": "Use OpenStruct to avoid MiniTest::Mock errors.\n" }, { "from": "human", "value": "# encoding: UTF-8\n\nrequire 'vines'\nrequire 'minitest/autorun'\n\nclass ClientSessionTest < MiniTest::Unit::TestCase\n def setup\n @stream = MiniTest::Mock.new\n @stream.expec...
ruby
chosen
[ { "from": "human", "value": "Increase limit size for trace field\n" }, { "from": "gpt", "value": "class IncreateTraceColunmLimit < ActiveRecord::Migration\n def up\n change_column :builds, :trace, :text, :limit => 4294967295\n end\n\n def down\n end\nend\n" } ]
ruby
chosen
[ { "from": "system", "value": "Remove a data migration that prints warnings on every run\n" }, { "from": "human", "value": "class RedirectCIPs\n def redirect_all\n about_us = ::CorporateInformationPageType::AboutUs\n\n about_pages = ::CorporateInformationPage\n .where(corporate_inform...
ruby
chosen