conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Put proper path in test\n" }, { "from": "human", "value": "RSpec.describe 'users/_user_show_html.erb' do\n let(:snpedia_paper) do\n double(:snpedia_paper, url: 'http://www.snpedia.com/index.php/Rs1234(A;C)',\n summary: 'Green hair',\n ...
ruby
chosen
[ { "from": "system", "value": "Update descriptions script to use new paths and use en as messgae fallback.\n" }, { "from": "human", "value": "require 'json'\r\nrequire 'clipboard'\r\n\r\nDir['src/_locales/*'].sort.each do |path|\r\n locale = File.basename(path)\r\n messages = JSON.parse(File.re...
ruby
chosen
[ { "from": "system", "value": "Fix connection info for new_connection\n" }, { "from": "human", "value": "class ActiveRecord::ConnectionAdapters::ConnectionPool\n def new_connection_with_retry\n Activerecord::Mysql::Reconnect.retryable(\n :proc => proc {\n new_connection_without_re...
ruby
chosen
[ { "from": "system", "value": "Add helper method to current_user.\n" }, { "from": "human", "value": "module Subengine\n\n# class ApplicationController < ActionController::Base\n\tclass ApplicationController < ::ApplicationController\n\n\t\tprotect_from_forgery with: :null_session\n\n\t\tdef after...
ruby
chosen
[ { "from": "system", "value": "Disable some checkers which are not useless for CI\n" }, { "from": "human", "value": "module MetricsSatellite\n class GuidelineCollector < Collector\n def collect\n system(\n \"guideline\",\n \"--no-unused-method\",\n \"--abc-complexity...
ruby
chosen
[ { "from": "system", "value": "Add a variable to ease code reading" }, { "from": "human", "value": "class Users::Dossiers::InvitesController < UsersController\n def authenticate_user!\n session[\"user_return_to\"] = request.fullpath\n\n if params[:email].present? && User.find_by(email: par...
ruby
chosen
[ { "from": "system", "value": "Complete test with exclusive/non exclusive queue\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'spec_helper'\n\ndescribe 'RubyRabbitmqJanus::RRJ' do\n describe '.response', type: :request, level: :base, name: :info do\n let(:type) {...
ruby
chosen
[ { "from": "system", "value": "Use Consul subcommand with client_addr, not bind_addr.\n" }, { "from": "human", "value": "require 'serverspec'\nset :backend, :exec\n\ndescribe command(\"consul members -rpc-addr=#{ENV['CONSUL_BIND_ADDR']}:8400\") do\n its(:stdout) { should match /#{ENV['CONSUL_BIN...
ruby
chosen
[ { "from": "system", "value": "Add rspec logout and invalid login tests\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe 'the login process', type: :feature do\n\n before(:each) do\n FactoryGirl.create(:ip_cache, ip_address: '1.2.3.4')\n end\n\n let!(:new_user) do\n ...
ruby
chosen
[ { "from": "system", "value": "Add missing parameter for shipment (nil)" }, { "from": "human", "value": "Spree::OrdersController.class_eval do\n append_after_filter :add_children, :only => :populate\n append_after_filter :update_children, :only => :update\n\n private\n\n def add_children\n ...
ruby
chosen
[ { "from": "system", "value": "Add spec for performing NotifierJob with incorrect prop id\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe NotifierJob, type: :job do\n include ActiveJob::TestHelper\n\n let(:notifier) { double }\n subject { described_class.perform_lat...
ruby
chosen
[ { "from": "system", "value": "Fix for new_cop rake task" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule RuboCop\n module Cop\n class Generator\n # A class that injects a require directive into the root RuboCop file.\n # It looks for other directives that re...
ruby
chosen
[ { "from": "human", "value": "Add task to remove orphaned associations\n\nThe associations between Guides and TopicSectionGuides was not previously marked as dependent.\n\nThis meant that when unpublished guides had their draft discarded, the topic_section_guide row remained but was associated with a Guide t...
ruby
chosen
[ { "from": "system", "value": "Add missing dependency for Beaker tests\n" }, { "from": "human", "value": "require 'beaker-rspec/helpers/serverspec'\nrequire 'beaker-rspec/spec_helper'\nrequire 'beaker/puppet_install_helper'\n\nrun_puppet_install_helper\n\nSUPPORTED_PLATFORMS = ['Debian'].freeze\n...
ruby
chosen
[ { "from": "system", "value": "Fix the special case of the first revision when showing a diff\n" }, { "from": "human", "value": "# encoding: utf-8\nmodule ContentHelper\n\n def spellcheck(html)\n HTML_Spellchecker.french.spellcheck(html).html_safe\n end\n\n def htmldiff(was, new)\n dmp =...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary default from mailer\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass ContactMailer < ActionMailer::Base\n default from: Rails.application.secrets.emails['default_from']\n\n def contact_form(email, message, request)\n ...
ruby
chosen
[ { "from": "human", "value": "Change user_id type for spree_user_authentications\n" }, { "from": "gpt", "value": "class ChangeUserIdTypeForSpreeUserAuthentications < ActiveRecord::Migration[4.2]\n def change\n change_column :spree_user_authentications, :user_id, :bigint\n end\nend\n" } ]
ruby
chosen
[ { "from": "system", "value": "Tweak caution title tests to reflect recent reversion to earlier prototype\n" }, { "from": "human", "value": "# On the search results page\nWhen(/^I click on the summary caution against first registration link$/) do\n find(\"strong.bold\", :text => 'Caution against...
ruby
chosen
[ { "from": "human", "value": "Create test for `Notfication` `Notification::Error` class\n" }, { "from": "gpt", "value": "require 'test_helper'\n\nclass NotificationTest < ActiveSupport::TestCase\n test 'Notification.new' do\n notification = Notification.new('title1', '<h1>body1</h1>', 'http:/...
ruby
chosen
[ { "from": "system", "value": "Update list of example apps\n" }, { "from": "human", "value": "require 'fileutils'\n\nmodule UpdateHelper\n def update_pods_in_tests_and_examples(params)\n # Updates to CocoaPods for unit tests and examples (requires\n # node_modules for each)\n %w[\n ...
ruby
chosen
[ { "from": "system", "value": "Write the command plus args to the console if it fails to execute.\n" }, { "from": "human", "value": "module SharedPassengerBehaviour\n include OSX\n \n def execute(command, *args)\n if OSX::SecurityHelper.sharedInstance.executeCommand_withArgs(command, args) ...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary method override in AMS format.\n" }, { "from": "human", "value": "require 'active_support/inflector'\nrequire 'ivy/serializers/formats/json'\n\nmodule Ivy\n module Serializers\n module Formats\n class ActiveModelSerializers < JSON\n ...
ruby
chosen
[ { "from": "system", "value": "Remove test for removed Child.spawn function\n" }, { "from": "human", "value": "require 'helper'\n\nclass TestCoreInitialization < Test::Unit::TestCase\n def test_spawn_with_file\n assert_nothing_raised { exp = Expectr.new(File.new(\"/bin/ls\"), flush_buffer: fa...
ruby
chosen
[ { "from": "human", "value": "Add spec for bin/pidgin2adium script; currently only tests output for HTML test log\n" }, { "from": "gpt", "value": "# Tests for bin/pidgin2adium\n\nrequire 'spec_helper'\n\ndescribe \"Pidgin2Adium_bin\" do\n before(:each) do\n @nonexistent_logfile_path = \"./non...
ruby
chosen
[ { "from": "human", "value": "Add (commented out) spec for new core type\n" }, { "from": "gpt", "value": "module Reality\n # Don't forget about: Time.now.utc_offset, Time.zone_info\n #describe TZOffset do\n #describe :initialize do\n #it 'can be created from number of minutes' do\n ...
ruby
chosen
[ { "from": "system", "value": "Remove text tmp fixtures after test run\n" }, { "from": "human", "value": "module FileFixtures\n def fixture_base(base = nil)\n self.fixture_base = base if base\n Thread.current[:fixture_base]\n end\n\n def fixture_base=(base)\n Thread.current[:fixture_b...
ruby
chosen
[ { "from": "system", "value": "Change old migration to 4326; not good form but we're resetting DB anyhow\n" }, { "from": "human", "value": "class CreateBikewaySegments < ActiveRecord::Migration\n def change\n create_table :bikeway_segments do |t|\n t.integer :city_rid\n t.integer :c...
ruby
chosen
[ { "from": "human", "value": "Fix phone number fields in DB\n" }, { "from": "gpt", "value": "class FixPhoneNumberFields < ActiveRecord::Migration\n def change\n Organization.all.each do |o|\n old_phone = o.phone\n new_phone = old_phone.gsub(/[^0-9]/, \"\")\n o.update(phone: new...
ruby
chosen
[ { "from": "system", "value": "Mark values as html_safe otherwise won't be shown on selector\n" }, { "from": "human", "value": "module Admin::Resources::DataTypes::TreeHelper\n\n def table_tree_field(attribute, item)\n item.parent ? item.parent.to_label : mdash\n end\n\n def typus_tree_fiel...
ruby
chosen
[ { "from": "system", "value": "Add html_safe on content_tags in helpers\n" }, { "from": "human", "value": "module ArchivesHelper\n def archive_action_link(archive)\n if archive.s3_url.present?\n download_button(archive)\n elsif archive.transactions_left_to_explain && archive.transacti...
ruby
chosen
[ { "from": "system", "value": "Add markdownlint rules to allow header duplication\n\nMarkdownlint requires each section headers to be different by default\nbut the Changelog needs to contain multiple sections with the same\nname, therefore enable `allow_different_nesting` to support this use\ncase.\n\nSigned...
ruby
chosen
[ { "from": "system", "value": "Isolate Elk configuration examples to make sure it is always reset.\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'elk'\n\ndescribe Elk do\n it 'should detect missing username and/or password' do\n expect { described_class.base_url }.to raise...
ruby
chosen
[ { "from": "system", "value": "Add helper method to jsonify reactjs data for a chat room\n" }, { "from": "human", "value": "class ChatRoom < ActiveRecord::Base\n validates_presence_of :invitee_id, :creator_id\n belongs_to :invitee, class_name: \"User\"\n belongs_to :creator, class_name: \"User...
ruby
chosen
[ { "from": "system", "value": "Update highline dependency to be 1.7.2 or greater.\n\nThis is because highland 1.7.2 fixes an issue where terminal_size was returning the rows and columns in the wrong order due to Ruby's IO::Console#winsize return value.\n" }, { "from": "human", "value": "# -*- enc...
ruby
chosen
[ { "from": "system", "value": "Fix CI for new centos8 + puppet6\n\nCurrently broken with:\n pacemaker::new::setup on centos-8-x86_64 with default parameters is expected to contain Class[pacemaker::new::setup::config]\n\n Failure/Error: it { is_expected.to contain_class('pacemaker::new::setup::config') }\n ...
ruby
chosen
[ { "from": "system", "value": "Add specs for :announcement_header_message setting\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'settings administration' do\n context 'when logged in as an admin' do\n let(:user) {build(:user, :admin)}\n before(:each) do\n RubyCA...
ruby
chosen
[ { "from": "system", "value": "Fix my oops; missing 'do' for the fails_on\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + '/../../spec_helper'\n\ndescribe \"IO#printf\" do\n before :each do\n @io = IO.new STDOUT.fileno\n end\n \nfails_on :jruby\n it \"writes the #sprint...
ruby
chosen
[ { "from": "system", "value": "Fix misplaced constraint finder line number\n" }, { "from": "human", "value": "module Dokumi\n module Tool\n class Xcode\n # Checks if a pull request contains XIB/Storyboard files which have misplaced constraints.\n class MisplacedConstraintFinder\n ...
ruby
chosen
[ { "from": "system", "value": "Update test to ensure a root password is set. IMAGE-459\n" }, { "from": "human", "value": "require 'spec_helper'\n\n# Ensure root password is set and password matches value in metadata\n# Need to somehow validate that it's not the same as livecd and that\n# it match...
ruby
chosen
[ { "from": "system", "value": "Update FC009 spec for newer Chef releases\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe \"FC009\" do\n context \"on chef 13.6.4 with a cookbook that new dsc_reso...
ruby
chosen
[ { "from": "system", "value": "Fix feed spec over-specific selector\n" }, { "from": "human", "value": "require 'acceptance_helper'\n\ndescribe \"factlink\", type: :feature do\n include ScreenshotTest\n include FeedHelper\n\n let(:user) { create :user }\n\n unless FactlinkUI.Kennisland?\n it ...
ruby
chosen
[ { "from": "human", "value": "Add front-end test for helloplaces\n" }, { "from": "gpt", "value": "require File.join(File.expand_path(File.dirname(__FILE__)), '../spec_helper.rb')\n\n#describe 'home page', :type => :request do\n\n#describe 'helloplaces' do\n# it 'allows people to view all scrolle...
ruby
chosen
[ { "from": "system", "value": "Add unit tests on Absorb.\n" }, { "from": "human", "value": "require_relative '../spec_helper'\n\ndescribe Absorb::Absorber do\nend\n" }, { "from": "gpt", "value": "require_relative '../spec_helper'\n\ndescribe Absorb::Absorber do\n\n describe \"files\"...
ruby
chosen
[ { "from": "system", "value": "Make sure hostname does not return \"none\"\n" }, { "from": "human", "value": "require 'spec_helper'\n\n# Ensure hostname is not carried over from live-cd build\ndescribe command('hostname') do\n it { should_not return_stdout 'debian-7' }\nend\n\ndescribe command('...
ruby
chosen
[ { "from": "system", "value": "Add class method for fetching latest SimpleDesktop\n" }, { "from": "human", "value": "require 'nokogiri'\nrequire 'desktop/http'\nrequire 'desktop/image'\n\nmodule Desktop\n class SimpleDesktops\n def latest_image\n @latest_image ||= Image.new(thumbnail.mat...
ruby
chosen
[ { "from": "system", "value": "Remove decimal zeros as spec not matching - should have no impact on query\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe ReminderMailOlderThanQuery do\n\n describe '#call' do\n it 'generates the expected sql' do\n Timecop.freeze(Time...
ruby
chosen
[ { "from": "system", "value": "Set the views/ dir explicitly it works when called as a gem from another project\n" }, { "from": "human", "value": "require 'sinatra/base'\n\nclass FlickrFakr < Sinatra::Base\n get '/' do\n 'Welcome to Flickr Fakr!'\n end\n\n get '/services/auth/' do\n redi...
ruby
chosen
[ { "from": "system", "value": "Move duplicated regex into constant\n" }, { "from": "human", "value": "module GitStatistics\n class Branches\n\n CURRENT_BRANCH = /\\A\\*\\s/\n\n def self.all\n list.collect { |branch| branch.sub(CURRENT_BRANCH, \"\") }\n end\n\n def self.current\n...
ruby
chosen
[ { "from": "system", "value": "Fix issue to ensure always using cached when we can\n" }, { "from": "human", "value": "require 'hubdown/style_scraper'\nrequire 'hubdown/style_cache'\nrequire 'pry'\n\nclass StyleGenerator\n def initialize uri\n @uri = uri\n @scraper = StyleScraper.new( @uri ...
ruby
chosen
[ { "from": "system", "value": "Use the highest DM we can.\n\nThis is in some ways less than ideal, but we want to let people continue\nto use 0.10.x if they have to. Obviously ideally people would upgrade\nto 1.x quickly.\n\nWhile this loose dep does have some risk, regarding DM 2.0, we only use\na very sma...
ruby
chosen
[ { "from": "human", "value": "Add yUML dependency graph inspired by @gozala." }, { "from": "gpt", "value": "module Modulr\n class DependencyGraph\n def initialize(js_modules)\n if js_modules.is_a?(Array)\n @js_modules = js_modules\n else\n @js_modules = [js_modules]\n ...
ruby
chosen
[ { "from": "system", "value": "refactor(Notifications): Refactor create method from notifications API\n\nRefactor create method from notifications API\n" }, { "from": "human", "value": "module Moip2\n class NotificationsApi\n attr_reader :client\n\n def initialize(client)\n @client = ...
ruby
chosen
[ { "from": "system", "value": "Use code formatting for Slack messages.\n" }, { "from": "human", "value": "require 'faraday'\nrequire 'json'\n\nOpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE\n\nmodule Nightwatch\n class SlackLogger\n def initialize(opts = {})\n @url = opts[:url]\n\...
ruby
chosen
[ { "from": "system", "value": "Add Faraday to gem spec because we will be using it for connecting to things.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'cardconnect/version'\n\nGe...
ruby
chosen
[ { "from": "system", "value": "Update test to reflect kitchen attributes.\n" }, { "from": "human", "value": "# Serverspec tests for rabbitmq sensu configuration\nrequire 'serverspec'\n\ninclude Serverspec::Helper::Exec\ninclude Serverspec::Helper::DetectOS\nRSpec.configure do |c|\n c.before :all...
ruby
chosen
[ { "from": "system", "value": "Remove security group rules commands.\n" }, { "from": "human", "value": "require 'hpcloud/ip_permissions'\nrequire 'hpcloud/commands/securitygroups/ippermissions/add'\nrequire 'hpcloud/commands/securitygroups/ippermissions/remove'\n\nmodule HP\n module Cloud\n c...
ruby
chosen
[ { "from": "system", "value": "Fix build by locking to aws-sdk v1\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'cloudformer/version'\n\nGem::Specification.new do |spec|\n spec.name...
ruby
chosen
[ { "from": "system", "value": "Reduce collection update calls for Kaminari extension\n" }, { "from": "human", "value": "module Kaminari\n module ActiveUMS\n module ActiveUMSExtension\n include Kaminari::ConfigurationMethods\n\n def self.included(base)\n base.define_singleton_...
ruby
chosen
[ { "from": "system", "value": "Set meaningful summary and description\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'grape_hal_integration/version'\n\nGem::Specification.new do |spec...
ruby
chosen
[ { "from": "system", "value": "Use `Formula.sha256` instead of `Formula.sha1`\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n#\n# Copyright 2014 Roy Liu\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n# use this file except in compliance with the ...
ruby
chosen
[ { "from": "system", "value": "Fix for PR 945745. Update switch style value for QFX device based on Junos software version to either VLAN_L2NG or VLAN" }, { "from": "human", "value": "Junos::Ez::Facts::Keeper.define( :switch_style ) do |ndev, facts|\r\n f_persona = uses :personality\r\n \r\n ...
ruby
chosen
[ { "from": "system", "value": "Make sure we run fine with iOS 5 SDK as well.\n" }, { "from": "human", "value": "class FlatPillButtonViewController < UITableViewController\n FlatButtonCellReuseID = \"FlatButtonCell\"\n\n def initWithStyle(style)\n super\n # self.tableView.registerClass(Fla...
ruby
chosen
[ { "from": "system", "value": "Tweak help formatting for rails generator\n" }, { "from": "human", "value": "require 'rbconfig'\n\n# This generator bootstraps a Rails project for use with Cucumber\nclass CucumberGenerator < Rails::Generator::Base\n DEFAULT_SHEBANG = File.join(Config::CONFIG['bind...
ruby
chosen
[ { "from": "human", "value": "Add NATO (NATO phonetic alphabet) script.\n" }, { "from": "gpt", "value": "\n#\n# Terminus-Bot: An IRC bot to solve all of the problems with IRC bots.\n# Copyright (C) 2011 Terminus-Bot Development Team\n#\n# This program is free software: you can redistribute it and...
ruby
chosen
[ { "from": "human", "value": "Add initial implementation of PIG ServiceManager.\n" }, { "from": "gpt", "value": "require 'timers'\n\nmodule SPF\n module Gateway\n\n class ServiceManager\n def initialize\n @services = {}\n @active_pipelines = {}\n @timers = Timers::Gr...
ruby
chosen
[ { "from": "system", "value": "Install unzip only on linux\n" }, { "from": "human", "value": "package 'unzip' unless platform?('windows')\n\ndirs = %w(config drivers server)\ndirs.push('bin', 'log') if platform?('windows')\n\ndirs.each do |dir|\n directory \"#{selenium_home}/#{dir}\" do\n re...
ruby
chosen
[ { "from": "system", "value": "Add task for running perf tests\n" }, { "from": "human", "value": "# encoding: utf-8\n\nbegin\n require 'rspec/core/rake_task'\n\n desc 'Run all specs'\n RSpec::Core::RakeTask.new(:spec) do |task|\n task.pattern = 'spec/{unit,integration}{,/*/**}/*_spec.rb'\n ...
ruby
chosen
[ { "from": "system", "value": ":bug: Fix not to install source han code jp fonts\n\nForget to add recipe to default\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n#\n# Cookbook Name:: devenv\n# Recipe:: default\n#\n# Copyright 2014, YOUR_COMPANY_NAME\n#\n# All rights reserved...
ruby
chosen
[ { "from": "system", "value": "Use deep merger for table options\n" }, { "from": "human", "value": "module ThousandIsland\n # The TableSettings class is where you set up styling rules that can be used by your Table class. You may create a class that inherits from TableSettings, and then use it i...
ruby
chosen
[ { "from": "system", "value": "Add function to collect samples\n" }, { "from": "human", "value": "require 'pp'\n\nrequire 'cpp_samples/version'\n\nmodule CppSamples\n\tSection = Struct.new(:path, :title)\n\n\tSAMPLES_DIR = './samples'\n\n\tdef self.generate\n\t\tpp build_samples_tree(SAMPLES_DIR)...
ruby
chosen
[ { "from": "human", "value": "Add spec for default gem executables\n" }, { "from": "gpt", "value": "require_relative '../../../spec_helper'\nrequire 'rubygems'\n\ndescribe \"Gem.bin_path\" do\n it \"finds executables of default gems, which are the only files shipped for default gems\" do\n # ...
ruby
chosen
[ { "from": "system", "value": "Add shell of update method\n" }, { "from": "human", "value": "module Poke\n # A Camera object provides a viewport to the game window. It allows a player\n # character to move in an area of greater size than the window and still let\n # the user see the movement o...
ruby
chosen
[ { "from": "system", "value": "Change event_callback to eliminate connection argument\n\ngit-svn-id: f3f86cdbd6861aa9839b323b12b6af648189b59b@63 ea6e6bc6-682b-4e20-bb59-304e6edd756d\n" }, { "from": "human", "value": "#--\n# Copyright (C)2007 Tony Arcieri\n# You can redistribute this under the ter...
ruby
chosen
[ { "from": "system", "value": "Fix some load path issues.\n" }, { "from": "human", "value": "require \"./lib/tiyo_hw/runners/base\"\nrequire \"./lib/tiyo_hw/runners/ruby\"\nrequire \"./lib/tiyo_hw/runners/javascript\"\n\nmodule TiyoHw\n class Run\n attr_reader :pwd\n def initialize(pwd)\n ...
ruby
chosen
[ { "from": "system", "value": "Move code from actions to Facade class\n\nActions are here just a simle wrappers around repository, no need to add this abstraction layer here.\n" }, { "from": "human", "value": "module RubyEventStore\n class Facade\n\n def initialize(repository)\n @reposit...
ruby
chosen
[ { "from": "human", "value": "Add template to generate list of versions used in the API docs.\n\n" }, { "from": "gpt", "value": "require 'fileutils'\nrequire 'set'\nrequire 'stringio'\n\ninclude Helpers::ModuleHelper\n\ndef init\n generate_changelog\nend\n\n\ndef all_objects\n run_verifier(Regi...
ruby
chosen
[ { "from": "human", "value": "Add reputation to exsisting people\n" }, { "from": "gpt", "value": "class AddReputationToPerson < ActiveRecord::Migration\n def self.up\n people = Person.all\n people.each do | person |\n ReputationRating.create(:person_id => person.id, :gift_actions => 0...
ruby
chosen
[ { "from": "system", "value": "Remove default string value from migration\n" }, { "from": "human", "value": "class AddExternalIdToAsset < ActiveRecord::Migration\n def change\n add_column :assets, :external_id, :string, :limit => 32, :default => nil, :after => :asset_tag\n end\nend\n" }, ...
ruby
chosen
[ { "from": "human", "value": "Destroy dependencies for superseded editions\n\nhttps://trello.com/c/ibAvwvH7\nhttps://trello.com/c/oYy2udbc\n\nedition's dependencies are extracted when it is published,\nand are destroyed when they're superseded. these 2 callbacks\nwere split across 2 PRs. there was a consider...
ruby
chosen
[ { "from": "system", "value": "Use ENV var for backups bucket\n" }, { "from": "human", "value": "# See: https://github.com/yob/db2fog\nDB2Fog.config = {\n :aws_access_key_id => Spree::Config[:s3_access_key],\n :aws_secret_access_key => Spree::Config[:s3_secret],\n :directory ...
ruby
chosen
[ { "from": "human", "value": "Add preliminary specs for the bunny publisher.\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Travis::Amqp::Publisher do\n let(:connection) {Travis::Amqp.connection}\n before do\n Travis::Amqp.config = {\n host: 'localhost'\n }\n c...
ruby
chosen
[ { "from": "system", "value": "Fix version replacement in homebrew generation\n" }, { "from": "human", "value": "require 'formula'\n\nclass Springboot < Formula\n\thomepage 'http://projects.spring.io/spring-boot/'\n\turl 'https://repo.spring.io/${repo}/org/springframework/boot/spring-boot-cli/${v...
ruby
chosen
[ { "from": "system", "value": "Create folders with a root default name\n" }, { "from": "human", "value": "require 'thor'\n\nmodule Cukestart\n module Generator\n class Structure < Thor::Group\n argument :project_name, :desc => \"Name of the root directory\", :default => \"teste_gem\"\n\n...
ruby
chosen
[ { "from": "system", "value": "Fix error with validate method\n" }, { "from": "human", "value": "require 'zip'\n\nmodule DataParse\n class ZipFile < FileType\n def extract_file\n raise 'Invalid Format' if !self.valid?\n Zip::File.open(@file) do |zip_file|\n zip_file.each do |...
ruby
chosen
[ { "from": "system", "value": "Update middleware registry for Faraday 0.9\n\nThe unified method `Faraday.register_middleware` for registering all\nkinds of middleware was gone in 0.9.\n\nhttps://github.com/lostisland/faraday/commit/14b458a9c971897f44d5ee3ba5354de52c998e72\n" }, { "from": "human", ...
ruby
chosen
[ { "from": "system", "value": "Set HTTP header Accept in requests\n\nThis is important, because some KOSapi resources (e.g. /semesters)\nsupports more content types.\n" }, { "from": "human", "value": "module KOSapiClient\n class RequestBuilder\n\n attr_reader :response\n\n def find(id)\n ...
ruby
chosen
[ { "from": "system", "value": "Add raw cron and update comment\n" }, { "from": "human", "value": "# frozen_string_literal: true\nenv :PATH, ENV['PATH']\n\n# Every minute, check for departure inaccuracies\nevery 60.seconds do\n rake 'bojangles:go'\nend\n\n# Every day, cache departure data.\nevery...
ruby
chosen
[ { "from": "system", "value": "Add bundle exec to whenever tasks\n" }, { "from": "human", "value": "set :output, File.join(Whenever.path, \"log\", \"cron.log\")\n\n# Fetch clubs and enrolled clubs every day\nevery 1.day, :at => '4:30 am' do\n runner \"User.daily_update\"\nend\n" }, { "fr...
ruby
chosen
[ { "from": "system", "value": "Fix calculation for previous week in week calendars\n" }, { "from": "human", "value": "module SimpleCalendar\n class WeekCalendar < Calendar\n def date_range\n @date_range ||= begin\n number_of_weeks = options.fetch(:number_of_weeks, ...
ruby
chosen
[ { "from": "system", "value": "Fix the bug to show the warning deprecated usage of the Code Climate Test Reporter when running tests.\n" }, { "from": "human", "value": "begin\n require \"codeclimate-test-reporter\"\n CodeClimate::TestReporter.start\nrescue LoadError => e\n $stderr.puts \"not r...
ruby
chosen
[ { "from": "system", "value": "Use newer API for ShortCircuit\n" }, { "from": "human", "value": "require_relative 'branch'\n\nmodule DeepCover\n class Node\n class ShortCircuit < Node\n include Branch\n has_children :first, :conditional\n has_tracker :conditional\n\n def b...
ruby
chosen
[ { "from": "system", "value": "CHANGE use SET for all values\n\nThis improves code, error and data handling\n" }, { "from": "human", "value": "require 'redis'\n\nmodule Featurer\n class RedisAdapter < Adapter\n def prepare\n @redis = ::Redis.new({\n host: @config[:host],\n ...
ruby
chosen
[ { "from": "system", "value": "Use prepend for FFI::Pointer monkey patching\n" }, { "from": "human", "value": "# frozen_string_literal: true\nmodule GirFFI\n module FFIExt\n # Extensions to FFI::Pointer\n module Pointer\n def to_ptr\n self\n end\n\n def zero?\n ...
ruby
chosen
[ { "from": "system", "value": "Return chart Tempfile, option for other image formats\n" }, { "from": "human", "value": "module LazyHighCharts\n class Render\n\n RENDER_OPTIONS = %w(scale width constr)\n\n class << self\n\n # Uses phantomjs to render the chart on the server and deliver...
ruby
chosen
[ { "from": "system", "value": "Add basic rake task for starting cms.\n" }, { "from": "human", "value": "namespace :wafflemix do\n\n # desc \"Explaining what the task does\"\n # task :wafflemix do\n # # Task goes here\n # end\n\n desc \"Create Initial Pages\"\n task :initial_pages do\n ...
ruby
chosen
[ { "from": "system", "value": "Add log message for each modified file\n" }, { "from": "human", "value": "# import some logic/helpers from lib/*.rb\ninclude NanoBox::Engine\ninclude NanoBox::Output\n\nlogtap.print(bullet(\"Running dev-prepare hook...\"), 'debug')\n\n# By this point, engine should ...
ruby
chosen
[ { "from": "system", "value": "Add more specs to check Set initialization\n" }, { "from": "human", "value": "require_relative '../../spec_helper'\nrequire 'set'\n\ndescribe \"Set#initialize\" do\n it \"is private\" do\n Set.should have_private_instance_method(:initialize)\n end\n\n it \"add...
ruby
chosen
[ { "from": "system", "value": "Fix the bug to show the message when running tests that SimpleCov failed to recognize the test framework and/or suite used.\n" }, { "from": "human", "value": "begin\n require 'simplecov'\n SimpleCov.start\nrescue LoadError => e\n $stderr.puts \"not recording test...
ruby
chosen
[ { "from": "system", "value": "Remove library item message tests for design changes.\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe \"Library item messages\" do\n let(:thread) { FactoryGirl.create(:message_thread) }\n let(:document) { FactoryGirl.create(:library_document...
ruby
chosen
[ { "from": "system", "value": "Remove image_file_name from picture factory\n\nDragonfly sets it to the image_file name anyway. Setting it to a staitc value even if the image_file might have another filename is not reflecting actual behavior.\n" }, { "from": "human", "value": "# frozen_string_lite...
ruby
chosen