conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Use URI::DEFAULT_PARSER.make_regexp instead of URI.regexp\n" }, { "from": "human", "value": "module FrancisCms\n class Webmention < ActiveRecord::Base\n belongs_to :webmentionable, polymorphic: true\n has_one :webmention_entry\n\n validates :source, :targe...
ruby
chosen
[ { "from": "system", "value": "ESDL: Add support for pro environment\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n# Service that calls the api at the etm_esdl app. The app will create an ETE scenario\n# based on the specified edsl file when successful, and return the scenar...
ruby
chosen
[ { "from": "system", "value": "Add stuff to the gemspect because it beats adding functionality\n" }, { "from": "human", "value": "# Ensure we require the local version and not one we might have installed already\nrequire File.join([File.dirname(__FILE__),'lib','probablyfine','version.rb'])\nspec ...
ruby
chosen
[ { "from": "system", "value": "Make all workers in BuildFinishedWorker to run async and reorder\n" }, { "from": "human", "value": "class BuildFinishedWorker\n include ApplicationWorker\n include PipelineQueue\n\n queue_namespace :pipeline_processing\n\n def perform(build_id)\n Ci::Build.fi...
ruby
chosen
[ { "from": "system", "value": "Fix typo in targets URL\n" }, { "from": "human", "value": "Given(/^a deployment is already queued$/) do\n create(:deployment, target: Target.last)\nend\n\nGiven(/^I am on the target page$/) do\n visit \"/target/#{Target.last.id}\"\nend\n\nThen(/^I see a list of pr...
ruby
chosen
[ { "from": "system", "value": "[JRO] Clean up the SendGrid adapter class\n" }, { "from": "human", "value": "module Griddler\n module Adapters\n class SendGridAdapter\n def self.normalize_params(params)\n attachment_count = params[:attachments].to_i\n\n attachment_files = at...
ruby
chosen
[ { "from": "system", "value": "Add coveralls as 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 'sloc/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Fix 'edit' template spec tempalte\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe '<%= ns_table_name %>/edit', <%= type_metatag(:view) %> do\n <%= model.factory_girl_let_definitions %>\n before(:each) do\n @<%= ns_file_name %> = assi...
ruby
chosen
[ { "from": "system", "value": "Fix conflicting version of uglifier\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"middleman-google-analytics/version\"\n\nGem::Specification.new do |s|\n s.name = \"middleman-google-analytics...
ruby
chosen
[ { "from": "human", "value": "Fix critical typo in CIKit Vagrant provisioner\n" }, { "from": "gpt", "value": "module VagrantPlugins::CIKit\n class Config < Vagrant.plugin(\"2\", :config)\n attr_accessor :playbook\n attr_accessor :controller\n\n def validate(machine)\n errors = _det...
ruby
chosen
[ { "from": "system", "value": "Update notification type in presenter\n" }, { "from": "human", "value": "#requiring here doesn't feel right\nrequire_relative '../helpers/fuzzy_time_helper'\n\nclass NotificationsPresenter\n include Sinatra::FuzzyTimeHelper\n\n def initialize(notifications)\n @...
ruby
chosen
[ { "from": "system", "value": "Fix spec that breaks on recent-ish Ruby\n" }, { "from": "human", "value": "module BigDecimalHelper\n # Defines a conversion protocol for BigDecimal that is\n # (a) easier to type than { BigDecimal(something.to_s) }\n # (b) idempotent (by virtue of being lazy^H^H ...
ruby
chosen
[ { "from": "system", "value": "Fix comment to describe enablePlaceholder\n" }, { "from": "human", "value": "module EnableplaceholderJquery\n module Rails\n # Use logger version; append a pre-release version identifier if gem\n # is updated without updating version of logger.\n # Example...
ruby
chosen
[ { "from": "system", "value": "Move dependency from Rails to ActiveSupport\n\nAlso allow Rails 5\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"edtf/humanize/version\"\n\n# Describe your gem and declare its dependenci...
ruby
chosen
[ { "from": "system", "value": "Set up a common session store in test environment to work with sessions\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\nRails.application.config.session_store :cookie_store,\n key: \"_updated_gobierto_session\",\n ...
ruby
chosen
[ { "from": "system", "value": "Set cookies to only be served over https and to be http only\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\nPanopticon::Application.config.session_store :cookie_store, key: '_panopticon_session'\n\n# Use the databas...
ruby
chosen
[ { "from": "system", "value": "Append glowfic-staging to cookies list, hopefully not affecting prod\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\noptions = if Rails.env.production?\n {domain: 'glowfic.com', tld_length: 2}\nelsif Rails.env.devel...
ruby
chosen
[ { "from": "system", "value": "Set an expiration for session cookies\n" }, { "from": "human", "value": "# We set the cookie domain dynamically with a Rack middleware.\n# See lib/intercode/dynamic_cookie_domain.rb for how this works.\n\nRails.application.config.session_store :active_record_store, ...
ruby
chosen
[ { "from": "system", "value": "Update all of bower rails to use production settings\n" }, { "from": "human", "value": "BowerRails.configure do |bower_rails|\n # Tell bower-rails what path should be considered as root. Defaults to Dir.pwd\n # bower_rails.root_path = Dir.pwd\n\n # Invokes rake b...
ruby
chosen
[ { "from": "system", "value": "Update to disable Rabl caching\n\nWe've been finding that we're encountering errors on production that\nwe're unable to reproduce locally using the same data. After some\ninvestigation we found that the Rabl source cache option seemed to be\nthe root of these issues and given t...
ruby
chosen
[ { "from": "system", "value": "Reduce the interval between geocoding checks\n" }, { "from": "human", "value": "# encoding: utf-8\nrequire 'eventmachine'\nrequire File.expand_path('../../../../../config/environment.rb', __FILE__)\n\nmodule CartoDB\n module AutomaticGeocoder\n class Runner\n ...
ruby
chosen
[ { "from": "system", "value": "Update spec to remove size\n" }, { "from": "human", "value": "require \"spec_helper\"\n\nfeature \"Content Plan management\" do\n\n before do\n create(:user)\n end\n\n scenario \"creating a Content Plan\" do\n\n visit new_content_plan_path\n\n fill_in \"...
ruby
chosen
[ { "from": "system", "value": "Add tests for following links on static pages\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe \"Static Pages\" do\n\n describe \"Home page\" do\n\n # Capybara provides visit, which sets the page variable\n before { visit root_path }\n ...
ruby
chosen
[ { "from": "system", "value": "Change default php version to 7.4" }, { "from": "human", "value": "### DO NOT EDIT BELOW ###\nset :branch, \"staging\"\nset :document_root, \"/home/sites/php73/#{fetch :client}/#{fetch :project}\"\nset :deploy_to, \"/home/sites/apps/#{fetch :client}/#{fetch :project...
ruby
chosen
[ { "from": "system", "value": "Add type specs to example" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire \"dry-validation\"\n\ncontract = Class.new(Dry::Validation::Contract) do\n params do\n required(:email).filled\n required(:age).filled(:int?, gt?: 18)\n end\n...
ruby
chosen
[ { "from": "human", "value": "Add script to update marriage_abroad_services.yml\n\nTrello card: https://trello.com/c/D0ZMM9v5\n\nThis will help me update the services based on the data in the spreadsheet\nattached to the Trello card.\n" }, { "from": "gpt", "value": "update_file = ARGV.shift\nunle...
ruby
chosen
[ { "from": "system", "value": "Use rroonga 3.0.4 or later\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'feedcellar/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Update error message for github org login failure to explain reason for failure\n" }, { "from": "human", "value": "class Auth0Controller < ApplicationController\n def callback\n if github_org_authorized?\n user = User.find_or_create_by(uid: request.env['omn...
ruby
chosen
[ { "from": "system", "value": "Use s3-index instead of redis for ember index page\n" }, { "from": "human", "value": "class IndexController < ApplicationController\n REDIS_KEY_PREFIX = \"bus-detective:index\"\n\n force_ssl if: :ssl_configured?, except: [:letsencrypt]\n\n def show\n render te...
ruby
chosen
[ { "from": "system", "value": "Fix disable Item show until the day\n" }, { "from": "human", "value": "class ItemsController < ApplicationController\n\tdef new\n\t\t@date = params[:date]\n\t\t@item = Item.new(advent_calendar_item_id: params[:id])\n\tend\n\n\tdef create\n\t\t@item = Item.new(item_p...
ruby
chosen
[ { "from": "system", "value": "Remove quotation marks for no_checksum\n" }, { "from": "human", "value": "class Jing < Cask\n url 'http://download.techsmith.com/jing/mac/jing.dmg'\n homepage 'http://www.techsmith.com/jing.html'\n version 'latest'\n sha1 'no_checksum'\n link 'Jing.app'\nend\n"...
ruby
chosen
[ { "from": "system", "value": "Add redirecting to root path\n" }, { "from": "human", "value": "class UsersController < ApplicationController\n\n\tdef index\n\t\t@users = User.all\n\tend\n\n\tdef new\n\t\t@user = User.new\n\tend\n\n\tdef create\n\t\tuser = User.new(user_params)\n\t\tif user.save\n...
ruby
chosen
[ { "from": "system", "value": "Declare variable as late as possible\n" }, { "from": "human", "value": "module Imap::Backup\n class Downloader\n attr_reader :folder\n attr_reader :serializer\n attr_reader :block_size\n\n def initialize(folder, serializer, block_size: 1)\n @folder...
ruby
chosen
[ { "from": "system", "value": "Change test to be order independent\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe SalesEngine::Invoice, invoice: true do\n context \"extensions\" do\n describe \".pending\" do\n it \"returns Invoices without a successful transaction\"...
ruby
chosen
[ { "from": "system", "value": "Fix capybara waits for ajax\n" }, { "from": "human", "value": "require 'rails_helper'\n\nfeature 'User creates a post' do\n background do\n visit root_path\n click_i18n 'posts.new'\n end\n\n scenario 'with valid inputs' do\n fill_model_field(Tingui::Post...
ruby
chosen
[ { "from": "system", "value": "Remove RSpec::Matchers include which was causing stack level too deep\nerror [myronmarston]\n" }, { "from": "human", "value": "require 'action_dispatch'\nrequire 'capybara/rails'\nrequire 'capybara/dsl'\n\nmodule RSpec::Rails\n module IntegrationExampleGroup\n e...
ruby
chosen
[ { "from": "system", "value": "Use the current user, not the request owner\n" }, { "from": "human", "value": "class RequestPresenter < SimpleDelegator\n def can_vote?(u)\n self.user.id != u.id && !self.user.voted_on?(__getobj__)\n end\n\n def liked_by user\n if can_vote?(user)\n sup...
ruby
chosen
[ { "from": "system", "value": "Remove self to include the change hash\n" }, { "from": "human", "value": "module ServiceObjects\n class UpdateLegacyEmailTable < Base\n DB = Sequel.connect(Settings.ws.db.to_hash)\n\n def self.insert(email)\n DB[:email].insert(idnumber: change.biola_id, ...
ruby
chosen
[ { "from": "system", "value": "FIX: Check object has hasKey? in group serializer\n" }, { "from": "human", "value": "# Doubtfire will deprecate ActiveModelSerializer in the future.\n# Instead, write a serialize method on the\n\nclass GroupSerializer < ActiveModel::Serializer\n attributes :id, :na...
ruby
chosen
[ { "from": "system", "value": "Handle to and from correctly\n" }, { "from": "human", "value": "require 'mail'\n\n\nclass UnkownAction < StandardError\nend\n\n\nmodule SecretMail\n class Controller\n def self.process message, &block\n record = MailAction.find_valid(message.to, message.fro...
ruby
chosen
[ { "from": "system", "value": "Add 'each' that iterates over all log files\n\nUse 'select' to do an exact match when seeking a specific log file.\n" }, { "from": "human", "value": "require 'fog/core/collection'\nrequire 'fog/aws/models/rds/log_file'\n\nmodule Fog\n module AWS\n class RDS\n\n ...
ruby
chosen
[ { "from": "system", "value": "Allow Scanner to work outside a Bundler environment\n\nWhen a LockfileParser is initialised, Bundler will try to find the\nrelated Gemfile in the current directory’s hierarchy. If the tool is\nrun from a directory that doesn't have a Gemfile in its hierarchy,\nBundler will rais...
ruby
chosen
[ { "from": "system", "value": "Simplify column name generator more\n" }, { "from": "human", "value": "module Saxlsx\n class ColumnNameGenerator\n FIRST = 'A'\n LAST = 'Z'\n\n def self.next_to(previous)\n char = previous ? previous[-1] : nil\n if char.nil?\n FIRST\n ...
ruby
chosen
[ { "from": "system", "value": "Fix another bad git URL\n" }, { "from": "human", "value": "name \"serverspec\"\ndefault_version \"master\"\nrelative_path \"serverspec\"\n\nsource git: \"git@github.com:mizzy/serverspec.git\"\n\nif windows?\n dependency \"ruby-windows\"\n dependency \"ruby-windows...
ruby
chosen
[ { "from": "system", "value": "Revert \"Check whether Cell is defined before trying to render\"\n\nThis reverts commit d70a98a4fde47936d618433a66175c158c2898dd.\n" }, { "from": "human", "value": "module Trailblazer::Rails\n module Controller\n def run(operation, params=self.params, *dependenc...
ruby
chosen
[ { "from": "system", "value": "Change route to share application\n" }, { "from": "human", "value": "#module CatarseStripe\n #class Engine < ::Rails::Engine\n #isolate_namespace CatarseStripe\n #end\n#end\nmodule ActionDispatch::Routing\n class Mapper\n def mount_catarse_stripe_at(mount_l...
ruby
chosen
[ { "from": "human", "value": "Add integration tests for the aws_internet_gateway provider.\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Chef::Resource::AwsInternetGateway do\n extend AWSSupport\n\n when_the_chef_12_server \"exists\", organization: 'foo', server_scope: :con...
ruby
chosen
[ { "from": "system", "value": "Remove static translation path and just let active model errors do its own thing - keeps the lookup process the same as any other error" }, { "from": "human", "value": "class DateValidator < ActiveModel::EachValidator\n def validate_each(record, attribute, value)\n...
ruby
chosen
[ { "from": "system", "value": "Fix rails 4.2+ deprecated warnings for MessageDelivery.deliver()\n\nRails 4.2+ deprecated ActionMailer::MessageDelivery.deliver() in favor of\na split interface deliver_now() and deliver_later().\n\nThe old deliver() was plumbed through to deliver_now(). Let's just use that\ndi...
ruby
chosen
[ { "from": "system", "value": "Remove unneeded packages from ServiceTestCase object.\n" }, { "from": "human", "value": "require 'test_helper'\n\nrequire 'capybara/poltergeist'\nrequire 'minitest/metadata'\n\nrequire 'helpers/capybara'\nrequire 'helpers/drivers'\nrequire 'helpers/dsl'\nrequire 'he...
ruby
chosen
[ { "from": "system", "value": "Remove handling of :nan and :inf tokens\n\nThe parser stopped emitting these tokens a while ago.\n" }, { "from": "human", "value": "class Jiffy\n module Outputters\n class Json < Outputter\n rule :begin_object, :payload => \"{\", :indent => 1, :break_after ...
ruby
chosen
[ { "from": "system", "value": "Clarify usage of blockings in the announcement\n\nPeople don't seem to have understand the feature. We'll destroy the\ncurrent announcement and create another one with more explanations.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nnamespace :...
ruby
chosen
[ { "from": "human", "value": "Add test coverage for create user service\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\nRSpec.describe ExternalUsers::CreateUser do\n let(:user) { create(:user) }\n\n subject(:service) { described_class.new(user) }\n\n describe '#call!' do\n it 'cr...
ruby
chosen
[ { "from": "system", "value": "Update Gemspec to use a valid license\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'netuitive_rails_agent'\n s.version = '1.0.3'\n s.date = '2016-10-21'\n s.summary = \"Rails metrics for Netuitive's API\"\n s...
ruby
chosen
[ { "from": "system", "value": "Expand the test for the read scenario\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe \"FC082\" do\n context \"with a cookbook with a recipe that sets an attribute...
ruby
chosen
[ { "from": "human", "value": "Add script to import COVID urls from MHCLG\n\nMHCLG have been collecting local URLs for supporting vulnerable people\nfrom local council websites in a [Google Sheet][]. This script imports\nthem into Local Links Manager for LGSL 1287 and LGIL 8, based on the\nrationale in [this ...
ruby
chosen
[ { "from": "human", "value": "Create task to create iid for existing issues/mr\n" }, { "from": "gpt", "value": "desc \"GITLAB | Build internal ids for issues and merge requests\"\ntask migrate_iids: :environment do\n puts 'Issues'.yellow\n Issue.where(iid: nil).find_each(batch_size: 100) do |is...
ruby
chosen
[ { "from": "system", "value": "Use aggregation approach for building queue list.\n" }, { "from": "human", "value": "require 'forwardable'\nrequire_relative '../resource'\n\nmodule Convection\n module Model\n class Template\n class Resource\n ##\n # AWS::SQS::QueuePolicy\n ...
ruby
chosen
[ { "from": "system", "value": "Update minitest and mocha dependencies\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nGem::Specification.new do |gem|\n gem.name = \"boxen\"\n gem.version = \"0.6.0\"\n gem.authors = [\"John Barnette\", \"Will Farrington\"]\n...
ruby
chosen
[ { "from": "human", "value": "Add script to list responses for country and outcome\n\nThis displays the responses for the specified country that lead to the\nspecified outcome.\n\nIt's going to help me when extracting the marriage-abroad services from the\ntemplates.\n" }, { "from": "gpt", "value...
ruby
chosen
[ { "from": "human", "value": "Add feature specs for user studies page\n" }, { "from": "gpt", "value": "require \"rails_helper\"\nrequire \"support/user_account_feature_helper\"\n\nRSpec.describe \"User studies page\" do\n let(:user) { FactoryGirl.create(:user) }\n let(:other_user) { FactoryGirl...
ruby
chosen
[ { "from": "system", "value": "Add test for data sent to panopticon\n\nWe'd like to test exactly what is being sent to panopticon. This test\nverifies the JSON payload sent to the API.\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass PanopticonRegistererTest < ActiveSupport::Test...
ruby
chosen
[ { "from": "system", "value": "Support for an unreleased OS\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\n#mac_encryption_enabled.rb\nrequire 'facter'\nFacter.add(:mac_encryption_enabled) do\n confine :kernel => \"Darwin\"\n setcode do\n osver = Facter.value('macosx_productvers...
ruby
chosen
[ { "from": "system", "value": "Add *.cpt to clean up targets for TeX Makefile\n" }, { "from": "human", "value": "class Noir::Command::New::Makefile::Tex < Noir::Base::TerminalCommand\n @description = 'Create new Makefile for TeX'\n\n MakefileText = %q(\n# target name\nTARGET=<tex_file_name_with...
ruby
chosen
[ { "from": "system", "value": "Add missing pg dependency for travis\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"sumo_seed/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |s...
ruby
chosen
[ { "from": "system", "value": "Add more logging around receiver -> logs handoff\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'sidekiq/worker'\nrequire 'travis/logs/services/process_log_part'\n\nmodule Travis\n module Logs\n module Sidekiq\n class LogParts\n...
ruby
chosen
[ { "from": "system", "value": "Rearrange to get Grape support working\n" }, { "from": "human", "value": "require 'hn_history'\nrequire 'hn_history/api'\nrequire 'hn_history/web'\n\nif ENV['RACK_ENV'] == \"production\"\n require 'oboe'\n require 'oboe/inst/rack'\n\n Oboe::Config[:tracing_mode] ...
ruby
chosen
[ { "from": "system", "value": "Change Rails dependency to be '>= 5.0.0.beta1'\n" }, { "from": "human", "value": "require 'date'\n\nVERSION = File.read(File.expand_path('../VERSION', __FILE__)).strip\n\nGem::Specification.new do |gem|\n gem.name = 'json_key_transformer_middleware'\n gem.v...
ruby
chosen
[ { "from": "system", "value": "Use idiomatic naming of memoization.\n" }, { "from": "human", "value": "require \"yaml\"\n\nmodule Nutrella\n #\n # Provides a cache of the most recently used items.\n #\n class Cache\n attr_reader :capacity, :path\n\n def initialize(path, capacity)\n ...
ruby
chosen
[ { "from": "system", "value": "Read the filename property being passed in\n" }, { "from": "human", "value": "module TFA\n class Storage\n include Enumerable\n\n def initialize(filename:)\n @storage = PStore.new(File.join(Dir.home, \".#{filename}.pstore\"))\n end\n\n def each\n ...
ruby
chosen
[ { "from": "system", "value": "Move SCHEMES from the global namespace into UrlObject\n" }, { "from": "human", "value": "require 'addressable/uri'\nrequire 'public_suffix'\n\nPublicSuffix::List.private_domains = false\n\nSCHEMES = %w(http https)\n\nmodule Twingly\n module URL\n module_function...
ruby
chosen
[ { "from": "system", "value": "Set the font in Text.new" }, { "from": "human", "value": "module Schnitzel\n class Text < Node\n attr_accessor :color, :text\n\n def initialize(text: \"\", color: 0xffffffff, size: 20, **args)\n super(args)\n @text = text\n @color = color\n ...
ruby
chosen
[ { "from": "system", "value": "Add byebug to development dependenies for debugging\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'honey_format/version'\n\nGem::Specification.new do |...
ruby
chosen
[ { "from": "system", "value": "Fix assets precompile with config.assets.initialize_on_precompile = true\n" }, { "from": "human", "value": "module ActiveAdmin\n module Gallery\n\n class Engine < ::Rails::Engine\n engine_name \"activeadmin_gallery\"\n\n initializer \"Railsyard precomp...
ruby
chosen
[ { "from": "system", "value": "Use error helper in development\n" }, { "from": "human", "value": "require 'rollbar/rack'\nrequire 'sinatra'\nrequire 'sinatra/cross_origin'\nrequire 'sinatra/jsonp'\nrequire 'yajl'\nrequire 'snapshot'\n\nconfigure do\n enable :cross_origin\nend\n\nconfigure :produ...
ruby
chosen
[ { "from": "system", "value": "Make Conductor::ConductorInvalid subclass StandardError rather than Exception\n" }, { "from": "human", "value": "module Conductor\n class ConductorInvalid < Exception\n attr_accessor :conductor\n \n def initialize(conductor)\n @conductor = conductor\n...
ruby
chosen
[ { "from": "system", "value": "Resolve unitialized constant error in Ruby 1.8.7\n" }, { "from": "human", "value": "require 'yaml'\n\nmodule Configurethis\n class Configuration\n attr_reader :path\n\n def initialize(configuration_file)\n @path = File.join(ConfigurethisProperties.root_p...
ruby
chosen
[ { "from": "system", "value": "Exclude errors in the conntrack shell output\n\nThis keeps warning messages from being sent to graphite in addition to the metric values.\n" }, { "from": "human", "value": "#! /usr/bin/env ruby\n# encoding: UTF-8\n#\n# conntrack-metrics\n#\n# DESCRIPTION:\n#\n# O...
ruby
chosen
[ { "from": "human", "value": "Add WordPress Mashshare Plugin Info Disclosure.\n" }, { "from": "gpt", "value": "##\n# This module requires Metasploit: http://metasploit.com/download\n# Current source: https://github.com/rapid7/metasploit-framework\n##\n\nrequire 'msf/core'\n\nclass Metasploit4 < M...
ruby
chosen
[ { "from": "system", "value": "Create get_lines method, covert tabs to spaces\n" }, { "from": "human", "value": "class Map\n\n\tdef initialize(window, mapfile)\n\t\t@window = window\n\t\t@tileset = Gosu::Image.load_tiles(window, 'media/32x32diagonal_lines.png',\n\t\t ...
ruby
chosen
[ { "from": "system", "value": "Verify that payload ref name is in the list of branches\n" }, { "from": "human", "value": "require File.expand_path('../helper', __FILE__)\n\nclass AppHarborTest < Service::TestCase\n def setup\n @stubs = Faraday::Adapter::Test::Stubs.new\n end\n\n def test_pu...
ruby
chosen
[ { "from": "system", "value": "Fix broken test stemmed from private class method\n" }, { "from": "human", "value": "require File.join(File.expand_path('../test_helper', __FILE__))\n\nclass WolverineTest < MiniTest::Unit::TestCase\n\n def test_redis\n Wolverine.config.redis = :redis\n asser...
ruby
chosen
[ { "from": "system", "value": "Update IntelliJ IDEA EAP to version 141.588.1\n" }, { "from": "human", "value": "cask :v1 => 'intellij-idea-eap' do\n version '141.104.1'\n sha256 'a59b096cbf012f42dbaf108026de12fa1a3caf16a0f87cbc5f20aa44fa2f2156'\n\n url \"http://download-cf.jetbrains.com/idea/i...
ruby
chosen
[ { "from": "system", "value": "Include backtrace when reporting example results\n" }, { "from": "human", "value": "require \"json\"\n\nclass UpdateFormatter\n RSpec::Core::Formatters.register self, :example_passed, :example_failed, :example_pending\n\n def initialize(output)\n @output = outp...
ruby
chosen
[ { "from": "system", "value": "Fix namespacing in cookies test\n\nNameError: uninitialized constant ActionDispatch::Cookies::SignedCookieJar::MAX_COOKIE_SIZE\n # ./spec/requests/large_request_spec.rb:8\n" }, { "from": "human", "value": "# Large requests can fail if Devise tries to store the U...
ruby
chosen
[ { "from": "system", "value": "Update gemspect to keep capybara on 1.1\n" }, { "from": "human", "value": "# encoding: UTF-8\nGem::Specification.new do |s|\n s.platform = Gem::Platform::RUBY\n s.name = 'spree_personalised_products'\n s.version = '0.2.0'\n s.summary = 'Adds su...
ruby
chosen
[ { "from": "human", "value": "Add a package for KW-rocketry.\n" }, { "from": "gpt", "value": "class KWRocketry < Kosmos::Package\n title 'KW Rocketry'\n url 'http://kerbalspaceport.com/wp/wp-content/themes/kerbal/inc/download.php?f=uploads/2013/12/KW-Release-Package-v2.5.6B.zip'\n\n def instal...
ruby
chosen
[ { "from": "system", "value": "Add nil check for request before calling methods\n\nDemeter: It's the law.\n\nThis will allow the token auth object to respond with nill if the\nresponse was never created or set to nil for some reason.\n" }, { "from": "human", "value": "module Kracken\n class Toke...
ruby
chosen
[ { "from": "human", "value": "Add a task to generate coverage reports." }, { "from": "gpt", "value": "begin\n require 'rcov/rcovtask'\nrescue LoadError\n raise 'Could not find the rcov gem, please run `gem install rcov` to get some metrics'\nend\n\nnamespace :test do \n \n namespace :coverage...
ruby
chosen
[ { "from": "system", "value": "Mark `brew bump` test with `:needs_network.\n" }, { "from": "human", "value": "# typed: false\n# frozen_string_literal: true\n\nrequire \"cmd/shared_examples/args_parse\"\n\ndescribe \"brew bump\" do\n describe \"Homebrew.bump_args\" do\n it_behaves_like \"parse...
ruby
chosen
[ { "from": "system", "value": "Use STDERR as default stream for messenger\n" }, { "from": "human", "value": "require 'logger'\nrequire 'processor/messenger'\n\nmodule Processor\n module Observer\n class NullObserver\n attr_reader :processor\n\n def initialize(options = {})\n ...
ruby
chosen
[ { "from": "system", "value": "Use \" (double quote) for string literal\n" }, { "from": "human", "value": "# Copyright (C) 2011 Kouhei Sutou <kou@clear-code.com>\n#\n# This library is free software; you can redistribute it and/or\n# modify it under the terms of the GNU Lesser General Public\n# L...
ruby
chosen
[ { "from": "system", "value": "Remove require call to ams\n" }, { "from": "human", "value": "require 'active_model_serializers'\n\nmodule FrontEndBuilds\n class Engine < ::Rails::Engine\n isolate_namespace FrontEndBuilds\n\n config.generators do |g|\n g.test_framework :rspec, fixture:...
ruby
chosen
[ { "from": "system", "value": "Improve syntax for finding file, fixes spec\n" }, { "from": "human", "value": "# Grabs definitions for the URIs defined in Ggi::Uri.\nclass Ggi::DefinitionImporter \n\n def self.import\n Ggi::DefinitionImporter.new.import\n end\n\n def self.clear_cache\n @@...
ruby
chosen
[ { "from": "system", "value": "Update Mplayer formula to compile on 10.5.\n" }, { "from": "human", "value": "require 'formula'\n\nclass Mplayer <Formula\n homepage 'http://www.mplayerhq.hu/'\n head 'svn://svn.mplayerhq.hu/mplayer/trunk'\n\n depends_on 'pkg-config' => :recommended\n\n # http:/...
ruby
chosen
[ { "from": "system", "value": "Define the variables to be cleaned for testing\n" }, { "from": "human", "value": "module Juicy\n class BuildEnvironment\n\n attr_reader :env\n def initialize\n @env = ENV.to_hash.tap do |env|\n %w[RUBYOPT BUNDLE_GEMFILE RACK_ENV MONGOLAB_URI].each...
ruby
chosen
[ { "from": "system", "value": "Add support for Rails 5.1\n\nRails controller `env` was deprecated and removed\n\nbut we love backwards compatibility and keep the old behaviour \n\n\n\n\n\n" }, { "from": "human", "value": "module Rack\n class Tracker\n module Controller\n def tracker(&blo...
ruby
chosen
[ { "from": "human", "value": "Add rake task to verify that docs & puppet are in sync\n" }, { "from": "gpt", "value": "desc \"Check if the monitoring_docs_url's in puppet definitions link to an existing page\"\ntask :lint_alert_docs do\n checks = Dir.glob(\"modules/**/*.pp\").map do |filename|\n ...
ruby
chosen
[ { "from": "system", "value": "Make printer adding script repeatable\n" }, { "from": "human", "value": "require 'net/http'\nnamespace :cthit do\n desc \"Update glorious printers\"\n task update_printers: :environment do\n uri = URI('http://print.chalmers.se/public/pls.cgi')\n res = Net::H...
ruby
chosen
[ { "from": "system", "value": "Sort methods of Tab::MentionsTab in alphabetical order\n" }, { "from": "human", "value": "module Twterm\n module Tab\n class MentionsTab\n include StatusesTab\n\n def initialize(client)\n fail ArgumentError, 'argument must be an instance of Clie...
ruby
chosen