conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Add a script for converting Eijiro's TEXT data into StarDict's tabfile\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\n# -*- coding: utf-8 -*-\nrequire 'rubygems'\nrequire 'bundler/setup'\n\ncurrent = nil\nFile.open('EIJIRO/EIJI-1441.TXT', 'r:CP932:UTF-8') do |...
ruby
chosen
[ { "from": "system", "value": "Increment version after license added\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'increments'\n s.version = '1.0.2'\n s.date = '2013-07-14'\n s.description = \"Range bound incrementing and decrementing by a spec...
ruby
chosen
[ { "from": "system", "value": "Add controller test for creating valid card\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe CardsController, type: :controller do\n let(:template) { CardTemplate.create(greeting: \"Whoa Nellie\", image_file: \"wn.png\") }\n let(:card_pa...
ruby
chosen
[ { "from": "system", "value": "Add user controller with passing tests; need to add more tests for better coverage\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe UsersController do\n describe 'GET#new' do\n it \"creates a new user\" do\n get :new\n expect(assig...
ruby
chosen
[ { "from": "system", "value": "Tweak spec language to reflect new semantics (no actual tests changed).\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe VotesController do\n describe '#create' do\n before :each do\n @user = FactoryGirl.create(:user)\n @question =...
ruby
chosen
[ { "from": "system", "value": "Increase trial_count to make false failures less likely\n" }, { "from": "human", "value": "RSpec::Matchers.define :give_the_outcome do |outcome|\n match do |actual|\n outcome_count = 0\n trial_count = 10_000\n\n trial_count.times do\n outcome_count +=...
ruby
chosen
[ { "from": "system", "value": "Enable basic auth if the env BASIC_AUTH_PASSWORD variable is set.\n" }, { "from": "human", "value": "# This file is used by Rack-based servers to start the application.\n\nrequire ::File.expand_path('../config/environment', __FILE__)\n\n# Disable buffering for real...
ruby
chosen
[ { "from": "system", "value": "Add AnsiColor plugin to Jenkins\n\nSee https://wiki.jenkins-ci.org/display/JENKINS/AnsiColor+Plugin" }, { "from": "human", "value": "#\n# Cookbook Name:: scala-jenkins-infra\n# Recipe:: _master-config-jenkins\n#\n# Copyright 2014, Typesafe, Inc.\n#\n# All rights res...
ruby
chosen
[ { "from": "system", "value": "Clean up GObject integration test file\n" }, { "from": "human", "value": "require 'gir_ffi_test_helper'\n\ndescribe \"The generated GObject module\" do\n before do\n GirFFI.setup :GObject\n end\n\n describe \"#type_interfaces\" do\n it \"works, showing that...
ruby
chosen
[ { "from": "system", "value": "Add test for invalid subdomain redirect.\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe \"Group subdomains\", use: :subdomain do\n let(:group) { Factory.create(:group) }\n\n before do\n set_subdomain(group.short_name)\n end\n\n after {...
ruby
chosen
[ { "from": "human", "value": "Add tests for LinkCheckerAPI requests\n" }, { "from": "gpt", "value": "require 'rails_helper'\nrequire 'local-links-manager/check_links/link_status_updater'\n\ndescribe LocalLinksManager::CheckLinks::LinkStatusUpdater, type: :request do\n subject(:status_updater) { ...
ruby
chosen
[ { "from": "system", "value": "Add test for missing layout" }, { "from": "human", "value": "# encoding: UTF-8\n# Generators register themself on the CLI module\nrequire \"test_helper\"\nrequire \"./lib/roger/renderer.rb\"\n\nmodule Roger\n # Roger template tests\n class RendererBaseTest < ::Tes...
ruby
chosen
[ { "from": "human", "value": "Test jsxc helper spec; should respond with correct url\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe JsxcHelper, :type => :helper do\n before do\n AppConfig.chat.server.bosh.proxy = false\n AppConfig.chat.server.bosh.port = 1234\n AppCo...
ruby
chosen
[ { "from": "system", "value": "Change Metadata specs to run against test fixtures\n" }, { "from": "human", "value": "require_relative \"../lib/knife_cookbook_readme/metadata\"\n\nmodule KnifeCookbookReadme\n describe \"Metadata.from_file\" do\n it \"knows how to read metadata from metadata.rb...
ruby
chosen
[ { "from": "system", "value": "Remove circular require in spec support file\n" }, { "from": "human", "value": "require 'spec_helper'\n\nclass Model\n include ActiveModel::Validations\n\n attr_accessor :attributes\n\n def initialize(attributes = {})\n @attributes = attributes\n end\n\n def...
ruby
chosen
[ { "from": "system", "value": "Introduce a feature that allows a duck to quack twice\n" }, { "from": "human", "value": "module ActiveAdmin\n\n\n\n\n\n\n\n module Views\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n class ActionItems < ...
ruby
chosen
[ { "from": "system", "value": "Fix issue where passing no options gives a NilError\n" }, { "from": "human", "value": "require 'openssl'\n\nmodule AnsibleTowerClient\n class Connection\n attr_reader :connection\n\n def initialize(options = nil)\n raise \"Credentials are required\" unle...
ruby
chosen
[ { "from": "system", "value": "Switch to be a head only formula\n" }, { "from": "human", "value": "require 'formula'\n\nclass SportnginBrewGem < Formula\n homepage 'https://github.com/sportngin/brew-gem'\n url 'https://github.com/sportngin/brew-gem/archive/master.tar.gz'\n\n def install\n b...
ruby
chosen
[ { "from": "system", "value": "Add irb to development dependencies\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'kuroneko/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Fix identation in test code\n" }, { "from": "human", "value": "require File.join(File.dirname(__FILE__), '.', 'lib/pagarme')\n\nPagarMe.api_key = \"Jy1V5bJcGf8q4gHepttt\"\nPagarMe.live = true\n\nbegin\n\ntransaction = PagarMe::Transaction.new\n\ntransaction.card_num...
ruby
chosen
[ { "from": "system", "value": "Remove an unneeded logger statement\n" }, { "from": "human", "value": "require_dependency 'landable/api_controller'\n\nmodule Landable\n module Api\n class AccessTokensController < ApiController\n skip_before_filter :require_author!, only: [:create]\n\n ...
ruby
chosen
[ { "from": "system", "value": "Fix headers how the app expects\n" }, { "from": "human", "value": "require \"bundler/setup\"\nENV[\"RACK_ENV\"] ||= \"development\"\nBundler.require(:default, ENV[\"RACK_ENV\"].to_sym)\nDotenv.load\n\nrequire \"./hook_delivery\"\n\nconfigure do\n MongoMapper.setup(...
ruby
chosen
[ { "from": "system", "value": "Add fallback support for Assets\n" }, { "from": "human", "value": "require_relative '../file'\n\nmodule Contentful\n module Resource\n # Special fields for Asset. Don't include together wit Contentful::Resource::Fields\n #\n # It depends on system properti...
ruby
chosen
[ { "from": "system", "value": "Fix specs failing with ruby 1.9\n" }, { "from": "human", "value": "require 'json'\n\nmodule Faye\n module Authentication\n class HTTPClient\n\n def self.publish(url, channel, data, key)\n uri = URI(url)\n req = Net::HTTP::Post.new(uri)\n ...
ruby
chosen
[ { "from": "system", "value": "Use Puppet to install packages, using the default provider\n" }, { "from": "human", "value": "require 'fpm/cookery/facts'\n\nmodule FPM\n module Cookery\n class DependencyInspector\n # Inspect dependencies!\n # FPM::Cookery::Packager calls:\n # De...
ruby
chosen
[ { "from": "system", "value": "Enable to fetch doc's updated_at from git log\n" }, { "from": "human", "value": "class Document\n attr_reader :id, :filename\n DIR_PATH = 'db/docs'\n URL_PATH = 'docs'\n\n class << self\n def all\n Dir.glob(\"#{DIR_PATH}/*.md\").sort.map do |filename|\n ...
ruby
chosen
[ { "from": "system", "value": "Bump govuk_frontend_toolkit to latest version\n\nThe only change which this effects is gets a new visited link colour.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(...
ruby
chosen
[ { "from": "system", "value": "Set up a basic flow for sketched out methods.\n" }, { "from": "human", "value": "require 'guard'\nrequire 'guard/guard'\nrequire 'ejs'\n\nmodule Guard\n class EJS < Guard\n def initialize(watchers = [], options = {})\n super\n @options = {\n run...
ruby
chosen
[ { "from": "system", "value": "Use instance variable instead of argument for app\n" }, { "from": "human", "value": "require 'hanzo/modules/deploy'\n\nmodule Hanzo\n\n class CLI\n\n def initialize(args)\n @args = args\n\n app = (@args[0] =~ /-/) ? nil : @args[0]\n @opts = init_cl...
ruby
chosen
[ { "from": "system", "value": "Extend needs CSV export to include format\n" }, { "from": "human", "value": "require 'csv_renderer'\nrequire 'csv'\n\nclass NeedsCsv < CsvRenderer\n def to_csv\n CSV.generate do |csv|\n csv << [\"Id\", \"Title\", \"Context\", \"Tags\", \"Status\", \"Audienc...
ruby
chosen
[ { "from": "system", "value": "Add method to API module\n" }, { "from": "human", "value": "require \"CheckfrontAPI/version\"\n\nmodule CheckfrontAPI\n # Your code goes here...\nend\n" }, { "from": "gpt", "value": "require_relative \"CheckfrontAPI/version\"\nrequire_relative \"Checkfr...
ruby
chosen
[ { "from": "human", "value": "Add spec to check structure.yml regexps build\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe 'structures.yml' do\n FILE = File.expand_path('../../../data/structures.yml', __FILE__)\n STRUCTURES = YAML.load_file(FILE)\n\n STRUCTURES.each do |cou...
ruby
chosen
[ { "from": "system", "value": "Move git_init into it's own block under have_git\n\nThis allows gitignore to be generated even if we don't wish to initialize this as it's own git repo\r\nThis is a quick fix for Issue #145" }, { "from": "human", "value": "\ncontext = ChefDK::Generator.context\ncook...
ruby
chosen
[ { "from": "system", "value": "Use DBI instead of direct SQLite API for JRuby compat.\n" }, { "from": "human", "value": "require 'sqlite3'\n\nmodule Bio\n\n module MAF\n\n class SQLiteIndex\n\n def self.build(parser, idx_path)\n if File.exist? idx_path\n raise \"Cannot bu...
ruby
chosen
[ { "from": "system", "value": "Fix exception when try detect a ID with nil\n" }, { "from": "human", "value": "module Brid\n @@detect_between = {\n :cpf => Brid::CPF,\n :cnpj => Brid::CNPJ,\n :titulo_eleitor => Brid::TituloEleitor,\n :pis => Brid::PIS\n...
ruby
chosen
[ { "from": "system", "value": "Disable Style/PredicateName cop for Douglas::Model.has_stamps method\n" }, { "from": "human", "value": "require 'douglas/model_config'\n\nmodule Douglas\n module Model\n def has_stamps\n Douglas::ModelConfig.new(self).setup\n end\n end\nend\n" }, { ...
ruby
chosen
[ { "from": "system", "value": "Use the correct class name in TriggerDelegate.\n" }, { "from": "human", "value": "require \"cognizant/process/triggers\"\n\nmodule Cognizant\n class Process\n class TriggerDelegate\n attr_accessor :name, :process, :mutex, :scheduled_events\n\n def init...
ruby
chosen
[ { "from": "system", "value": "Fix require and push version\n" }, { "from": "human", "value": "require \"blazing-jammit/version\"\nrequire \"blazing-jammit/recipes/precompile_assets\"\n\nmodule Blazing\n module Jammit\n end\nend\n" }, { "from": "gpt", "value": "require \"blazing-jam...
ruby
chosen
[ { "from": "system", "value": "Add encoding header back to main file :|\n" }, { "from": "human", "value": "require 'iso3166'\n\nrequire 'country_select/version'\nrequire 'country_select/tag_helper'\n\nif defined?(ActionView::Helpers::Tags::Base)\n require 'country_select/country_select_helper'\n...
ruby
chosen
[ { "from": "system", "value": "Allow cleaning and installing in one task.\n" }, { "from": "human", "value": "require 'thor'\nrequire 'thor/actions'\nrequire 'librarian'\n\nmodule Librarian\n class Cli < Thor\n\n include Thor::Actions\n include Particularity\n extend Particularity\n\n ...
ruby
chosen
[ { "from": "system", "value": "Use instance vars in Document\n" }, { "from": "human", "value": "require 'nokogumbo'\n\nmodule Emcee\n # Document is responsible for parsing HTML and handling interaction with the\n # resulting document.\n class Document\n attr_reader :doc\n private :doc\n\...
ruby
chosen
[ { "from": "system", "value": "Use to_s on message in the Util.raise_error! method.\n" }, { "from": "human", "value": "\nclass RabbitMQ::FFI::Error < RuntimeError; end\n\nmodule RabbitMQ::Util\n class << self\n \n def raise_error! message=\"unspecified error\", action=nil\n message = ...
ruby
chosen
[ { "from": "system", "value": "[TODO] Add final TODO necessary for Github metrics.\n" }, { "from": "human", "value": "require 'github_api'\n\nmodule Metrics\n class Github\n attr_reader :user, :repo, :client\n\n def initialize(url)\n @user, @repo = parse url\n @client = ::Github....
ruby
chosen
[ { "from": "system", "value": "Fix wrong directory name introduced while renaming directories\n" }, { "from": "human", "value": "require 'metriks_addons/opentsdb_reporter'\nrequire 'metriks_addons/signalfx_reporter'\nrequire 'metriks_addons/cloudwatch_reporter'\n\nmodule MetriksAddons\n VERSION ...
ruby
chosen
[ { "from": "system", "value": "Add post request to notifications controller\n" }, { "from": "human", "value": "# frozen_string_literal: true\nRails.application.routes.draw do\n post 'notifications/coinbase'\n\n resources :verification_personals\n get 'verification/personal'\n get 'verificatio...
ruby
chosen
[ { "from": "system", "value": "Use 'delete' to log out users\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n root \"static_pages#home\"\n get '/help', to: 'static_pages#help'\n get '/about', to: 'static_pages#about'\n get '/contact', to: 'static_pages#contact'\n get '/s...
ruby
chosen
[ { "from": "system", "value": "Fix rake task so that a single sync failure wont stop the process\n" }, { "from": "human", "value": "desc \"Sync steam stats for recently logged in users\"\ntask :sync_stats => :environment do\n Player.where(:last_viewed.gte => 1.week.ago).each do |player|\n pla...
ruby
chosen
[ { "from": "system", "value": "Raise exceptions on save failures\n" }, { "from": "human", "value": "ENV[\"RACK_ENV\"] ||= \"development\"\n\nrequire 'bundler'\nBundler.setup\n\nBundler.require(:default, ENV[\"RACK_ENV\"].to_sym)\n\nDir[\"./lib/**/*.rb\"].each { |f| require f }\n\nDataMapper::Logg...
ruby
chosen
[ { "from": "system", "value": "Drop rake task for processing jobs.\n" }, { "from": "human", "value": "namespace :que do\n desc \"Process Que's jobs using a worker pool\"\n task :work => :environment do\n if defined?(::Rails) && Rails.respond_to?(:application)\n # ActiveSupport's depende...
ruby
chosen
[ { "from": "human", "value": "Add VolunteerMatch module to lib directory\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\n\nrequire 'rubygems'\nrequire 'base64'\nrequire 'digest/sha2'\nrequire 'net/http'\nrequire 'uri'\nrequire 'json'\nrequire 'ostruct'\n\nif ARGV.length == 2\n account_name...
ruby
chosen
[ { "from": "system", "value": "Move ENV check out further\n" }, { "from": "human", "value": "require 'pathname'\n\nmodule FasterPath\n module MonkeyPatches\n def self._ruby_core_file!\n ::File.class_eval do\n if ENV['WITH_REGRESSION']\n def self.basename(pth, ext = '')\n ...
ruby
chosen
[ { "from": "system", "value": "Add next_migration_number method for generator\n" }, { "from": "human", "value": "require 'rails/generators/migration'\n\nclass SetlerGenerator < Rails::Generators::NamedBase\n include Rails::Generators::Migration\n \n argument :name, type: :string, default: \"se...
ruby
chosen
[ { "from": "system", "value": "Add before_fork to disconnect from DB\n\nPer the puma README: https://github.com/puma/puma#clustered-mode\n" }, { "from": "human", "value": "workers Integer(ENV['WEB_CONCURRENCY'] || 2)\nthreads_count = Integer(ENV['MAX_THREADS'] || 5)\nthreads threads_count, thread...
ruby
chosen
[ { "from": "system", "value": "Remove models between tests (updated from dm-more/next).\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'test/unit'\nrequire 'shoulda'\n\n$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))\nrequire 'dm-tokyo-adapter'\n\nclass Test::Unit::Test...
ruby
chosen
[ { "from": "system", "value": "Return an array where every two elements are represented by true or false.\n" }, { "from": "human", "value": "# Write a method, match_maker, which will receive an unknown number of\n# elements, and return an array where every two elements are represented by true or ...
ruby
chosen
[ { "from": "system", "value": "Switch cli test to spec format.\n\nConflicts:\n\ttest/cli_test.rb\n" }, { "from": "human", "value": "require \"test_helper\"\n\nclass PlaygroundTest < Test::Unit::TestCase\n\n def test_responds_to_version\n IO.any_instance.expects(:puts)\n ARGV.clear\n ARG...
ruby
chosen
[ { "from": "system", "value": "Test that it retries jobs on error\n" }, { "from": "human", "value": "require \"spec_helper\"\n\nclass StubJob < ApplicationJob\n queue_as :high\n def perform(*args)\n raise NotImplementedError\n end\nend\n\nRSpec.describe ApplicationJob do\n include ActiveJo...
ruby
chosen
[ { "from": "system", "value": "Remove lock version from dev deps\n" }, { "from": "human", "value": "$LOAD_PATH.push File.expand_path('../lib', __FILE__)\n\n# Maintain your gem's version:\nrequire 'pg_ltree/version'\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |s...
ruby
chosen
[ { "from": "system", "value": "Fix failing tests caused by the adding of a placeholder image\n" }, { "from": "human", "value": "# encoding: UTF-8\n# coding: UTF-8\n# -*- coding: UTF-8 -*-\n\nrequire 'popit_watir_test_case'\nrequire 'pry'\nrequire 'net/http'\nrequire 'uri'\n\n\nclass PersonPhotoTe...
ruby
chosen
[ { "from": "system", "value": "Fix intermittent failure in declaration spec.\n" }, { "from": "human", "value": "class EnterDeclarationsOverlay < CardOverlay\n def declarations\n all('.declaration').map { |d| DeclarationFragment.new d }\n end\n\n def save_declarations\n click_on 'Save dec...
ruby
chosen
[ { "from": "human", "value": "Add reload_track_id task that reload id from playlistify api\n" }, { "from": "gpt", "value": "desc \"This task is called by the Heroku scheduler add-on\"\ntask :reload_track_ids => :environment do\n puts \"Reload track ids of #{Track.all.count} tracks\"\n\n i = 0\n...
ruby
chosen
[ { "from": "system", "value": "Remove empty require_paths directive from gemspec\n\nRubygems wants at least one path, so I'm just going to remove the\nsetting.\n" }, { "from": "human", "value": "Gem::Specification.new do |spec|\n spec.name = 'prefnerd'\n spec.version = '0.1'\n s...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary text from comment\n" }, { "from": "human", "value": "# encoding: utf-8\n\nmodule Axiom\n module Types\n\n # Represents a date time type\n class DateTime < Object\n extend ValueComparable\n\n # The maximum seconds and fractional se...
ruby
chosen
[ { "from": "system", "value": "Fix wire format -- add operations\n" }, { "from": "human", "value": "module Bridge\n # Wrapper for callbacks passed in as arguments.\n class LocalRef < Ref\n def initialize path, mod\n @mod = mod\n path = ['client', lambda {Core::client_id}] + path\n ...
ruby
chosen
[ { "from": "system", "value": "Print info when cleaning up a node\n" }, { "from": "human", "value": "require 'chef/knife'\n\nrequire 'knife-solo/ssh_command'\n\nclass Chef\n class Knife\n class SoloClean < Knife\n include KnifeSolo::SshCommand\n\n deps do\n require 'knife-sol...
ruby
chosen
[ { "from": "system", "value": "Add documentation for the Priority API\n" }, { "from": "human", "value": "module BacklogKit\n class Client\n module Priority\n def get_priorities\n get('priorities')\n end\n end\n end\nend\n" }, { "from": "gpt", "value": "module ...
ruby
chosen
[ { "from": "system", "value": "Make leave_group method work for realz\n" }, { "from": "human", "value": "module Groupable #:nodoc:\n\n def self.included(base)\n base.extend ClassMethods \n end\n\n module ClassMethods\n def acts_as_groupable\n has_and_belongs_to_many :groups\n ...
ruby
chosen
[ { "from": "system", "value": "Append local directory to path\n" }, { "from": "human", "value": "require 'cucumber/nagios'\nrequire 'webrat/adapters/mechanize'\nrequire 'webrat_logging_patches'\n\nclass ResponseHelper\n def response\n webrat_session.response\n end\nend\n\nWorld do\n Respons...
ruby
chosen
[ { "from": "system", "value": "Update gem with new client implementation\n" }, { "from": "human", "value": "Gem::Specification.new do |gem|\n gem.authors = [\"Jordan Sissel\"]\n gem.email = [\"jls@semicomplete.com\"]\n gem.description = \"lumberjack log transport library\"\n g...
ruby
chosen
[ { "from": "human", "value": "Add test to see blending in Canvas\n" }, { "from": "gpt", "value": "require 'ruby2d'\n\nset width: 800\nset height: 600\n\nSquare.new(size: 500, color: 'red')\n\n# Canvas options:\n# x, y, z, width, height, rotate, fill, color, update\n# If `update: false` is set, `...
ruby
chosen
[ { "from": "human", "value": "Add Simon Tatham's Puzzle Collection" }, { "from": "gpt", "value": "class Puzzles < Cask\n url 'http://www.chiark.greenend.org.uk/~sgtatham/puzzles/Puzzles.dmg'\n homepage 'http://www.chiark.greenend.org.uk/~sgtatham/puzzles/'\n version 'latest'\n sha256 :no_chec...
ruby
chosen
[ { "from": "system", "value": "Use slightly better error message when unable to find Sequel::Model instance\n" }, { "from": "human", "value": "class << FixtureDependencies\n private\n \n def add_associated_object_S(reflection, attr, object, assoc)\n if reflection[:type] == :one_to_one\n ...
ruby
chosen
[ { "from": "system", "value": "Add YARD docs for Faker::Ancient.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Faker\n class Ancient < Base\n class << self\n def god\n fetch('ancient.god')\n end\n\n def primordial\n fetch('ancient.prim...
ruby
chosen
[ { "from": "system", "value": "Allow for read / connection timeout to be defined in .percheron.yml as well as ssl_verify_peer true/false\n" }, { "from": "human", "value": "module Percheron\n class DockerConnection\n\n def initialize(config)\n @config = config\n end\n\n def setup!\n...
ruby
chosen
[ { "from": "system", "value": "Load Haml::Plugin earlier to overwrite template handler with fast_haml\n" }, { "from": "human", "value": "module FastHaml\n class Railtie < ::Rails::Railtie\n initializer :fast_haml do |app|\n require 'fast_haml/rails_handler'\n ActionView::Template.re...
ruby
chosen
[ { "from": "system", "value": "Add error type for required arguments.\n" }, { "from": "human", "value": "# encoding: utf-8\n\nmodule GithubCLI\n\n class GithubCLIError < StandardError\n def self.status_code(code)\n define_method(:status_code) { code }\n end\n end\n\n class ApiError ...
ruby
chosen
[ { "from": "system", "value": "Change the reference to process exec command.\n" }, { "from": "human", "value": "# encoding: utf-8\n\nmodule GithubCLI\n # This class provides methods for reading system settings.\n class System\n class << self\n\n # Checks if windows platform.\n def ...
ruby
chosen
[ { "from": "system", "value": "Add test cases to Sum of Multiples\n" }, { "from": "human", "value": "require 'minitest/autorun'\nrequire_relative 'sum_of_multiples'\n\nclass SumTest < Minitest::Test\n def test_sum_to_1\n assert_equal 0, SumOfMultiples.to(1)\n end\n\n def test_sum_to_3\n ...
ruby
chosen
[ { "from": "system", "value": "Remove the author from the title attribute\n" }, { "from": "human", "value": "module Kindle\n class BookTitle\n def self.from_kindle_format(note)\n title_author, *notes = *note.split(\"\\r\\n\")\n title_author\n end\n end\nend\n" }, { "from...
ruby
chosen
[ { "from": "system", "value": "Fix file permissions; Version bump to 0.5.1\n" }, { "from": "human", "value": "require 'guard'\nrequire 'guard/guard'\nrequire 'guard/watcher'\n\nmodule Guard\n class Shell < Guard\n\n VERSION = '0.5.0'\n\n # Calls #run_all if the :all_on_start option is pres...
ruby
chosen
[ { "from": "system", "value": "Fix swap of ahead/behind when performing git log\n" }, { "from": "human", "value": "class Comparison\n attr_accessor :lines, :behind, :ahead\n\n def initialize(ahead, behind)\n @ahead = ahead\n @behind = behind\n end\n\n def check\n @lines = log.lines\n...
ruby
chosen
[ { "from": "system", "value": "Remove `class << self` wrapper for config variables\n\nUsing `mattr_accessor` within the wrapper for modules can lead to\nconflicts with other modules that use the same variable names.\n\nFixes issue #44\n" }, { "from": "human", "value": "require 'rails'\n\nmodule S...
ruby
chosen
[ { "from": "system", "value": "Update Request to add strategy query parameter.\n" }, { "from": "human", "value": "require 'net/https'\nrequire 'uri'\n\nmodule PageSpeed\n class Request\n PAGESPEED_API_URL = 'https://www.googleapis.com/pagespeedonline/v1/runPagespeed'\n\n attr_accessor :url...
ruby
chosen
[ { "from": "system", "value": "Fix typo reported by @LtCmdDudefellah\n" }, { "from": "human", "value": "require 'socket'\nrequire 'debugger'\n\nmodule SpinalTap\n\n class Server\n def initialize(params = {})\n @host = params[:host] || '127.0.0.1'\n @port = params[:port] || 9000\n\n ...
ruby
chosen
[ { "from": "system", "value": "Set is designed for unique collections\n" }, { "from": "human", "value": "require \"name_finder/version\"\nrequire \"name_finder/node_proxy\"\nrequire \"name_finder/buffer\"\n\nclass NameFinder\n def initialize(tree={})\n @tree = tree\n @root = NodeProxy.new(...
ruby
chosen
[ { "from": "system", "value": "Make sure Sequel query is executed in spec\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe \"Sequel integration\", if: sequel_present? do\n let(:db) { Sequel.sqlite }\n\n before do\n start_agent\n end\n\n context \"with Sequel\" do\n b...
ruby
chosen
[ { "from": "system", "value": "Rename colliding variable `method` to `method_name`\n" }, { "from": "human", "value": "require 'abbrev'\n\nmodule Tunit\n class Spec\n def expect value\n Expect.new value, self\n end\n\n class Expect\n def initialize value, klass\n self.va...
ruby
chosen
[ { "from": "human", "value": "Add benchmark for proc vs call. [admin]\n" }, { "from": "gpt", "value": "require 'benchmark'\n\nclass ProcVsCall\n\n def initialize(&proc)\n @the_proc = proc\n end\n\n def the_proc\n @the_proc ||= Proc.new{ |*x| x }\n end\n\n def call(*x)\n @the_proc ? ...
ruby
chosen
[ { "from": "system", "value": "Update manageiq-appliance_console to minimum v1.2.2\n\nhttps://bugzilla.redhat.com/show_bug.cgi?id=1527915\n" }, { "from": "human", "value": "# Add gems here, in Gemfile syntax, which are dependencies of the appliance itself rather than a part of the ManageIQ applic...
ruby
chosen
[ { "from": "system", "value": "Switch from using 'logname' to using 'id -un'.\n\nOur cloudbees CI instance has id but not logname and from experience I\nhave never seen a unixy machine missing 'id'. Additionally, this should\nwork a tiny bit better for testing on windows. Cygwin does ship 'logname',\nbut m...
ruby
chosen
[ { "from": "human", "value": "Create some tests for local snapshot\n" }, { "from": "gpt", "value": "require 'minitest/autorun'\nrequire File.expand_path('../../test_helper', __FILE__)\nrequire 'tmpdir'\n\nclass LocalSnapshotRequestsTest < MiniTest::Unit::TestCase\n def setup\n @td = Pathname....
ruby
chosen
[ { "from": "system", "value": "Add a runtime dependency on Rails 3\n" }, { "from": "human", "value": "# encoding: utf-8\n\nGem::Specification.new do |gem|\n gem.name = \"figaro\"\n gem.version = \"0.1.0\"\n\n gem.authors = [\"Steve Richert\"]\n gem.email = [\"steve.richert@gmail....
ruby
chosen
[ { "from": "system", "value": "Fix bug in parent registration spec\n" }, { "from": "human", "value": "module Features\n module ApplicationHelpers\n\n def log_in_as_student(student = nil)\n if student.nil?\n student = create(:student)\n student.user.update(phone_verified: tr...
ruby
chosen
[ { "from": "system", "value": "Read all messages as binary.\n\nMessages read by several of the scripts were not read as binary. Ensure\nthat binary mode is used, since we cannot guarantee that the files are\nin the locale encoding.\n\nSigned-off-by: brian m. carlson <738bdd359be778fee9f0fc4e2934ad72f436ceda...
ruby
chosen
[ { "from": "system", "value": "Add monkey path for Object class\n" }, { "from": "human", "value": "require \"nil_conditional/version\"\n\nmodule NilConditional\n # Your code goes here...\nend\n" }, { "from": "gpt", "value": "require \"nil_conditional/version\"\n\nmodule NilConditiona...
ruby
chosen
[ { "from": "system", "value": "Add missing mime-types to Rack based on those used by loaded writers.\n" }, { "from": "human", "value": "require 'rack'\nrequire 'linkeddata'\n\nmodule Rack\n module LinkedData\n autoload :ContentNegotiation, 'rack/linkeddata/conneg'\n autoload :VERSION, ...
ruby
chosen
[ { "from": "system", "value": "Add Code for America contact information" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"gem_template/version\"\n\nGem::Specification.new do |s|\n s.name = \"gem_template\"\n s.version ...
ruby
chosen
[ { "from": "system", "value": "Fix load hook for Titleist\n" }, { "from": "human", "value": "# typed: strong\nmodule Titleist\n # Extensions into the Rails framework that mixin the controller and\n # helper modules when ActionController and ActionView are loaded.\n class Engine < Rails::Engine...
ruby
chosen
[ { "from": "system", "value": "Update the EventMachine version dependency\n" }, { "from": "human", "value": "spec = Gem::Specification.new do |s|\n s.name = \"hector\"\n s.version = \"1.0.9\"\n s.platform = Gem::Platform::RUBY\n s.authors = [\"Sam Stephenson\", \"Ross Pa...
ruby
chosen
[ { "from": "system", "value": "Add descendants entrypoint for the gems main api\n" }, { "from": "human", "value": "require 'active_support/all'\nrequire 'poms/api/media'\nrequire 'poms/errors/authentication_error'\nrequire 'json'\n\n# Main interface for the POMS gem\nmodule Poms\n extend self\n ...
ruby
chosen