conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Change a method to extract the reserved1 value.\n\nUse get_uint24 instead of get_byte(3) to improve handling.\n" }, { "from": "human", "value": "# coding: utf-8\n# vim: set expandtab tabstop=2 shiftwidth=2 softtabstop=2 autoindent:\n\nclass BMFF::Box::CompactSampleS...
ruby
chosen
[ { "from": "human", "value": "Update dataset_user_id primary key to bigint\n" }, { "from": "gpt", "value": "class ChangeDatasetUserIdToBigint < ActiveRecord::Migration[6.0]\n def up\n change_column :dataset_users, :id, :bigint\n end\n\n def down\n change_column :dataset_users, :id, :inte...
ruby
chosen
[ { "from": "system", "value": "[ec2] Fix reference to instance_id that should be server_id in Addresses\n" }, { "from": "human", "value": "require 'fog/collection'\nrequire 'fog/aws/models/ec2/address'\n\nmodule Fog\n module AWS\n module EC2\n\n class Mock\n def addresses(attribut...
ruby
chosen
[ { "from": "system", "value": "[AWS|Glacier] Add notification configuration to model\n" }, { "from": "human", "value": "require 'fog/core/model'\nrequire 'fog/aws/models/glacier/archives'\nrequire 'fog/aws/models/glacier/jobs'\n\nmodule Fog\n module AWS\n class Glacier\n\n class Vault < ...
ruby
chosen
[ { "from": "system", "value": "Change default log level from info to warn\n" }, { "from": "human", "value": "require \"logger\"\n\nmodule RSpec\n module Parallel\n # Stores runtime configuration information.\n #\n # @!attribute concurrency\n # @return [Integer]\n class Configura...
ruby
chosen
[ { "from": "system", "value": "Use RequestConcern's implementation of scopes\n" }, { "from": "human", "value": "require 'doorkeeper/oauth/client_credentials/creator'\nrequire 'doorkeeper/oauth/client_credentials/issuer'\nrequire 'doorkeeper/oauth/client_credentials/validation'\n\nmodule Doorkeepe...
ruby
chosen
[ { "from": "system", "value": "Fix html escaping of teacher notes\n" }, { "from": "human", "value": "#\n# Methods for Objects which have teacher and or author notes...\n#\nmodule Noteable \n\n def teacher_note\n return teacher_notes[0]\n end\n \n def teacher_note=(note)\n teacher_note...
ruby
chosen
[ { "from": "system", "value": "Include all post javascript in the initializers\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\n# Version of your assets, change this if you want to expire all your assets.\nRails.application.config.assets.version = ...
ruby
chosen
[ { "from": "system", "value": "Set Rails to use the real Stripe api keys on production\n" }, { "from": "human", "value": "Rails.configuration.stripe = {\n :publishable_key => ENV['STRIPE_TEST_PUBLISHABLE_KEY'],\n :secret_key => ENV['STRIPE_TEST_SECRET_KEY']\n}\n\nStripe.api_key = Rails.con...
ruby
chosen
[ { "from": "system", "value": "Fix offset and pass the test\n" }, { "from": "human", "value": "module Hijri\n class DateTime < Date\n \n attr_reader :hour, :minute, :second, :offset, :zone\n\n alias :min :minute\n alias :sec :second\n \n\n def initialize(year=1, month=1, day=1,...
ruby
chosen
[ { "from": "system", "value": "Add link to attachment creator\n" }, { "from": "human", "value": "class AttachmentType < ActiveRecord::Base\n\n #attr_accessible :name, :description, :active\n \n # default scope\n default_scope { where(:active => true) }\n \nend\n\n" }, { "from":...
ruby
chosen
[ { "from": "system", "value": "Add missing schema annotations to ProgressReport\n" }, { "from": "human", "value": "# Concrete task type that handles progress report submissions.\n# See {Task} for more information on tasks.\n#\n# @author Brendan MacDonell\nclass ProgressReport < ActiveRecord::Base...
ruby
chosen
[ { "from": "system", "value": "Update ARM gcc to `4.9-2015-q2-update`.\n\nUpdate the offical ARM gcc distribution on Launchpad to the 2015Q2\nversion.\n" }, { "from": "human", "value": "require 'formula'\n\nclass ArmNoneEabiGcc < Formula\n\n homepage 'https://launchpad.net/gcc-arm-embedded'\n v...
ruby
chosen
[ { "from": "system", "value": "Move instance methods inclusion to happen once in Memoizable\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'thread_safe'\n\nrequire 'memoizable/instance_methods'\nrequire 'memoizable/method_builder'\nrequire 'memoizable/module_methods'\nrequire 'me...
ruby
chosen
[ { "from": "system", "value": "Include license type in gemspec for auditing tools\n\nWe're using http://licenseaudit.pivotallabs.com/ to audit our gem dependencies and it works a lot better when the license is listed in the gemspec" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.pu...
ruby
chosen
[ { "from": "human", "value": "Add code wars (6) - ruby enumerator methods 1\n" }, { "from": "gpt", "value": "# http://www.codewars.com/kata/5143b3d15c6bf6448d00005d/\n# --- iteration 1 ---\ndef check_ages?(data, sex, age)\n data.select{ |datum| datum[:sex] == sex }\n .all? { |datum| datum[:...
ruby
chosen
[ { "from": "system", "value": "Swap \"should\" in test descriptions with \"must\".\n\nThe minitest/spec DSL is built on top of .must_* assertions.\n" }, { "from": "human", "value": "require File.expand_path(\"setup.rb\", File.dirname(__FILE__))\n\ndescribe \"Contexts\" do\n describe \"an inherit...
ruby
chosen
[ { "from": "system", "value": "Support Rails 2.2 as well as 2.x by checking the ActionPack::VERSION (technique stolen from Erubis)\n" }, { "from": "human", "value": "# This class exists so including the Rails HTML sanitization helpers doesn't polute your models.\nclass RailsSanitize\n include Ac...
ruby
chosen
[ { "from": "system", "value": "Comment and refactor an Answer.\n" }, { "from": "human", "value": "class Answer < ApplicationRecord\n belongs_to :feedback, required: false\n belongs_to :question\n\n validates :response, presence: true, length: {maximum: 65536}\n validates_uniqueness_of :feedba...
ruby
chosen
[ { "from": "system", "value": "Update rubocop-rspec dependency version to >= 1.15.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 \"onkcop/version\"\n\nGem::Specification.new do |s...
ruby
chosen
[ { "from": "system", "value": "Add helper rows/columns methods to Console." }, { "from": "human", "value": "require 'remedy/console_resized'\n\nmodule Remedy\n module Console\n require 'io/console'\n\n TIOCGWINSZ = 0x40087468\n\n module_function\n\n def input\n STDIN\n end\n\...
ruby
chosen
[ { "from": "system", "value": "Make the instance manager less verbose\n" }, { "from": "human", "value": "module Architect4r\n class InstanceManager\n \n def initialize(path)\n @path = path\n end\n \n def server_path\n @path\n end\n \n def start\n %x[#{serve...
ruby
chosen
[ { "from": "system", "value": "Add missing fields to individual groups\n" }, { "from": "human", "value": "json.extract! @group, :cn, :displayName, :description\n" }, { "from": "gpt", "value": "json.extract! @group, :cn, :displayName, :description, :mail,\n :homepage, :type, :function...
ruby
chosen
[ { "from": "system", "value": "Add rate limiting back in, using CinchHttpServer class\n" }, { "from": "human", "value": "require \"cinch/plugins/http_server\"\nrequire \"rack/throttle\"\n\nmodule PugBot\n class WebPlugin\n include Cinch::Plugin\n extend Cinch::Plugins::HttpServer::Verbs\n\...
ruby
chosen
[ { "from": "system", "value": "Revert \"Revert \"Revert \"do not mark arrived if at usps\"\"\"\n\nThis reverts commit 324dcde3dd17db3c197ec03b80a8e64d4a8ef56d.\n" }, { "from": "human", "value": "module Omniship\n module DHLGM\n module Track\n class Package < Omniship::Base\n\n # R...
ruby
chosen
[ { "from": "system", "value": "Refactor to use comb_each iterator\n" }, { "from": "human", "value": "\nmodule Linecomber\n class Comber\n def self.comb_lines(lines, filters)\n collated = \"\"\n capture = false\n @@processors = [ method(:begin_processor), method(:print_processor...
ruby
chosen
[ { "from": "system", "value": "Remove old helper that's now unused." }, { "from": "human", "value": "require 'htmlentities'\n\nmodule ApplicationHelper\n def page_title(artefact, publication=nil)\n if publication\n title = [publication.title, publication.alternative_title].find(&:present...
ruby
chosen
[ { "from": "system", "value": "Apply an upstream fix to Spree::I18n\n\nSee: https://github.com/spree/spree/commit/fe95f637c988044f3af040a043cdbcff84935295\n\nFixes error mentioned in the above Spree commit.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'i18n'\nrequir...
ruby
chosen
[ { "from": "system", "value": "Add test to check for id\n" }, { "from": "human", "value": "# encoding: UTF-8\n\nrequire 'spec_helper'\nrequire 'ephemeral/client'\n\ndescribe 'Ephemeral::Client' do\n \n it 'expects 3 arguments' do\n test_client = Ephemeral::Client.new\n expect{\n test...
ruby
chosen
[ { "from": "system", "value": "Add task to help clean out the database" }, { "from": "human", "value": "namespace :github do\n task update_old_users: :environment do\n GithubUser.visible.order('updated_at ASC').limit(10000).pluck(:login).each {|l| GithubUpdateUserWorker.perform_async(l);}\n ...
ruby
chosen
[ { "from": "system", "value": "Make sure to URL escape graphite password\n" }, { "from": "human", "value": "class Metric\n @@paths = []\n\n def self.all\n @@paths\n end\n\n def self.find(search)\n results = []\n @@paths.each do |p|\n results << p if p.match(/#{search}/i)\n en...
ruby
chosen
[ { "from": "system", "value": "Use say(Thor::Actions) instead of puts\n" }, { "from": "human", "value": "require 'thor'\nrequire 'tumblfetch'\n\nmodule Tumblfetch\n class CLI < Thor\n SETTINGS_EXIST_MSG =<<-EOS\n`.tumblfetch` already exists in this directory.\n EOS\n\n SETTINGS_GENERATE...
ruby
chosen
[ { "from": "system", "value": "Add parentheses to formula display\n" }, { "from": "human", "value": "class CalculationElement < ActiveRecord::Base\n belongs_to :left_operand, class_name: CalculationOperand, autosave: true\n validates_associated :left_operand\n validates_presence_of :left_opera...
ruby
chosen
[ { "from": "system", "value": "Fix created_at of stream_entry when scheduled\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Streamable\n extend ActiveSupport::Concern\n\n included do\n has_one :stream_entry, as: :activity\n\n after_create do\n account.stre...
ruby
chosen
[ { "from": "system", "value": "Add scope so that it appears consistently in specs. Not sure why this file is different from the others.\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + '/spec_helper'\n\ndescribe BlankSlate do\n before(:each) do\n @blank = BlankSlate.new\n ...
ruby
chosen
[ { "from": "human", "value": "Add a spec that checks msgfmt on each .po file\n\nThis test verifies that msgfmt succeeds on each .po, since during\nbuild we run msgfmt on each file to convert it to an .mo file for\nefficient delivery\n" }, { "from": "gpt", "value": "require \"awesome_spawn\"\n\nRS...
ruby
chosen
[ { "from": "system", "value": "[specs] Use the container root selector if one exists.\n" }, { "from": "human", "value": "$:.unshift File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))\n\nrequire 'dill'\nrequire 'rspec/given'\nrequire 'sinatra/base'\nrequire 'capybara/rspec'\nrequire ...
ruby
chosen
[ { "from": "system", "value": "Upgrade from 12.1 to 12.4\n" }, { "from": "human", "value": "require 'spec_helper'\n\nRSpec.describe SimCtl do\n describe '#upgrade' do\n it 'upgrades a device to a newer runtime' do\n old_runtime = SimCtl.runtime(name: 'iOS 13.2')\n new_runtime = SimC...
ruby
chosen
[ { "from": "system", "value": "Remove empty rspec configuration block\n" }, { "from": "human", "value": "$LOAD_PATH.unshift(File.dirname(__FILE__))\n$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))\nrequire 'mousetrap'\nrequire 'spec'\nrequire 'spec/autorun'\n\nSpec::Runner.conf...
ruby
chosen
[ { "from": "system", "value": "Delete the generated secrets after each run\n" }, { "from": "human", "value": "require 'puppetlabs_spec_helper/module_spec_helper'\n\n# Where secretbox will store it's generated values during testing. It'll be this\n# directory + \"/secretbox\", so only go to the pa...
ruby
chosen
[ { "from": "system", "value": "Call WebMock.enable before all specs in an example group\n" }, { "from": "human", "value": "require 'webmock/rspec'\nrequire_relative '../lib/groovehq'\n\nRSpec.configure do |config|\n\n config.before :all, integration: true do\n WebMock.disable!\n end\n\nend\n...
ruby
chosen
[ { "from": "system", "value": "Update default Ubuntu version for specs\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'chefspec'\nrequire 'chefspec/berkshelf'\n\nrequire 'chef/application'\n\nRSpec.configure do |config|\n # Default platform used\n config.platform = 'ubuntu'\n\n...
ruby
chosen
[ { "from": "system", "value": "Correct small bug in spec\n" }, { "from": "human", "value": "class Book\n include Mongoid::Document\n include Mongoid::SortedRelations\n\n field :title\n\n attr_accessible :title\n\n has_many :chapters\n has_and_belongs_to_many :authors\n\n init_sorted_relati...
ruby
chosen
[ { "from": "system", "value": "Update spec to reflect accurate API usage\n" }, { "from": "human", "value": "module Yesmail2\n describe Email do\n describe '.send' do\n let(:template_id) { 'foo' }\n let(:subscriber) do\n { id: 'test@example.com', email: 'test@example.com' }\n ...
ruby
chosen
[ { "from": "human", "value": "Add rake task to remove ServiceTier duplicates\n\nThis allows us to remove duplicate entries for ServiceTiers. We accidentally created these duplicated entries through our ServiceInteraction import rake task which runs at the beginning of each month. There will a separate PR for...
ruby
chosen
[ { "from": "system", "value": "Update spec helper to be similar to other gems\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'devtools/spec_helper'\n\nif ENV['COVERAGE'] == 'true'\n require 'simplecov'\n require 'coveralls'\n\n SimpleCov.formatter = SimpleCov::Formatter::Multi...
ruby
chosen
[ { "from": "human", "value": "Add Rake Task to email if gems are out of date\n" }, { "from": "gpt", "value": "require './lib/gem_version_validator.rb'\n\ndesc \"test the current cached status, and email if it's bad\"\ntask :check_gem_versions do\n message = \"\"\n puts \"checking the installed ...
ruby
chosen
[ { "from": "system", "value": "Fix v1 participant counter cache.\n" }, { "from": "human", "value": "object @cloud\n\nnode(:id) { |cloud| cloud._id.to_s }\n\nattributes :name, :description, :created_at, :rules, :hidden, :member_count, :drop_count, :short_name\n\nnode(:avatar) { |cloud| cloud.avata...
ruby
chosen
[ { "from": "system", "value": "Use class_eval instead of instance_eval for the model block" }, { "from": "human", "value": "module WithModel\n class Dsl\n attr_reader :model_initialization\n\n def initialize(name, example_group)\n dsl = self\n\n @example_group = example_group\n ...
ruby
chosen
[ { "from": "system", "value": "Fix missing paths in auto-configure" }, { "from": "human", "value": "\nmodule Cocoadex\n class DocSetHelper\n\n ROOT_PATHS = [\n '~/Library/Developer/Documentation/DocSets',\n '~/Library/Developer/Shared/Documentation/DocSets',\n '/Applications/Xc...
ruby
chosen
[ { "from": "system", "value": "Reduce description missing in Noir::Command\n" }, { "from": "human", "value": "class Noir::Command < Noir::Base::Command\n class << self\n def execute *args\n # if arguments missing. call help.\n Noir::Command::Help.execute if args.size.zero?\n su...
ruby
chosen
[ { "from": "system", "value": "Fix Factory Girl deprecation warnings\n" }, { "from": "human", "value": "module Noodall\n class Site\n class << self\n\n attr_accessor :map, :permalinks\n\n def build!\n return false unless map.is_a?(Hash)\n map.each do |permalink, attrib...
ruby
chosen
[ { "from": "system", "value": "Add require affiliate to Heart\n" }, { "from": "human", "value": "require 'slatan/spirit'\nrequire 'slatan/buttocks'\n\nrequire 'faye/websocket'\nrequire 'eventmachine'\nrequire 'json'\n\nmodule Slatan\n class Heart\n def beat()\n req = Net::HTTP.post_form ...
ruby
chosen
[ { "from": "system", "value": "Move common logic in salary reports controller into before filter.\n" }, { "from": "human", "value": "class SalaryReportsController < ApplicationController\n respond_to :html, :pdf\n\n def yearly_ahv_statement\n @value_period = Date.parse(params[:by_value_perio...
ruby
chosen
[ { "from": "system", "value": "Refactor the code and add filters to change user status\n\n" }, { "from": "human", "value": "class Users::SessionsController < Devise::SessionsController\n# before_action :configure_sign_in_params, only: [:create]\n\n # GET /resource/sign_in\n # def new\n # sup...
ruby
chosen
[ { "from": "system", "value": "Add minitest and turn to the gemspec.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nrequire File.expand_path('../lib/ncsa-parser/version', __FILE__)\n\nGem::Specification.new do |s|\n s.name = \"ncsa-parser\"\n s.version = NCSAParser::VERSION\n\n...
ruby
chosen
[ { "from": "human", "value": "Add resolver for fetching favourites\n" }, { "from": "gpt", "value": "class FavouritesResolver\n attr_reader :current_employer\n\n def self.call(*args)\n new(*args).call\n end\n\n def initialize(_obj, _args, ctx)\n raise StandardError,\n 'You are n...
ruby
chosen
[ { "from": "system", "value": "Update authors and social media URL\n" }, { "from": "human", "value": "Pod::Spec.new do |spec|\n spec.name = 'Dobby'\n spec.version = '0.4'\n spec.authors = {\n 'Felix Jendrusch' => 'felix@felixjendrusch.is'\n }\n spec.social_media_url = 'https://twitter.com...
ruby
chosen
[ { "from": "system", "value": "Update VLC to version 2.1.1\n" }, { "from": "human", "value": "class Vlc < Cask\n homepage 'http://www.videolan.org/vlc/'\n url 'http://get.videolan.org/vlc/2.1.0/macosx/vlc-2.1.0.dmg'\n version '2.1.0'\n sha1 'a28961b75ca445ac8daad7944c71d6dbab0c7397'\n link '...
ruby
chosen
[ { "from": "system", "value": "Update X Lossless Decoder to v20141129a\n" }, { "from": "human", "value": "cask :v1 => 'xld' do\n version '20141129'\n sha256 'adbf053cb2b24fb342302932b90ec745740d0421d6b5fbf48c5c35367538d9fd'\n\n # sourceforge.net is the official download host per the vendor hom...
ruby
chosen
[ { "from": "system", "value": "Create proper passwords in sage_controller generator\n" }, { "from": "human", "value": "class SageControllerGenerator < Rails::Generator::Base\n attr_accessor :controller_name, :controller_file_name, :password\n\n def initialize(runtime_args, runtime_options = {})...
ruby
chosen
[ { "from": "system", "value": "Fix failing test and clean up test code.\n" }, { "from": "human", "value": "require 'codependent/validators/setter_injection_validator'\n\nclass SettersClass\n attr_accessor :a_dependency\nend\n\ndescribe Codependent::Validators::SetterInjectionValidator do\n let(...
ruby
chosen
[ { "from": "human", "value": "Add code wars (6) - consecutive strings\n" }, { "from": "gpt", "value": "# http://www.codewars.com/kata/56a5d994ac971f1ac500003e\n# --- iteration 1 ---\ndef longest_consec(str_arr, k)\n return \"\" if str_arr.size == 0 || str_arr.size < k || k <= 0\n max_length = 0...
ruby
chosen
[ { "from": "system", "value": "Add POS_ENABLE_RUNTIME_CHECKS macros for turning on/off runtime checks.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'POSRx'\n s.version = '0.14.4'\n s.license = 'MIT'\n s.summary = 'Utilities around ReactiveCocoa.'\n...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary all in a\nscope\n" }, { "from": "human", "value": "class DashboardsController < ApplicationController\n layout 'dashboard'\n\n respond_to :html, :json, :only => :index\n respond_to :rss, :only => :builds\n\n def index\n @tiles_count = (para...
ruby
chosen
[ { "from": "system", "value": "Add validation for valid categories, and the number of categories\n" }, { "from": "human", "value": "class NameratorsController < ApplicationController\n MAX_RESULTS = 50\n DEFAULT_RESULTS = 5\n # GET /namerators\n # GET /namerators.json\n def random()\n\n @...
ruby
chosen
[ { "from": "system", "value": "Fix require and reference to ruby securerandom\n" }, { "from": "human", "value": "require 'json'\n\nmodule Announce\n class Message\n\n attr_accessor :options\n\n def initialize(options={})\n @options = {\n 'message_id' => SecureRandom.uuid,\n ...
ruby
chosen
[ { "from": "system", "value": "Move working directory to \"~/.feedpork\"\n" }, { "from": "human", "value": "require \"thor\"\nrequire \"yaml\"\nrequire \"rss\"\n\nmodule Feedpork\n class Command < Thor\n SAVE_FILE = \"feeds.yaml\"\n\n def initialize(*args)\n super\n end\n\n desc...
ruby
chosen
[ { "from": "system", "value": "Add code from Marvin script\n" }, { "from": "human", "value": "require \"lita\"\n\nmodule Lita\n module Handlers\n class Googlefight < Handler\n\n route(/^!g(?:oogle)?f(?:ight)?\\s+(.+)/, :googlefight, help: { \"!g(oogle)f(ight) term one(:|;)term two\" => \...
ruby
chosen
[ { "from": "system", "value": "Allow redirect from any www to a non-www domain." }, { "from": "human", "value": "module Moonshine\n module NoWWW\n\n def self.included(manifest)\n manifest.class_eval do\n extend ClassMethods\n end\n end\n\n module ClassMethods\n end\n...
ruby
chosen
[ { "from": "system", "value": "Raise error if object id is nill\n" }, { "from": "human", "value": "class Redis\n module Attrs\n class Base\n attr_reader :klass, :name, :type\n\n def initialize(klass, name, type)\n @klass, @name, @type = klass, name, type\n end\n\n d...
ruby
chosen
[ { "from": "system", "value": "Disable knife gem install in kitchen tests\n\nThis causes horrible issues.\n\nWe are installing knife in a TK virt and can't really build it and\ninstall it as a test (hacking up appbundler to do this would largely\ninvalidate the test since we wouldn't be testing customer beha...
ruby
chosen
[ { "from": "system", "value": "Include the vendor dir in the gem files\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"queue_classic_admin/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specificat...
ruby
chosen
[ { "from": "system", "value": "Write POST /users success test\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe \"Sessions\", type: :request do\n\n describe \"POST /users\" do\n\n describe \"on success\" do\n\n it \"creates a new user with a valid email and pass...
ruby
chosen
[ { "from": "system", "value": "Add conditional to check for devise\n" }, { "from": "human", "value": "ENV[\"RAILS_ENV\"] = \"test\"\nrequire File.expand_path(\"../../../../config/environment\", __FILE__)\nrequire \"minitest/spec\"\nrequire \"cell/test_case\"\nrequire \"rails/test_help\"\nrequire ...
ruby
chosen
[ { "from": "system", "value": "Remove disused validations in User class\n" }, { "from": "human", "value": "require_relative 'account'\nrequire_relative 'badge'\n\nmodule Coderwall\n\n # @return [Class]\n User = Striuct.define {\n member :username, AND(String, /\\A\\S+\\z/)\n alias_member ...
ruby
chosen
[ { "from": "system", "value": "Add before/after methods, rename process to send_event\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Dimples\n # A Ruby class that can receive events from Dimples as a site is processed.\n class Plugin\n EVENTS = %i[\n post_wri...
ruby
chosen
[ { "from": "system", "value": "Address should always have a country name\n" }, { "from": "human", "value": "module Postal\n class Address\n Fields = [:recipient, :street, :zip, :state, :city, :country, :country_code]\n \n attr_accessor *Fields\n \n def initialize(attrs={})\n attr...
ruby
chosen
[ { "from": "system", "value": "Fix Safe decoration for constructors\n" }, { "from": "human", "value": "require 'dry/types/decorator'\n\nmodule Dry\n module Types\n class Safe\n include Decorator\n include Builder\n\n def call(input)\n if input.is_a?(primitive)\n ...
ruby
chosen
[ { "from": "system", "value": "Add one more line of code coverage\n" }, { "from": "human", "value": "module Rambo\n module RSpec\n class SpecHelperFile\n\n TEMPLATE_PATH = File.expand_path('../templates/rambo_helper_file_template.erb', __FILE__)\n\n def generate\n write_templ...
ruby
chosen
[ { "from": "system", "value": "Add params descriptions and validations\n" }, { "from": "human", "value": "require 'readline'\nrequire 'shellissimo'\n\nmodule Facebokr\n\n class Shell < Shellissimo::Shell\n command :access_token do |c|\n c.shortcut :token\n c.description \"Get fb app...
ruby
chosen
[ { "from": "system", "value": "Deal with nil values here (quickfix).\n" }, { "from": "human", "value": "module Audit\n class ExternalData < Data\n ESSENTIAL = true\n\n def add\n add_warcraftlogs_data\n add_raiderio_data\n end\n\n def add_warcraftlogs_data\n RAID_DIFFIC...
ruby
chosen
[ { "from": "system", "value": "Remove redundant constants from ReDNS::Question\n" }, { "from": "human", "value": "class ReDNS::Question < ReDNS::Fragment\n # == Constants ============================================================\n \n SECTIONS = [ :questions, :answers, :nameservers, :additio...
ruby
chosen
[ { "from": "system", "value": "Add mit license to the gemspec\n" }, { "from": "human", "value": "# encoding: utf-8\nrequire File.expand_path('../lib/tolk/version', __FILE__)\n\nGem::Specification.new do |s|\n s.name = 'tolk'\n s.version = Tolk::VERSION\n s.summary = 'Rails engin...
ruby
chosen
[ { "from": "system", "value": "Update gemspec for Nanoc 4.\n" }, { "from": "human", "value": "# encoding: utf-8\n\n$LOAD_PATH.unshift(File.expand_path('../lib/', __FILE__))\nrequire 'nanoc/git/version'\n\nGem::Specification.new do |s|\n s.name = 'nanoc-git'\n s.version = Nanoc::Git::...
ruby
chosen
[ { "from": "system", "value": "Check for encryption key presence in attr.key (allows key ||= assignement).\n" }, { "from": "human", "value": "require 'slosilo/symmetric'\n\nmodule Slosilo\n # we don't trust the database to keep all backups safe from the prying eyes\n # so we encrypt sensitive a...
ruby
chosen
[ { "from": "system", "value": "Add RSpec as a development 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 'pure360/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Add a matcher for the new resource\n" }, { "from": "human", "value": "if defined?(ChefSpec)\n def install_xcode_command_line_tools(resource_name)\n ChefSpec::Matchers::ResourceMatcher.new(:xcode_command_line_tools, :install, resource_name)\n end\nend\n" }, ...
ruby
chosen
[ { "from": "system", "value": "Disable EC2 Ohai plugin since it causes problem under XEN\n" }, { "from": "human", "value": "ssl_verify_mode :verify_peer\nfile_cache_path \"#{File.expand_path(File.dirname(__FILE__))}/../solo/cache\"\ncookbook_path \"#{File.expand_path(File.dirname(__FILE__))}/../c...
ruby
chosen
[ { "from": "system", "value": "Remove frontend redirect for now\n" }, { "from": "human", "value": "class Reader < Base\n helpers Sinatra::Nedry\n \n before do\n if ENV[\"RACK_ENV\"] == \"production\" && request.host != ENV[\"DOMAIN\"]\n redirect to(\"http://#{ENV[\"DOMAIN\"]}#{request....
ruby
chosen
[ { "from": "system", "value": "Use indifferent access for Criteria hash.\n\nSigned-off-by: David A. Wheeler <9ae72d22d8b894b865a7a496af4fab6320e6abb2@dwheeler.com>\n" }, { "from": "human", "value": "require 'yaml'\nCriteria = YAML.load(File.open('criteria.yml')).freeze\n" }, { "from": "gp...
ruby
chosen
[ { "from": "system", "value": "Remove rdoc reference from gemspec\n" }, { "from": "human", "value": "# encoding: UTF-8\nrequire File.expand_path('../lib/usps/version', __FILE__)\n\nGem::Specification.new do |s|\n s.name = \"usps\"\n s.homepage = \"http://github.com/gaffneyc/usps\"\n...
ruby
chosen
[ { "from": "system", "value": "Remove anonymous test for Marshal as we don't use anonymous classes anymore." }, { "from": "human", "value": "require \"helper\"\n\nclass Book < ActiveRecord::Base\n extend FriendlyId\n friendly_id :name\nend\n\nclass Author < ActiveRecord::Base\n extend Friendly...
ruby
chosen
[ { "from": "system", "value": "Set locale to read from currency\n" }, { "from": "human", "value": "require_relative \"./monetizable/version\"\nrequire 'money'\nrequire 'monetize'\n\nmodule Monetizable\n def self.included(base)\n base.send :extend, ClassMethods\n end\n\n module ClassMethods\...
ruby
chosen
[ { "from": "system", "value": "Fix easy_type load issues in specific situation\n\nThis commit fixes the load of easy_type in specific situations. Due to\nthe ways the Puppet masters are setup at our environment, the catalogue\nfailed to compile as it was unable to find easy_type. Eventhough it was\npresent a...
ruby
chosen
[ { "from": "human", "value": "Add a test to catch missing files\n" }, { "from": "gpt", "value": "require 'preamble'\n\nclass TextTest < Test::Unit::TestCase\n def test_should_load_all_components\n require 'text'\n assert defined? Text::Levenshtein\n assert defined? Text::Metaphone\n ...
ruby
chosen
[ { "from": "system", "value": "Remove extra line form gem spec" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'mastermind-bayendor'\n s.version = '1.0.0'\n s.author = 'David Bayendor'\n s.email = 'dbayendor@gmail.com'\n s.summary ...
ruby
chosen
[ { "from": "system", "value": "Use GirFFI version that provides threading support\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nGem::Specification.new do |s|\n s.name = \"gir_ffi-gtk\"\n s.version = \"0.7.1\"\n\n s.summary = \"GirFFI-based Ruby bindings for Gtk+ 2 and 3\"\n ...
ruby
chosen
[ { "from": "system", "value": "Change description in gemspec file\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'lol_framework/version'\n\nGem::Specification.new do |gem|\n...
ruby
chosen
[ { "from": "human", "value": "Fix failure of AssignmentTest, which was due to bad choice/configuration of database attribute type (i.e. :decimal) when creating rubric_criteria table. See review 213\n" }, { "from": "gpt", "value": "class ModifyRubricCriterionWeightColumn < ActiveRecord::Migration\...
ruby
chosen