conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Raise an exception if Attendance creation fails in message processing\n" }, { "from": "human", "value": "require 'twilio-ruby'\n\nclass InboundMessageProcessor\n def initialize(phone_number, body)\n @phone_number = phone_number\n @body = body\n end\n\n def ...
ruby
chosen
[ { "from": "system", "value": "Load all planners and builders\n" }, { "from": "human", "value": "require \"protocore/version\"\nrequire \"protocore/description\"\n\nrequire \"protocore/work_dir\"\nrequire \"protocore/details_factory\"\nrequire \"protocore/cert_factory\"\nrequire \"protocore/cert_...
ruby
chosen
[ { "from": "system", "value": "Create session[:approvals] before trying to add to it.\n" }, { "from": "human", "value": "class DecisionsController < ApplicationController\n def new\n flash[:notice] = \"Do you trust this site with your identity?\"\n render :layout => false if headless?\n e...
ruby
chosen
[ { "from": "system", "value": "Call call explicltly on bound method\n" }, { "from": "human", "value": "Spree::LineItem.class_eval do\n # pattern grabbed from: http://stackoverflow.com/questions/4470108/\n\n # the idea here is compatibility with spree_sale_products\n # trying to create a 'calcu...
ruby
chosen
[ { "from": "system", "value": "Delete regeneration flag after populate feed\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass PrecomputeFeedService < BaseService\n def call(account)\n FeedManager.instance.populate_feed(account)\n end\nend\n" }, { "from": "gpt"...
ruby
chosen
[ { "from": "system", "value": "Revert \"Fix bug: cannot send confirmation message\"\n" }, { "from": "human", "value": "class SaveOrderItemService\n attr_reader :info, :saved_order_items\n attr_accessor :success\n\n LUNCH_CODE = \"#happylunch\".freeze\n\n def initialize(info)\n @info = info...
ruby
chosen
[ { "from": "system", "value": "Add medium size for chapter image uploader\n\nWe need medium size for chapter edit form\n" }, { "from": "human", "value": "class ChapterImageUploader < BasePictureUploader\n\n version :huge do\n process :resize_to_fit => [320, nil]\n end\n\n version :big, :fro...
ruby
chosen
[ { "from": "system", "value": "Store Braintree test credentials in the environment\n" }, { "from": "human", "value": "module SolidusPaypalBraintree::GatewayHelpers\n def new_gateway(opts = {})\n SolidusPaypalBraintree::Gateway.new({\n name: \"Braintree\",\n preferences: {\n e...
ruby
chosen
[ { "from": "system", "value": "Add RubyGems 2.0 metadata to gemspec\n" }, { "from": "human", "value": "require File.expand_path('lib/nexmo/version', File.dirname(__FILE__))\n\nGem::Specification.new do |s|\n s.name = 'nexmo'\n s.version = Nexmo::VERSION\n s.license = 'MIT'\n s.platform = Gem:...
ruby
chosen
[ { "from": "system", "value": "Use chef conditional and lsb codename\n\ninstead of ruby conditions with floating point comparisons :scream_cat:\n" }, { "from": "human", "value": "\n#\n# On Ubuntu 12.04, there are some package conflicts between 'tzdata', 'tzdata-java' and opendjdk packages.\n# TOD...
ruby
chosen
[ { "from": "system", "value": "Change inner_html to to_xml. Since we are parsing XML files\n" }, { "from": "human", "value": "require 'ffi'\nrequire 'health-data-standards'\nrequire 'os'\n\nmodule GoCDATools\n module Import\n class GoImporter\n include Singleton\n extend FFI::Libra...
ruby
chosen
[ { "from": "system", "value": "Set CLI time to match projector time\n" }, { "from": "human", "value": "class CommandLineReporter\n\n # config:\n # width: Total terminal width\n # player_width: the size of the box around each panellist\n def initialize(window, config={})\n @window = win...
ruby
chosen
[ { "from": "system", "value": "Revert \"Safeguard against missing gems\"\n\nThis reverts commit 231199653f22ed8eced25661b1861bb0dd3c15cb. On second\nthought, I'd want to know if this was a problem.\n" }, { "from": "human", "value": "require 'rubygems/command'\n\nclass Gem::Commands::CtagsCommand...
ruby
chosen
[ { "from": "system", "value": "Include helpers for user management.\n" }, { "from": "human", "value": "class ApplicationController < Sinatra::Base\n configure do\n set :public_folder, 'public'\n set :views, 'app/views'\n\n enable :sessions unless test?\n set :session_secret, \"secret...
ruby
chosen
[ { "from": "system", "value": "Whitelist allow Crazy Egg to jump over the check terms\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n\n helper_method :watch_cookie?\n\n protect_from_forgery with: :exception\n\n before_filter :check_browser\n before_fi...
ruby
chosen
[ { "from": "system", "value": "Disable basic authentication only development environment\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n protect_from_forgery with: :exception\n\n before_action :basic_authorization\n\n private\n\n def basic_authorizati...
ruby
chosen
[ { "from": "system", "value": "Make CommandT a module rather than a class\n\nSigned-off-by: Wincent Colaiuta <c76ac2e9cd86441713c7dfae92c451f3e6d17fdc@wincent.com>\n" }, { "from": "human", "value": "class CommandT\n class Matcher\n attr_accessor :paths\n\n # Turn a search string like:\n ...
ruby
chosen
[ { "from": "system", "value": "Rename a confusingly named variable.\n" }, { "from": "human", "value": "require 'term/ansicolor'\n\nclass String\n include Term::ANSIColor\nend\n\nmodule Gitra\n\n module CLI\n def self.analyze(reference_branch)\n tracker = Tracker.new '.'\n reference...
ruby
chosen
[ { "from": "system", "value": "Update push server to 1.2.0/zmq4\n" }, { "from": "human", "value": "#\n# Copyright 2012-2014 Chef Software, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may ob...
ruby
chosen
[ { "from": "system", "value": "Set watch to lower target\n" }, { "from": "human", "value": "\nPod::Spec.new do |s|\n s.name = 'KeyStorage'\n s.version = '0.2.4'\n s.summary = 'KeyStorage is a simple secure key persistance library written in Swift.'\n\n s.descript...
ruby
chosen
[ { "from": "system", "value": "Update gc_ruboconfig requirement from ~> 2.26.0 to ~> 2.29.0\n\nUpdates the requirements on [gc_ruboconfig](https://github.com/gocardless/ruboconfig) to permit the latest version.\n- [Release notes](https://github.com/gocardless/ruboconfig/releases)\n- [Changelog](https://githu...
ruby
chosen
[ { "from": "system", "value": "Update rubocop requirement from ~> 1.22.1 to ~> 1.24.1\n\nUpdates the requirements on [rubocop](https://github.com/rubocop/rubocop) to permit the latest version.\n- [Release notes](https://github.com/rubocop/rubocop/releases)\n- [Changelog](https://github.com/rubocop/rubocop/bl...
ruby
chosen
[ { "from": "human", "value": "Refactor the Broken Chord Ballad line count back down to < 40 lines\n" }, { "from": "gpt", "value": "# Lesson 8 - The Broken Chord Ballad (Refactored)\nuse_synth :piano\n\nCHORD_SEQUENCE = [\n :C2,\n :F2,\n [:B2, :diminished],\n [:E2, :minor],\n [:A2, :minor],\n...
ruby
chosen
[ { "from": "system", "value": "Raise error if deploy:status gives different versions\n" }, { "from": "human", "value": "namespace :deploy do\n\n task :status do |t|\n require 'open-uri'\n system(\"git fetch -q\")\n protocol = fetch(:protocol, 'http')\n port = fetch(:port, 80)\n on...
ruby
chosen
[ { "from": "system", "value": "Remove errant \"puts\" from BatchResponse\n" }, { "from": "human", "value": "module Click2Mail\n class BatchResponse\n attr_accessor :id,\n :created_at,\n :error_message,\n :has_errors,\n :recei...
ruby
chosen
[ { "from": "system", "value": "Change the name of the org\n" }, { "from": "human", "value": "Pod::Spec.new do |spec|\n spec.name = \"Theodolite\"\n spec.version = \"0.1.0\"\n spec.summary = \"A React-Inspired view framework in Swift.\"\n spec.homepage = \"https://github.com/ocrickard/Theodoli...
ruby
chosen
[ { "from": "system", "value": "Fix url returned by threat_assessment service.\n" }, { "from": "human", "value": "module Hypgen\n module Api\n module V1\n class ThreatAssessments < Grape::API\n\n resource :threat_assessments do\n get do\n { help: 'REST interface...
ruby
chosen
[ { "from": "system", "value": "Remove exit code after raising error\n" }, { "from": "human", "value": "module InputStream\n\n=begin\nThe methods in this module parse all command-line arguments according to 4 scenarios:\n 1) An empty input will prompt the user to enter a custom string\n 2) Singl...
ruby
chosen
[ { "from": "system", "value": "Add fantaskspec gem for testing rake tasks\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'rails_reseed/version'\n\nGem::Specification.new do |spec|\n ...
ruby
chosen
[ { "from": "system", "value": "Revert \"make sure (random) uid is an int\"\n\nThis is already handled by travis-rollout.\n\nThis reverts commit c86be9d78b03e2be6010270c2bb484be7e0483bc.\n" }, { "from": "human", "value": "require 'travis/addons/handlers/base'\nrequire 'travis/addons/handlers/task'...
ruby
chosen
[ { "from": "system", "value": "Check for dir not file befiore symlinking\n" }, { "from": "human", "value": "include_recipe \"midokura::_common\"\n\nif (node['midokura']['zookeepers'] == [])\n raise \"Please set the Midokura zookeepers list attribute in your environment: midokura->zookepers\"\nen...
ruby
chosen
[ { "from": "system", "value": "Attach user when a Page is first created.\n\nThis doesn't do anything to backfill missing user info on pre-existing\npages.\n" }, { "from": "human", "value": "class EmbedController < ApplicationController\n\n skip_before_action :verify_authenticity_token, only: [:i...
ruby
chosen
[ { "from": "system", "value": "Remove loggers and add a notice to empty profile\n" }, { "from": "human", "value": "class OauthController < ApplicationController\n\n def create\n auth = request.env[\"omniauth.auth\"]\n if auth.nil? || auth.blank?\n redirect_to root_path, :notice => \"W...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary method for this branch\n" }, { "from": "human", "value": "# frozen_string_literal: true\nclass AssignmentInvitation < ActiveRecord::Base\n default_scope { where(deleted_at: nil) }\n\n update_index('stafftools#assignment_invitation') { self }\n\n...
ruby
chosen
[ { "from": "system", "value": "Revert removing overridden method from build service\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Ci\n class ProcessBuildService < BaseService\n def execute(build, current_status)\n if valid_statuses_for_when(build.when).includ...
ruby
chosen
[ { "from": "system", "value": "Add Missing Required OL 8 Library\n\nAdd the 'elfutils-libelf-devel' library required by Guest Additions on OL 8" }, { "from": "human", "value": "module VagrantVbguest\n module Installers\n class Oracle < RedHat\n\n def self.match?(vm)\n :redhat == s...
ruby
chosen
[ { "from": "system", "value": "Update rubocop requirement to ~> 0.51.0\n\nUpdates the requirements on [rubocop](https://github.com/bbatsov/rubocop) to permit the latest version.\n- [Release notes](https://github.com/bbatsov/rubocop/releases)\n- [Changelog](https://github.com/bbatsov/rubocop/blob/master/CHANG...
ruby
chosen
[ { "from": "human", "value": "Add rescue from connection failure wrapper\n" }, { "from": "gpt", "value": "def rescue_connection_failure(max_retries=60)\n retries = 0\n begin\n yield\n rescue Mongo::ConnectionFailure => ex\n retries += 1\n raise ex if retries > max_retries\n sleep(0...
ruby
chosen
[ { "from": "system", "value": "Fix minor issues with gemspec\n\nAs suggested by \"gem build\"\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'capistrano-rails-collection'\n\nGem::Spec...
ruby
chosen
[ { "from": "system", "value": "guests/ubuntu: Change host name in one command\n\nThis also removes the dependency on the debian hostname setting.\n" }, { "from": "human", "value": "module VagrantPlugins\n module GuestUbuntu\n module Cap\n class ChangeHostName < VagrantPlugins::GuestDebia...
ruby
chosen
[ { "from": "system", "value": "Add tests for the other methods in HoldBackHardBounceFilter\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe HoldBackHardBounceFilter do\n let(:delivery) { mock }\n\n describe \"#send?\" do\n context \"an address where an email was succesf...
ruby
chosen
[ { "from": "system", "value": "Add tenant name to report\n" }, { "from": "human", "value": "class PDFWriter\n\n attr_reader :user, :content_type, :pdf\n\n HEADERS = [\"TIME\", \"DATE\", \"TEMP INSIDE\", \"TEMP OUTSIDE\", \"TEMP OF HOT WATER\", \"NOTES\"]\n HEADER_OPTIONS = {width: 90, backgrou...
ruby
chosen
[ { "from": "system", "value": "Fix has_one and nested params\n" }, { "from": "human", "value": "module Archetype\n module Attributes\n class Association < Attribute\n attr_accessor :nested\n\n def initialize(name, macro, options={})\n super(name, macro, options)\n end\n\...
ruby
chosen
[ { "from": "human", "value": "Add stub rspec test to module\n" }, { "from": "gpt", "value": "require_relative '../../../../spec_helper'\n\ndescribe 'aspell', :type => :class do\n\n it { is_expected.to compile }\n\n it { is_expected.to compile.with_all_deps }\n\n it { is_expected.to contain_cla...
ruby
chosen
[ { "from": "system", "value": "Add generator config that is used\n" }, { "from": "human", "value": "require_relative 'boot'\n\nrequire 'rails/all'\n\n# Require the gems listed in Gemfile, including any gems\n# you've limited to :test, :development, or :production.\nBundler.require(*Rails.groups)\...
ruby
chosen
[ { "from": "system", "value": "Update generetors config to use rspec and factory girls\n" }, { "from": "human", "value": "require File.expand_path('../boot', __FILE__)\n\nrequire 'rails/all'\n\n# Require the gems listed in Gemfile, including any gems\n# you've limited to :test, :development, or :...
ruby
chosen
[ { "from": "system", "value": "Use where + delete_all to increase readability\n\nCo-authored-by: Maikel <3db1433c7298ef0d91dd12baeaaf90dc122deafc@email.org.au>" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass RemoveTransientData\n # This model lets us operate on the sessio...
ruby
chosen
[ { "from": "system", "value": "Add extra relation types for messages\n" }, { "from": "human", "value": "class Area < ActiveRecord::Base\n has_many :areas_messages\n has_many :messages, through: :areas_messages\n\nend\n" }, { "from": "gpt", "value": "class Area < ActiveRecord::Base\n...
ruby
chosen
[ { "from": "system", "value": "Remove remaining relation to navigation items.\n" }, { "from": "human", "value": "class Page < ActiveRecord::Base\n include Concerns::Translatable\n include Concerns::Taggable\n include Concerns::Loggable\n include Concerns::Parentable\n include Concerns::Visib...
ruby
chosen
[ { "from": "system", "value": "Change before_filter to be before_action\n\nFixes a deprecation warning for rails 5" }, { "from": "human", "value": "module Bugsnag::Rails\n module ControllerMethods\n def self.included(base)\n base.extend ClassMethods\n end\n\n module ClassMethods\n ...
ruby
chosen
[ { "from": "system", "value": "Remove uneeded 'self.' from User::before_save\n" }, { "from": "human", "value": "class User < ActiveRecord::Base\n \n validates :name, presence: true, length: { maximum: 50 }\n \n validates :email, presence: true, format: { with: /@/ },\n uniqueness: { case_s...
ruby
chosen
[ { "from": "system", "value": "Use correct path to postgres job\n\nSigned-off-by: Danny Berger <8efccf38e9d8f361e1973ad644e1b1e50ad8ecfe@pivotal.io>\n" }, { "from": "human", "value": "require 'yaml'\nrequire 'pg'\nrequire 'bosh/director/config'\n\nmodule Bosh::Dev\n class PostgresVersion\n cl...
ruby
chosen
[ { "from": "system", "value": "Set the content type on the callback request\n" }, { "from": "human", "value": "require 'ruote'\nrequire 'httpi'\n\nmodule ScriptoriaCore\n class HttpParticipant < Ruote::StorageParticipant\n def on_workitem\n re_dispatch(in: '60s') unless request_callback\...
ruby
chosen
[ { "from": "system", "value": "Fix railties version: `< 6`\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'purecss-rails/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "human", "value": "TEST: Test for groups unlocked upon creation and lockable only by staff\n" }, { "from": "gpt", "value": "require 'test_helper'\n\nclass GroupsSetsApiTest < ActiveSupport::TestCase\n include Rack::Test::Methods\n include TestHelpers::AuthHelper\n include TestHelper...
ruby
chosen
[ { "from": "system", "value": "Fix that expire_all! is run on the loader, not import class\n" }, { "from": "human", "value": "raw_config = File.read(\"#{Rails.root}/config/config.yml\")\nAPP_CONFIG = YAML.load(raw_config)[Rails.env].with_indifferent_access\n\nif APP_CONFIG[:airbrake_api_key].pres...
ruby
chosen
[ { "from": "system", "value": "Move lti key/secret into env variables\n" }, { "from": "human", "value": "Rails.application.config.middleware.use OmniAuth::Builder do\n provider :developer unless Rails.env.production?\n provider :lti, :oauth_credentials => { 'Caitlin Holman' => 'berlin' }\n pro...
ruby
chosen
[ { "from": "human", "value": "Add an initializer which initializes the action mailer settings in config/mailer.yml.\n" }, { "from": "gpt", "value": "if File.exists?(\"#{RAILS_ROOT}/config/mailer.yml\")\n require \"action_mailer\"\n c = YAML::load(File.open(\"#{RAILS_ROOT}/config/mailer.yml\"))\...
ruby
chosen
[ { "from": "human", "value": "Patch draper to make it compatible with the `localize` method.\n\nThe `localize` method takes two arguments, but our version of Draper\nonly accepts one in it's wrapper method. This is fixed in the latest\nversions of Draper, but upgrading requires a lot of changing of\ncode (se...
ruby
chosen
[ { "from": "human", "value": "Add big fat warning if attempting to run Gitorious on wrong Ruby version\n" }, { "from": "gpt", "value": "if !%w[1.8.7 1.9.3].include?(RUBY_VERSION)\n $stderr.puts <<-WARN\n######################################################################\n# ...
ruby
chosen
[ { "from": "human", "value": "Add Tournaemtns list feature speck\n" }, { "from": "gpt", "value": "require 'spec_helper.rb'\n\nfeature \"Viewing a list of Tournaments\", js: true do\n let(:tournament_list){FactoryGirl::create_list(:tournament, 10)}\n\n scenario \"View all Tournaments\" do\n t...
ruby
chosen
[ { "from": "human", "value": "Add specs for team commands.\n" }, { "from": "gpt", "value": "# encoding: utf-8\n\nrequire 'spec_helper'\n\ndescribe GithubCLI::Commands::Teams do\n let(:format) { 'table' }\n let(:user) { 'peter-murach' }\n let(:repo) { 'github_cli' }\n let(:org) { 'rails...
ruby
chosen
[ { "from": "system", "value": "Mark zombie specs as pending\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Mutant, 'as a zombie' do\n specify 'allows to create zombie from mutant' do\n Zombie.setup\n Zombie::Runner\n end\nend\n" }, { "from": "gpt", "value...
ruby
chosen
[ { "from": "system", "value": "Add route for 504 error\n" }, { "from": "human", "value": "Static::Application.routes.draw do\n match \"/templates/wrapper.html.erb\", :to => \"root#wrapper\"\n match \"/templates/print.html.erb\", :to => \"root#print\"\n match \"/templates/related.raw.html.erb\"...
ruby
chosen
[ { "from": "system", "value": "Use scope instead of with_options for routing.\n" }, { "from": "human", "value": "Moebooru::Application.routes.draw do\n resources :advertisements do\n collection do\n post :update_multiple\n end\n member do\n get :redirect\n end\n end\n\n #...
ruby
chosen
[ { "from": "human", "value": "Add RW permissions to img folder\n" }, { "from": "gpt", "value": "node[:deploy].each do |application, deploy|\n script \"image_permissions\" do\n interpreter \"bash\"\n user \"root\"\n cwd \"#{deploy[:deploy_to]}/current\"\n code <<-EOH\n chown -R www...
ruby
chosen
[ { "from": "system", "value": "Make admin namespace over posts\n" }, { "from": "human", "value": "Blogelator::Engine.routes.draw do\n resources :posts, path: \"/\"\n \n namespace :admin do\n resources :posts, path: \"/\"\n end\nend\n" }, { "from": "gpt", "value": "Blogelator::E...
ruby
chosen
[ { "from": "system", "value": "Allow shorthand route for organization, i.e. /o/" }, { "from": "human", "value": "Rails.application.routes.draw do\n\n resources :releases\n resources :downloads\n resources :subscriptions\n resources :feeds\n resources :settings\n resources :blurbs\n resourc...
ruby
chosen
[ { "from": "system", "value": "Use old way to create a test class, Rubinius only has Minitest 4.x\n" }, { "from": "human", "value": "require 'minitest/autorun'\nrequire \"#{__dir__}/quizbot\"\n\nclass TestQuestionpool < Minitest::Test\n def setup\n @questionpool = Questionpool.new\n # Load...
ruby
chosen
[ { "from": "system", "value": "Make status and resource type available as class methods\n\nAlso using attr_reader, as there’s no need for clients to update these\nattributes\n" }, { "from": "human", "value": "module OptINnow\n module Response\n class Wrapper\n attr_accessor :errors\n ...
ruby
chosen
[ { "from": "system", "value": "Update simple_po_parser version to 1.1.6\n\nVersion 1.1.6 fixes a wrong assumption that multiline messages have to start with an empty string and thus incorrectly failing on files compliant with the PO standard. This should assure all new installations use 1.1.6 or newer and up...
ruby
chosen
[ { "from": "human", "value": "Add example to update orderlines\n" }, { "from": "gpt", "value": "orderline_id = \"odl_dgtxyl\"\n\norder = Mollie::Order::Line.update(\n orderline_id,\n order_id: \"ord_kEn1PlbGa\",\n sku: \"new-sku-12345678\"\n)\n" } ]
ruby
chosen
[ { "from": "system", "value": "Change default port to 5668 since nsca uses 5667\n" }, { "from": "human", "value": "require 'socket'\nrequire 'openssl'\n\nclass Metis::Server\n\n DEFAULT_OPTIONS = {\n :host => '0.0.0.0',\n :port => 5667,\n ...
ruby
chosen
[ { "from": "human", "value": "Check in code from other projects\n" }, { "from": "gpt", "value": "# Use like this:\n# QuickConfig.api(:spreedly, 'SPREEDLY_CORE_LOGIN', 'SPREEDLY_CORE_SECRET') do\n# SpreedlyCore.configure(ENV['SPREEDLY_CORE_LOGIN'],\n# ENV['SPREEDLY_CORE_...
ruby
chosen
[ { "from": "system", "value": "Add skip_create to stock packer and stock package\n\nAdds skip_create to the aforementioned factories. They aren't active\nrecord objects so they can't be saved.\n\nIronically\n> must use build()\n" }, { "from": "human", "value": "FactoryGirl.define do\n # must use...
ruby
chosen
[ { "from": "human", "value": "Add rake task for heroku\n\nAmazingly, rake tasks on heroku run much better when \nthey're actually checked into source control and \n*deployed* to the platform..." }, { "from": "gpt", "value": "desc \"A daily task for running on heroku to test\"\ntask :cron => :envi...
ruby
chosen
[ { "from": "human", "value": "Add spec for package recipe\n" }, { "from": "gpt", "value": "require 'chefspec'\n\ndescribe 'tdi-example-vim::package' do\n package_checks = {\n 'ubuntu' => {\n '12.04' => ['vim'],\n '14.04' => ['vim']\n },\n 'debian' => {\n '7.0' => ['vim'],...
ruby
chosen
[ { "from": "system", "value": "Fix bug in Article test class\n" }, { "from": "human", "value": "class Article\n attr_reader :title, :body\n def initialize title=\"Title\", body=\"Body\", author=nil\n @title = title\n @body = body\n end\nend\n\nclass ArticleMapper < Perpetuity::Mapper\n ...
ruby
chosen
[ { "from": "human", "value": "Add integration test for GHashTable with enums\n" }, { "from": "gpt", "value": "require 'gir_ffi_test_helper'\n\nGirFFI.setup :Secret\n\ndescribe Secret do\n describe Secret::Schema do\n it \"has a working constructor\" do\n Secret::Schema.new(\"foo\", :none...
ruby
chosen
[ { "from": "human", "value": "Apply patch for CVE-2013-1855 in Rails 3.0.x.\n" }, { "from": "gpt", "value": "# Patch for CVE-2013-1855\n# https://groups.google.com/forum/m/?fromgroups#!topic/rubyonrails-security/4_QHo4BqnN8\nmodule HTML \n class WhiteListSanitizer \n # Sanitizes a block of ...
ruby
chosen
[ { "from": "system", "value": "Change version of bundler required for Travis\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'rapidash/version'\n\nGem::Specification.new do |spec|\n s...
ruby
chosen
[ { "from": "human", "value": "Create a more generic latest ami resolver\n" }, { "from": "gpt", "value": "module StackMaster\n module ParameterResolvers\n class LatestAmi < Resolver\n array_resolver class_name: 'LatestAmi'\n\n def initialize(config, stack_definition)\n @config...
ruby
chosen
[ { "from": "system", "value": "gemspec: Use a current employee for author and email\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path('../lib', __FILE__)\nrequire 'simple_sitemap/version'\n\nGem::Specification.new do |gem|\n\n gem.name = 'simple_site...
ruby
chosen
[ { "from": "system", "value": "Remove attr_accessor for given class\n" }, { "from": "human", "value": "module Blacksmith\n class Forge\n attr_accessor :klass\n\n def initialize(klass)\n @klass = klass\n end\n\n private\n\n def object\n klass.new\n end\n end\nend\n" ...
ruby
chosen
[ { "from": "system", "value": "Read VERSION from correct folder\n" }, { "from": "human", "value": "# General namespace. See the Rubocop module.\nmodule Blinkbox\n # Helper methods for setting up, configuring and running Rubocop.\n module Rubocop\n\n begin\n # Set the Gem Version\n ...
ruby
chosen
[ { "from": "system", "value": "Rework how git is handled, copy information to temporary files and use those paths. Keep it GC safe.\n" }, { "from": "human", "value": "require \"git\"\n\nmodule Figs\n module GitHandler\n extend self\n TMP_GIT_DIR = \"tmp/figs/\"\n\n def location gitpath,...
ruby
chosen
[ { "from": "system", "value": "Fix notifications not saving correctly\n" }, { "from": "human", "value": "# frozen_string_literal: true\nmodule Hertz\n module Notifiable\n def self.included(base)\n base.class_eval <<-RUBY\n has_many :notifications,\n class_name: 'Hertz::No...
ruby
chosen
[ { "from": "system", "value": "Insert middleware at index 0\n" }, { "from": "human", "value": "# encoding: utf-8\n\nmodule HireFire\n class Railtie < ::Rails::Railtie\n initializer \"hirefire.add_middleware\" do |app|\n app.config.middleware.use \"HireFire::Middleware\"\n end\n end\n...
ruby
chosen
[ { "from": "system", "value": "Add min and max params\n" }, { "from": "human", "value": "module LootSystem\n class Drop\n attr_accessor :item\n attr_accessor :chance\n attr_writer :random_number_generator\n\n # Assign information about the drop.\n #\n # ==== Examples.\n # ...
ruby
chosen
[ { "from": "system", "value": "Add console feedback if page was captured or not\n" }, { "from": "human", "value": "# Parses lapsefiles\n\nmodule Pagelapse\n class Parser\n def initialize(file)\n puts \"Starting Pagelapse #{Pagelapse::VERSION}\"\n @recorders = []\n instance_eval...
ruby
chosen
[ { "from": "system", "value": "Revert \"Bump version to 1.3.3\"\n\nThis reverts commit b4fefeba77460bf7391c54230f81a330e19494ba.\n" }, { "from": "human", "value": "# Just namespace for version number\nmodule SpbtvCodeStyle\n VERSION = '1.3.3'.freeze\nend\n" }, { "from": "gpt", "value...
ruby
chosen
[ { "from": "system", "value": "Store info from github api calls in yaml files" }, { "from": "human", "value": "namespace :metadata do\n\n metadata_directory = 'tmp/METADATA.jl'\n\n desc \"clone metadata project\"\n task clone: :environment do\n `git clone https://github.com/JuliaLang/METADA...
ruby
chosen
[ { "from": "system", "value": "Add a hash method to Mark\n" }, { "from": "human", "value": "module TicTacToe\n\n class Mark\n attr_reader :symbol\n\n def initialize(symbol = \" \")\n @symbol = symbol\n end\n\n def ==(o)\n o.class == self.class && o.symbol == self.symbol\n ...
ruby
chosen
[ { "from": "system", "value": "Change title structure for payload" }, { "from": "human", "value": "require 'net/http'\nrequire \"uri\"\n\nrequire 'rubygems'\nrequire 'json'\n\nmodule EventGirl\n\tclass Client\n\n\t\tVERSION = '0.0.1'\n\n\t\tattr_reader :api_token, :url\n\n\t\tdef initialize(url, ...
ruby
chosen
[ { "from": "system", "value": "Update BASE_URL to reflect new domain\n" }, { "from": "human", "value": "module ExploreMars\n class Call\n CAMERAS = [\"FHAZ\", \"RHAZ\", \"MAST\", \"CHEMCAM\", \"NAVCAM\", \"MAHLI\", \"MARDI\", \"PANCAM\", \"MINITES\"]\n BASE_URI = \"https://mars-curiosity-a...
ruby
chosen
[ { "from": "system", "value": "Change AddressBR to use NameBR instead of Name\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'ffaker/address'\n\nmodule Faker\n module AddressBR\n include Faker::Address\n\n extend ModuleUtils\n extend self\n\n def zip_code\n Fake...
ruby
chosen
[ { "from": "system", "value": "Include models in the Rails load path\n" }, { "from": "human", "value": "require 'has_magic_columns/has_magic_columns'\nrequire 'has_magic_columns/version'\nrequire 'has_magic_columns/railtie' if defined?(Rails)\n\n# Has Magic Columns\n#\n# Copyright (c) 2007 Brando...
ruby
chosen
[ { "from": "system", "value": "Fix aesthetic parens in PrivatePub::Utils\n" }, { "from": "human", "value": "class PrivatePub\n module Utils\n class << self\n def symbolize_keys arg\n case arg\n when Array\n arg.map { |elem| symbolize_keys elem }\n when Hash\...
ruby
chosen
[ { "from": "system", "value": "Fix code smells reported by rubocop\n" }, { "from": "human", "value": "lib = File.expand_path('../lib/', __FILE__);\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'jwt/version'\n\nGem::Specification.new do |spec|\n spec.name = 'jwt'\n spec.versi...
ruby
chosen
[ { "from": "system", "value": "Add thor.gem for cli tool\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'schemize/version'\n\nGem::Specification.new do |spec|\n spec.name = ...
ruby
chosen