conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Replace string literal with a frozen constant\n\nTo prevent new objects spawning.\n" }, { "from": "human", "value": "module Normalizers\n class Base\n extend Dry::Initializer\n\n param :entity\n param :options, default: proc { {} }\n\n def self.call(ent...
ruby
chosen
[ { "from": "system", "value": "Revert \"Obviously we should update last_fetched when nothing has changed\"\n\nThis reverts commit 25a603083cf613ace7bcb327bb4656ac113a8093.\n\nActually we do not want this. We should only update that timestamp to what we get back from the feed.\n" }, { "from": "human",...
ruby
chosen
[ { "from": "system", "value": "Check for MX and not directly the IP for SMTP\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n$:.unshift File.expand_path File.join File.dirname(__FILE__), '../lib'\nrequire 'rubygems'\nrequire 'bundler/setup'\nrequire 'cryptcheck'\n\nname = ARGV[0] || 'smtp...
ruby
chosen
[ { "from": "system", "value": "Use single quote 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 'amazon-drs/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Add amf socket url to gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/amf_socket/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Chad Remesch\"]\n gem.email = [\"chad@re...
ruby
chosen
[ { "from": "system", "value": "Fix autoload for Project, instead of Models\n" }, { "from": "human", "value": "__DIR__ = File.dirname(__FILE__)\nDir[\"#{__DIR__}/../vendor/**/lib\"].each { |dependency| $: << dependency }\n$: << \"#{__DIR__}/integrity\"\n\nrequire \"rubygems\"\nrequire 'dm-core'\nr...
ruby
chosen
[ { "from": "system", "value": "Reduce the code dependency to just the actors code\n" }, { "from": "human", "value": "require \"io_actors/version\"\n\nrequire 'concurrent'\n\nmodule IOActors\n SelectMessage = Struct.new(:actor)\n RegisterMessage = Struct.new(:io, :actor)\n DeregisterMessage = S...
ruby
chosen
[ { "from": "system", "value": "Make sure we load rets/version.rb\n" }, { "from": "human", "value": "require \"rets/exceptions\"\nrequire \"rets/client\"\nrequire \"rets/http\"\nrequire \"rets/stream_http\"\nrequire \"rets/base/core\"\nrequire \"rets/base/sax_search\"\n" }, { "from": "gpt"...
ruby
chosen
[ { "from": "system", "value": "Define module functions in class block\n" }, { "from": "human", "value": "# coding: utf-8\n\nrequire 'forwardable'\nrequire 'stoplight/data_store'\nrequire 'stoplight/data_store/base'\nrequire 'stoplight/data_store/memory'\nrequire 'stoplight/data_store/redis'\nrequ...
ruby
chosen
[ { "from": "system", "value": "Use vagrant mounting to install metal and metal-lxc from the host\n" }, { "from": "human", "value": "# Use a Linux image\nvagrant_box 'precise64' do\n url 'http://files.vagrantup.com/precise64.box' \nend\n" }, { "from": "gpt", "value": "# Use a Linux im...
ruby
chosen
[ { "from": "system", "value": "Increase version number to 0.1.7\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'Treasure'\n s.version = '0.1.6'\n s.summary = 'A small set of tools for deserializing JSON API objects.'\n\n s.description = <...
ruby
chosen
[ { "from": "system", "value": "Make method much simpler and readable\n" }, { "from": "human", "value": "module Everypolitician\n module Popolo\n class Collection\n include Enumerable\n\n attr_reader :documents\n\n def initialize(documents)\n @documents = documents ? docu...
ruby
chosen
[ { "from": "system", "value": "Remove Affixes from Form class\n" }, { "from": "human", "value": "# encoding: utf-8\n\nPAST_AFFIXES = { :I => \"ت\", :you_m => \"ت\", :you_f => \"ت\", :she => \"ت\" , :he =>'', :we => \"نا\", :you_pl => \"تم\", :they => \"وا\" }\nPRESENT_AFFIXES = { :I => [\"أ\", ''...
ruby
chosen
[ { "from": "system", "value": "Remove code that has been moved.\n" }, { "from": "human", "value": "module AutoSet\n module ActiveRecord\n extend ActiveSupport::Concern\n\n private\n\n def auto_set_parent_by_code(column, code)\n if self.send(code).present?\n reflection = self...
ruby
chosen
[ { "from": "system", "value": "Allow for additional info in an error message.\n\nThis gives us the ability to pass back a theme when receiving a password-required error.\n" }, { "from": "human", "value": "module Droplr\n class DroplrError < StandardError\n attr_reader :message, :error_code, :...
ruby
chosen
[ { "from": "system", "value": "Call load_seed on every request spec\n\n- this was causing an intermittent test failure\n" }, { "from": "human", "value": "require \"spec_helper\"\n\nmodule Refinery\n module <%= namespacing %>\n\n Refinery::<%= namespacing %>::Engine::load_seed\n\n describe ...
ruby
chosen
[ { "from": "system", "value": "Change config key base read into plugin\n" }, { "from": "human", "value": "module Hookie\n class BasePlugin\n def initialize(framework)\n @framework = framework\n\n @config = {}\n @framework.config.map do |k,v|\n if k.start_with?(\"hooks.#{...
ruby
chosen
[ { "from": "human", "value": "Add a stub past tense class. Needs conjugation rules, but will ensure we pass some of the failing tenses (for tense lists, etc.)\n" }, { "from": "gpt", "value": "# encoding: UTF-8\n\nclass NorskPastTense < NorskTense\n @keys = \"past\", \"fortid\"\n\n def self.spec...
ruby
chosen
[ { "from": "system", "value": "Rewrite some mustache-specific code to make contextual includes work\n" }, { "from": "human", "value": "module Modular\n module MstRendering\n def render\n path = Rails.root + \"app/views/components/#{type}.mst\"\n template = File.open(path, \"rb\").re...
ruby
chosen
[ { "from": "system", "value": "Remove unused method (this is done in setter in accommodation.rb)\n" }, { "from": "human", "value": "require 'quick_travel/adapter'\nrequire 'quick_travel/bed_requirement'\nrequire 'quick_travel/passenger_price_break'\nrequire 'quick_travel/product_type'\n\nmodule Q...
ruby
chosen
[ { "from": "system", "value": "Fix relative path when used in other apps\n" }, { "from": "human", "value": "require './lib/rembrandt/engines/pygmentize'\n\nmodule Rembrandt\n class Highlighter\n attr_reader :engine\n\n def initialize(input_engine = nil)\n @engine = (input_engine || de...
ruby
chosen
[ { "from": "system", "value": "Allow wider range of FFI dependency \n\nThe latest version of FFI for ruby 1.8.3 series is 1.9.6 (tests still pass using this newer FFI version).. This doesn't change anything for existing installs but will allow wider compatibility." }, { "from": "human", "value":...
ruby
chosen
[ { "from": "system", "value": "Return html data and charset as hash\n" }, { "from": "human", "value": "require 'thor'\nrequire 'fileutils'\nrequire 'upstream/tracker'\n\nmodule Upstream\n module Tracker\n class Init < Thor\n\n include Upstream::Tracker::Helper\n\n desc \"config\", \...
ruby
chosen
[ { "from": "system", "value": "Add config to item diff model\n" }, { "from": "human", "value": "# @see https://developers.podio.com/doc/items\nclass Podio::ItemDiff < ActivePodio::Base\n property :field_id, :integer\n property :type, :string\n property :external_id, :string\n property :label,...
ruby
chosen
[ { "from": "system", "value": "Break apart specs for different types of IO objects\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe NIO::Selector do\n it \"monitors IO objects\" do\n pipe, _ = IO.pipe\n\n monitor = subject.register(pipe, :r)\n monitor.should be_a NIO...
ruby
chosen
[ { "from": "system", "value": "Adjust radius for near method\n" }, { "from": "human", "value": "class Stop\n include Mongoid::Document\n\n field :route_id, type: Integer\n field :route_short, type: String\n field :route_long, type: String\n field :trip_id, type: Integer\n field :stop_id, ty...
ruby
chosen
[ { "from": "system", "value": "Rename association names to make it more clear\n" }, { "from": "human", "value": "class User < ActiveRecord::Base\n validates :nusnet_id, presence: true, uniqueness: true, format: { with: /\\A(A\\d{7}|U\\d{6,7})\\z/i }\n validates :name, presence: true\n validate...
ruby
chosen
[ { "from": "system", "value": "Add rate limiter for translation.\n" }, { "from": "human", "value": "# name: discourse-translator\n# about: Provides inline translation of posts.\n# version: 0.0.1\n# authors: Alan Tan\n# url: https://github.com/tgxworld/discourse-translator\n\nenabled_site_setting ...
ruby
chosen
[ { "from": "system", "value": "Use constant to pull in files.\n" }, { "from": "human", "value": "\nrequire File.join(File.dirname(__FILE__), *%w{ .. lib geos_extensions })\nrequire File.join(File.dirname(__FILE__), *%w{ .. lib active_record_extensions connection_adapters postgresql_adapter })\nre...
ruby
chosen
[ { "from": "system", "value": "Test passing printer class name.\n" }, { "from": "human", "value": "# encoding: utf-8\n\nRSpec.describe TTY::Command do\n it \"fails to find printer based on name\" do\n expect {\n TTY::Command.new(printer: :unknown)\n }.to raise_error(ArgumentError, /Un...
ruby
chosen
[ { "from": "system", "value": "Fix `warning: ambiguous first argument`\n\n```\ntest/cases/adapters/postgresql/case_insensitive_test.rb:12: warning: ambiguous first argument; put parentheses or a space even after `/' operator\ntest/cases/adapters/postgresql/case_insensitive_test.rb:16: warning: ambiguous firs...
ruby
chosen
[ { "from": "human", "value": "Add tests for security group rules.\n" }, { "from": "gpt", "value": "Shindo.tests('Fog::Compute[:hp] | security group requests', ['hp']) do\n\n @security_group_rule_format = {\n 'from_port' => Integer,\n 'group' => Fog::Nullable::Hash,\n 'ip...
ruby
chosen
[ { "from": "system", "value": "Add cgimap PPA repo on backends.\n" }, { "from": "human", "value": "name \"web-backend\"\ndescription \"Role applied to all web/api backend servers\"\n\ndefault_attributes(\n :apache => {\n :mpm => \"worker\",\n :worker => {\n :max_requests_per_child => ...
ruby
chosen
[ { "from": "system", "value": "Add coverage to guide testing\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'mtif/version'\n\nGem::Specification.new do |spec|\n spec.name = ...
ruby
chosen
[ { "from": "system", "value": "Allow an usubscribed user to resubscribe\n" }, { "from": "human", "value": "require_dependency \"storytime/application_controller\"\n\nmodule Storytime\n class SubscriptionsController < ApplicationController\n before_action :set_subscription, only: [:destroy]\n\...
ruby
chosen
[ { "from": "system", "value": "Fix missing single_quad for container services\n" }, { "from": "human", "value": "class ContainerServiceDecorator < MiqDecorator\n def self.fonticon\n 'pficon pficon-service'\n end\n\n def single_quad\n {\n :fileicon => fileicon\n }\n end\nend\n" ...
ruby
chosen
[ { "from": "system", "value": "Add 'I am admin' & 'I am logged in as admin' steps.\n" }, { "from": "human", "value": "Given /^I am registered$/ do\n @registered_user = Factory(:user, :email => \"john@doe.com\")\nend\n" }, { "from": "gpt", "value": "Given /^I am registered$/ do\n @re...
ruby
chosen
[ { "from": "system", "value": "Add up and close methods\n" }, { "from": "human", "value": "class Pi\n class Pin\n attr:@pin_num\n def initialize(num, mode =\"in\")\n @pin_num = num\n File.open(\"/sys/class/gpio/export\",\"w\"){|f|\n f.write(\"#{@pin_num}\")\n }\n\n ...
ruby
chosen
[ { "from": "system", "value": "Clarify the form answer attachment policy\n" }, { "from": "human", "value": "class FormAnswerAttachmentPolicy < ApplicationPolicy\n # TODO: needs clarification\n\n def create?\n true\n end\n\n def show?\n true\n end\n\n def destroy?\n admin? && record...
ruby
chosen
[ { "from": "human", "value": "Add uploader for campaign hero images\n" }, { "from": "gpt", "value": "class CampaignHeroImageUploader < CarrierWave::Uploader::Base\n\n include CarrierWave::MiniMagick\n\n DISPLAY_WIDTH = 1440\n DISPLAY_HEIGHT = 488\n\n def store_dir\n \"files/#{model.class.t...
ruby
chosen
[ { "from": "system", "value": "Make window visible during tests\n\nSome functional tests don't work without it" }, { "from": "human", "value": "class TestSuiteDelegate\n attr_accessor :window\n\n def application(application, didFinishLaunchingWithOptions:launchOptions)\n @window = UIWindow.a...
ruby
chosen
[ { "from": "human", "value": "Add in a minimalistic gemspec\n" }, { "from": "gpt", "value": "require File.expand_path(File.dirname(__FILE__) + '/lib/buildr/jaxb_xjc/version')\n\nGem::Specification.new do |spec|\n spec.name = 'buildr-jaxb-xjc'\n spec.version = Buildr::JaxbXjc::V...
ruby
chosen
[ { "from": "system", "value": "Add some tests for ShellCommand.run!(…).\n" }, { "from": "human", "value": "context ShellCommand do\n\n context 'run' do\n it 'must successfully execute \"echo\".' do\n command = ShellCommand.run \"echo -n Hi!\"\n command.success?.must_equal(true)\n ...
ruby
chosen
[ { "from": "system", "value": "Use specinfra and serverspec ~> 2.1.0.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'itamae/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Change datables based on ENV\n" }, { "from": "human", "value": "require 'mongoid'\n\nMongoid.configure do |config|\n name = \"dummy_development\"\n host = \"localhost\"\n config.master = Mongo::Connection.new.db(name)\nend" }, { "from": "gpt", "...
ruby
chosen
[ { "from": "system", "value": "Simplify a couple of inspect_source invocations in specs\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'spec_helper'\n\ndescribe Rubocop::Cop::Lint::ElseLayout do\n subject(:cop) { described_class.new }\n\n it 'registers an offence for expr on sa...
ruby
chosen
[ { "from": "system", "value": "Abort if RVM is found\n" }, { "from": "human", "value": "require \"boxen/preflight\"\n\nclass Boxen::Preflight::RVM < Boxen::Preflight\n def run\n warn \"You have an rvm installed in ~/.rvm.\",\n \"The Setup uses rbenv to install ruby, so consider `rvm impl...
ruby
chosen
[ { "from": "human", "value": "Add code wars (7) time converter\n" }, { "from": "gpt", "value": "# http://www.codewars.com/kata/56b8b0ae1d36bb86b2000eaa/\n# --- iteration 1 ---\ndef convert(time)\n time.strftime(\"%H:%M:%S,%L\")\nend\n" } ]
ruby
chosen
[ { "from": "system", "value": "Set license in gemspec to MIT" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"tablebuilder/version\"\n\nGem::Specification.new do |s|\n s.name = \"tablebuilder\"\n s.version = Tablebu...
ruby
chosen
[ { "from": "system", "value": "Configure my app to serve static css and image files\n" }, { "from": "human", "value": "require 'tic_tac_toe'\n\nrun TicTacToe::RackShell.new_shell\n" }, { "from": "gpt", "value": "require 'tic_tac_toe'\n\nuse Rack::Static, :urls => [\"/css\", \"/images\...
ruby
chosen
[ { "from": "system", "value": "Add instance variable for firstplayer\n" }, { "from": "human", "value": "$: << File.dirname(__FILE__)\n\nclass ConsoleGameEngine\n\n attr_reader :gametype, :rules, :comp_player, :ui\n\n def initialize(args)\n @gametype = args.fetch(:gametype, nil)\n @rules =...
ruby
chosen
[ { "from": "system", "value": "Remove String from Gemspec version\n" }, { "from": "human", "value": "# Encoding: UTF-8\n\nGem::Specification.new do |s|\n s.platform = Gem::Platform::RUBY\n s.name = 'refinerycms-testimonials'\n s.version = '2.0.1 MySQL'\n s.desc...
ruby
chosen
[ { "from": "system", "value": "Set null:false for the timestamps column to prevent Rails warning\n" }, { "from": "human", "value": "class CreateAdministrators < ActiveRecord::Migration\n def change\n\n create_table :administrators, force:true do |t|\n\n t.timestamps\n\n # The email ...
ruby
chosen
[ { "from": "system", "value": "Add nokogiri to gem dependency\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'konjak/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Update the gemspec to match the latest Bundler template\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Allow early-terminating run to flush buffer before terminating.\n\nWithout this, we would get a broken pipe.\n" }, { "from": "human", "value": "require 'json'\nrequire 'json-schema'\nrequire 'turbot_runner'\n\n# Flush output immediately\nSTDOUT.sync = true\nSTDERR.s...
ruby
chosen
[ { "from": "system", "value": "Set default reason in arglist, previously counted as ControlParameter\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'promise/version'\n\nrequire 'promise/callback'\nrequire 'promise/progress'\n\nclass Promise\n Error = Class.new(RuntimeError)\n\n ...
ruby
chosen
[ { "from": "system", "value": "Fix the error message reported by Airbrake:\n\nError Message:\nNoMethodError: undefined method `downcase' for nil:NilClass\nWhere:\nsubmitted_content#edit\n[PROJECT_ROOT]/app/helpers/access_helper.rb, line 10\n" }, { "from": "human", "value": "module AccessHelper\r\...
ruby
chosen
[ { "from": "system", "value": "Add a monkey patch to deal wth the current version of actire resource xml parsing lib\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + '/basecamp/basecamp.rb'\n\n%w{ basecamp ticket project comment }.each do |f|\n require File.dirname(__FILE__) +...
ruby
chosen
[ { "from": "system", "value": "Remove a rubocop:disable comment that was a workaround for a bug that is now fixed\n" }, { "from": "human", "value": "namespace :osm_rubocop do\n desc 'Install a pre-commit hook that ensures the code adheres to the OSM Rubocop configuration'\n task :install_precom...
ruby
chosen
[ { "from": "system", "value": "Use constants for possible body types." }, { "from": "human", "value": "class Duckrails::Mock < ActiveRecord::Base\n has_many :headers\n has_one :body\n\n validates :status, presence: true\n validates :method, presence: true\n validates :route_path, presence: t...
ruby
chosen
[ { "from": "system", "value": "Revert \"fix code accessing Travis.config.metrics\"\n\nThis reverts commit 35ce47154089c9ad71809a4fabad1e4e13fb6bf8.\n" }, { "from": "human", "value": "require 'active_support/core_ext/hash/reverse_merge'\n\nmodule Travis\n module Notification\n require 'travis/...
ruby
chosen
[ { "from": "system", "value": "Use string for command instead of symbol\n" }, { "from": "human", "value": "begin\n require 'vagrant'\nrescue LoadError\n raise 'vagrant-list should be used from within vagrant.'\nend\n\n# Ensure that the gem is not trying to be used from within a vagrant release\...
ruby
chosen
[ { "from": "system", "value": "Comment where to put migration code in the template\n" }, { "from": "human", "value": "class <%= migration_class_name %> < ActiveRecord::Migration\n def self.up\n end\n\n def self.down\n raise ActiveRecord::IrreversibleMigration\n end\nend\n" }, { "fr...
ruby
chosen
[ { "from": "system", "value": "Update Docker to 1.10.3 and Docker Compose to 1.6.2\n" }, { "from": "human", "value": "default['travis_docker']['version'] = '1.9.1-0~trusty'\ndefault['travis_docker']['users'] = %w(travis)\ndefault['travis_docker']['compose']['url'] = 'https://github.com/docker/com...
ruby
chosen
[ { "from": "system", "value": "Remove \"require 'spec'\" for rspec 2 compatability.\n" }, { "from": "human", "value": "def is_ruby_19?\n RUBY_VERSION == '1.9.1' or RUBY_VERSION == '1.9.2'\nend\n\nEncoding.default_internal = Encoding.default_external = \"ASCII-8BIT\" if is_ruby_19?\n\nrequire 'ru...
ruby
chosen
[ { "from": "system", "value": "Add columns to sentence tables\n" }, { "from": "human", "value": "class CreateSentences < ActiveRecord::Migration\n def change\n create_table :sentences do |t|\n t.references :ontology_version, :null => false\n t.string :name, :null => false\n t.t...
ruby
chosen
[ { "from": "system", "value": "Create bucket for images on cloud provider side\n\nThe newer boxgrinder uses euca2ools instead of ec2-ami-tools to build and upload\nec2 images. Ec2-ami-tools used to automatically create a amazon s3 bucket where\nimages are uploaded, euca2ools doesn't. In future boxgrinder sho...
ruby
chosen
[ { "from": "human", "value": "Add code wars (7) left and right\n" }, { "from": "gpt", "value": "# http://www.codewars.com/kata/left$-and-right$/\n# --- iteration 1 ---\ndef left(str, i = nil)\n if i.nil?\n return str[0]\n elsif i.is_a?(String)\n return str.split(i).first\n elsif i > 0\n ...
ruby
chosen
[ { "from": "system", "value": "Add say_with_time for benchmarking conversion of options to columns\n" }, { "from": "human", "value": "class ConvertShowRefreshButtonAndLoadValuesOnInitToRealColumnsForDialogFields < ActiveRecord::Migration\n class DialogField < ActiveRecord::Base\n serialize :o...
ruby
chosen
[ { "from": "system", "value": "Update dependencies to work with Blacklight ~>3.2" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"blacklight/hierarchy/version\"\n\n# Describe your gem and declare its dependencies:\nGem::S...
ruby
chosen
[ { "from": "system", "value": "Update capital projects table view spec to fix broken test.\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe \"capital_projects/_index_table.html.haml\", :type => :view do\n it 'list' do\n allow(controller).to receive(:current_user).and_retu...
ruby
chosen
[ { "from": "system", "value": "Improve MaciASL.app version check for Mac OS X Lion\n" }, { "from": "human", "value": "cask :v1 => 'maciasl' do\n version '1.4'\n sha256 '24c0dbaa9a13231b8c8e364ef0e6d60656718320ce69d8bb23aa5bc27e82e87d'\n\n url \"http://downloads.sourceforge.net/sourceforge/maci...
ruby
chosen
[ { "from": "system", "value": "Use eq instead of should_be, fix expected value\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'homepage upload', :type => :feature do\n before(:each) do\n @registered_user = Invite.create(:description => 'even')\n .users\n .creat...
ruby
chosen
[ { "from": "system", "value": "Change page caching to HTTP caching for Heroku\n" }, { "from": "human", "value": "class NamedRoutesController < ActionController::Base\n caches_page :generate\n\n self.view_paths = File.join(File.dirname(__FILE__), '../views/named_routes')\n layout nil\n\n def g...
ruby
chosen
[ { "from": "system", "value": "Use en as the source locale (instead of en-US)\n" }, { "from": "human", "value": "require File.expand_path(File.dirname(__FILE__) + '/spec_helper')\n\nDir.glob('locales/*.yml').each do |locale_file|\n describe 'a locale file' do\n it_behaves_like 'a valid locale...
ruby
chosen
[ { "from": "system", "value": "Reduce upper Faraday bounds to <= 0.9.0" }, { "from": "human", "value": "#!/usr/bin/env gem build\n# -*- encoding: utf-8 -*-\nrequire \"base64\"\nrequire File.expand_path('../lib/balanced/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = ...
ruby
chosen
[ { "from": "system", "value": "Add methods to gateway to support importing transactions\n" }, { "from": "human", "value": "require 'sequel'\nclass SqliteGateway\n include Finances\n\n def initialize(url)\n @db = Sequel.connect(url)\n end\n\n def categories\n @db[:categories].map do |r|\...
ruby
chosen
[ { "from": "system", "value": "Configure System Test drivers with `driven_by`\n\nAccording to the documentation from [`rspec-rails`][rspec-rails]:\n\n> RSpec **does not** use your `ApplicationSystemTestCase` helper.\n> Instead it uses the default `driven_by(:selenium)` from Rails. If you\n> want to override ...
ruby
chosen
[ { "from": "system", "value": "Change order to fix failing tests" }, { "from": "human", "value": "require 'sequel'\n\nrequire 'ghtorrent/migrations/mysql_defaults'\n\n\nSequel.migration do\n\n up do\n puts 'Adding column updated_at to table projects'\n\n if defined?(Sequel::SQLite)\n ...
ruby
chosen
[ { "from": "system", "value": "Fix bug report spec to not print stuff on jruby\n\nAnd an associated warning: the `out:` argument to `system` is\nunsupported there.\n" }, { "from": "human", "value": "require 'spec_helper'\n\nRSpec.describe 'bug_report_templates' do\n subject do\n Bundler.with_...
ruby
chosen
[ { "from": "system", "value": "Make Article factory use fake hacker-speak\n\nWay better than Lorem and will help me detect if full-text search on\ncontent works properly because these are actual English word and not\nfake latin.\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory ...
ruby
chosen
[ { "from": "system", "value": "Fix non-deterministic code in spec\n" }, { "from": "human", "value": "# coding: utf-8\n\n\nclass Team < ActiveRecord::Base\n attr_accessible :name, :division_id, :logo_url, :manager, :ballpark, :mascot, :founded, :wins, :losses, :win_percentage, :revenue, :color, :...
ruby
chosen
[ { "from": "system", "value": "Update pretty print to test docstring\n" }, { "from": "human", "value": "require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')\nrequire 'pp'\nrequire 'stringio'\n\ninclude YARD::Parser::Ruby\n\nif RUBY19\n describe YARD::Parser::Ruby::AstNode do\n ...
ruby
chosen
[ { "from": "system", "value": "Change to ensure order does not matter\n" }, { "from": "human", "value": "# encoding: utf-8\n\nRSpec.describe TTY::Spinner::Multi, '#auto_spin' do\n let(:output) { StringIO.new('', 'w+') }\n\n it \"auto spins top level spinner\" do\n spinners = TTY::Spinner::Mu...
ruby
chosen
[ { "from": "system", "value": "Add license info to gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path(\"../lib\", __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire \"climate_control/version\"\n\nGem::Specification.new do |gem|\n ...
ruby
chosen
[ { "from": "system", "value": "Add sha1 for the source.\n" }, { "from": "human", "value": "Pod::Spec.new do |spec|\n spec.name = 'Lokaligo'\n spec.version = '1.0.0'\n spec.license = { :type => 'Commercial', :text => \"See https://lokaligo.com/terms\" }\n spec.hom...
ruby
chosen
[ { "from": "system", "value": "Make measure_help? method return a boolean\n\nThe `:measure_help` symbol is not used anywhere and the method is always used as\nif it was returning a boolean.\n" }, { "from": "human", "value": "module SmartAnswer::Calculators\n class EnergyGrantsCalculator\n inc...
ruby
chosen
[ { "from": "system", "value": "Update KeePassX to latest version\n\nСhangelog: https://www.keepassx.org/news/2014/04/433" }, { "from": "human", "value": "class Keepassx < Cask\n url 'https://www.keepassx.org/dev/attachments/download/59/KeePassX-2.0-alpha5.dmg'\n homepage 'http://www.keepassx.or...
ruby
chosen
[ { "from": "system", "value": "Fix homepage to use SSL in ownCloud 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 => 'owncloud' do\n version '1.8.1.2335'\n s...
ruby
chosen
[ { "from": "system", "value": "Add note about translation removals to upgrader\n" }, { "from": "human", "value": "require_relative 'tasks/harden_acts_as_taggable_on_migrations'\n\nmodule Alchemy\n class Upgrader::FourPointOne < Upgrader\n class << self\n def harden_acts_as_taggable_on_mi...
ruby
chosen
[ { "from": "system", "value": "Fix tiny rubocop violation in test using unless for negative condition\n" }, { "from": "human", "value": "require 'bundler/setup'\nrequire 'fakefs/safe'\nrequire 'maxitest/autorun'\n\nmodule Minitest\n class Test\n # Minitest::Test#diff needs to write to the fil...
ruby
chosen
[ { "from": "system", "value": "Enable again Code Climate test reporter\n" }, { "from": "human", "value": "ENV[\"RAILS_ENV\"] = \"test\"\n\nrequire File.expand_path(\"../dummy/config/environment.rb\", __FILE__)\nrequire \"codeclimate-test-reporter\"\n#CodeClimate::TestReporter.start\n\nrequire \"...
ruby
chosen
[ { "from": "system", "value": "Revert \"don't use tmpdir to get a temp location for blueprint testing\"\n\nThis reverts commit 332f5eea1e673945ab699535aa558343009da52d.\n" }, { "from": "human", "value": "ENV['RAILS_ENV'] ||= 'test'\n\n# Set the working dir to a temp location\nrequire 'fileutils'\...
ruby
chosen
[ { "from": "system", "value": "Set VCR to record once\n" }, { "from": "human", "value": "$:.unshift File.join( File.dirname(__FILE__), \"..\", \"..\", \"lib\")\n\nrequire 'simplecov'\nrequire 'simplecov-rcov'\nSimpleCov.formatter = SimpleCov::Formatter::RcovFormatter\nSimpleCov.start 'rails'\n\nr...
ruby
chosen
[ { "from": "system", "value": "Comment out line where data is added to colocated charter csv - not needed anymore since CSV has already been created\n" }, { "from": "human", "value": "def create_colocated_schools_ary(schools_hsh)\n\tcolocated_addresses_w_charter = []\n\tcharters_colocation = open...
ruby
chosen
[ { "from": "system", "value": "Remove allowed_push_host from the gemspec\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'fail_to_ban/version'\n\nGem::Specification.new do |spec|\n sp...
ruby
chosen
[ { "from": "system", "value": "Add tag for and_more for entries presenter\n" }, { "from": "human", "value": "module Adminable\n class EntriesPresenter < BasePresenter\n ENTRIES_LIMIT = 5\n\n include Enumerable\n extend Forwardable\n\n def_delegators :@collection, :each, :first, :last...
ruby
chosen
[ { "from": "system", "value": "Make sure to include libstc++-6\n" }, { "from": "human", "value": "name \"ruby-windows-system-libraries\"\n\ndefault_version \"0.0.1\"\n\nlicense :project_license\nskip_transitive_dependency_licensing true\n\ndependency \"ruby\"\n\nbuild do\n if windows?\n # Nee...
ruby
chosen
[ { "from": "system", "value": "Update VERSION to match latest friendly_id release\n\nSigned-off-by: Alex Coles <60c6d277a8bd81de7fdde19201bf9c58a3df08f4@alexcolesportfolio.com>\n" }, { "from": "human", "value": "module FriendlyId\n module DataMapperAdapter\n module Version\n MAJOR = 3\n...
ruby
chosen