conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Update included Node to latest LTS version\n" }, { "from": "human", "value": "require 'json'\n\nclass LanguagePack::Helpers::Nodebin\n URL = \"https://nodebin.herokai.com/v1/\"\n\n def self.query(q)\n response = Net::HTTP.get_response(URI(\"#{URL}/#{q}\"))\n ...
ruby
chosen
[ { "from": "human", "value": "Add the podspec back to the tree.\n" }, { "from": "gpt", "value": "Pod::Spec.new do |s|\n\ts.name = 'FreeStreamer'\n\ts.version = '2.9.11'\n\ts.license = 'BSD'\n\ts.summary = 'A low-memory footprint streaming...
ruby
chosen
[ { "from": "system", "value": "Use StatsD.logger for logger backend\n" }, { "from": "human", "value": "require 'logger'\n\nmodule StatsD::Instrument::Environment\n extend self\n\n def default_backend\n case environment\n when 'production'\n StatsD::Instrument::Backends::UDPBackend.ne...
ruby
chosen
[ { "from": "system", "value": "Change clean_path to preserve_paths in podspec to pass validation\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'SSZipArchive'\n s.version = '0.2.2'\n s.summary = 'Utility class for zipping and unzipping files on iOS and Mac...
ruby
chosen
[ { "from": "system", "value": "Use changed? to check for equality as well.\n" }, { "from": "human", "value": "module LooseChange\n class Base\n \n include ActiveModel::AttributeMethods\n include ActiveModel::Validations\n include ActiveModel::Serialization\n include ActiveModel::S...
ruby
chosen
[ { "from": "system", "value": "Fix load of noop database rake tasks\n" }, { "from": "human", "value": "require 'mongo_doc'\nrequire 'rails'\nrequire 'mongo_doc/railties/config'\n\nmodule MongoDoc\n class Railtie < Rails::Railtie\n initializer \"mongo_doc db configuration\" do |app|\n Mon...
ruby
chosen
[ { "from": "system", "value": "Add more useful Event methods\n" }, { "from": "human", "value": "class Event < `$.Event`\n def current_target\n %x{\n return $(#{self}.currentTarget);\n }\n end\n\n def target\n %x{\n if (#{self}._opalTarget) {\n return #{self}._opalTarg...
ruby
chosen
[ { "from": "system", "value": "Fix typo in stream controller\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\nrequire 'rubygems'\nrequire 'daemons'\n\nDaemons.run(File.join(File.dirname(__FILE__), 'streaming.rb')\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\n\nrequire...
ruby
chosen
[ { "from": "system", "value": "Document the TeamsController class and remove a superfluous require.\n" }, { "from": "human", "value": "# lib/frecon/controllers/teams_controller.rb\n#\n# Copyright (C) 2014 Christopher Cooper, Sam Craig, Tiger Huang, Vincent Mai, Sam Mercier, and Kristofer Rye\n#\n...
ruby
chosen
[ { "from": "human", "value": "Change url field to TEXT because urls can be long\n" }, { "from": "gpt", "value": "Sequel.migration do\n up do\n alter_table :links do\n set_column_type :url, Text\n end\n end\n\n down do\n alter_table :links do\n set_column_type :url, String\n ...
ruby
chosen
[ { "from": "system", "value": "Rename the last occurrence of UnexpectedParameters\n" }, { "from": "human", "value": "require 'abstract_unit'\nrequire 'action_controller/metal/strong_parameters'\n\nclass RaiseOnUnpermittedParametersTest < ActiveSupport::TestCase\n def setup\n ActionController:...
ruby
chosen
[ { "from": "human", "value": "Test monk install actually installs libs in .gems.\n" }, { "from": "gpt", "value": "require File.expand_path(\"helper\", File.dirname(__FILE__))\n\nprepare do\n FileUtils.rm_rf(TARGET)\nend\n\ntest \"installs the gems listed in the manifest\" do\n monk(\"init #{TAR...
ruby
chosen
[ { "from": "system", "value": "Update podspec for 0.7.0 release\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n\n s.name = \"SwiftCloudant\"\n s.version = \"0.6.0\"\n s.summary = \"SwiftCloudant is a client library for Apache CouchDB / IBM Cloudant from Swift 3\"\n...
ruby
chosen
[ { "from": "system", "value": "Add documentation to the statistic string\n" }, { "from": "human", "value": "require \"delegate\"\n\nmodule Bable\n class StatisticString < SimpleDelegator\n WORD_REGEX = /\\w+/\n SENTENCE_REGEX = /[^\\s.?!:][^.?!:]*[.?!:]+/\n\n def words\n scan(W...
ruby
chosen
[ { "from": "system", "value": "Fix for ruby 1.9.2 issues\n" }, { "from": "human", "value": "module Deface\n module TemplateHelper\n\n # used to find source for a partial or template using virutal_path\n def load_template_source(virtual_path, partial)\n parts = virtual_path.split(\"/\"...
ruby
chosen
[ { "from": "system", "value": "Upgrade to compo 0.3.x (x >= 1).\n\nThis allows us to use compo's UrlFinder instead of bra's Finder.\nUrlFinder is basically the same code, so this shouldn't break anything.\n" }, { "from": "human", "value": "require 'compo'\n\nmodule Bra\n module Model\n # A vi...
ruby
chosen
[ { "from": "system", "value": "Remove unused methods from Cache\n\nCache methods that were only used by the warmer are now in the warmer,\nso there's no need for them here.\n" }, { "from": "human", "value": "module Firebolt\n class Cache\n def self.cache_key(key_suffix)\n \"#{::Firebolt....
ruby
chosen
[ { "from": "system", "value": "Add support for default port\n" }, { "from": "human", "value": "require \"foreman/kicker/version\"\nrequire \"foreman/kicker/executor\"\nrequire \"foreman/kicker/watchdog\"\n\nmodule Foreman\n module Kicker\n def self.kick(*args)\n @watchdog = Foreman::Kick...
ruby
chosen
[ { "from": "system", "value": "Fix Nil dereference error on empty result\n\nWhen no results are returned from a list query, the `first` accessor crashes" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule GirlScout\n class List < GirlScout::Object\n include Enumerable\n\n...
ruby
chosen
[ { "from": "system", "value": "Remove support for per-formatter output direction\n" }, { "from": "human", "value": "require \"capybara\"\n\nmodule Konacha\n class Runner\n def self.start\n new.run\n end\n\n attr_reader :reporter\n\n def initialize\n @reporter = Konacha::Rep...
ruby
chosen
[ { "from": "human", "value": "Add GPS 2.3 Ruby Assignment\n" }, { "from": "gpt", "value": "# Your Names\n# 1)\n# 2)\n\n# We spent [#] hours on this challenge.\n\n# Bakery Serving Size portion calculator.\n\ndef serving_size_calc(item_to_make, num_of_ingredients)\n library = {\"cookie\" => 1, \"c...
ruby
chosen
[ { "from": "system", "value": "Fix misspelled word: Unpcker -> Unpacker\n" }, { "from": "human", "value": "module MessagePack\n\n # MessagePack::Time provides packer and unpacker functions for a timestamp type.\n # @example Setup for DefaultFactory\n # MessagePack::DefaultFactory.register_ty...
ruby
chosen
[ { "from": "system", "value": "Add url key to env hash with a URI value\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'faraday'\n\nmodule BitBucket\n module Request\n class OAuth < Faraday::Middleware\n include BitBucket::Utils::Url\n\n AUTH_HEADER = 'Authorizatio...
ruby
chosen
[ { "from": "system", "value": "Change generated database name to underscore\n" }, { "from": "human", "value": "namespace :db do\n desc \"Create database for environment in DB_ENV, with optional DB_USER and DB_PASS\"\n task :create do\n unless ENV.member?('DB_ENV')\n raise 'Please provid...
ruby
chosen
[ { "from": "system", "value": "Remove protected to be able to access it\n" }, { "from": "human", "value": "module ElectricSheeps\n module Metadata\n class Command\n include Options\n include Metered\n\n optionize :id, :type\n\n def agent\n Agents::Register.command(t...
ruby
chosen
[ { "from": "human", "value": "Add action to update all installed fastlane tools\n" }, { "from": "gpt", "value": "require 'rubygems/spec_fetcher'\nrequire 'rubygems/commands/update_command'\nrequire \"open3\"\n\nmodule Fastlane\n module Actions\n # Makes sure fastlane tools are up-to-date when...
ruby
chosen
[ { "from": "system", "value": "Set default locale to DE\n" }, { "from": "human", "value": "require 'open-uri'\nrequire 'json'\n\nmodule RubyGenderize\n API_BASE_URI = \"http://api.genderize.io\"\n\n class Guesser\n def self.male? name\n gender = guess_gender name\n gender.male?\n ...
ruby
chosen
[ { "from": "system", "value": "Fix camelize method of StringEx module\n" }, { "from": "human", "value": "module Slatan\n module Utils\n module StringEx\n refine String do\n def camelize\n self.split('_').map(&:capitalize).join\n end\n end\n end\n end\nend\...
ruby
chosen
[ { "from": "system", "value": "Update Rails to version 2.3.8.\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file\n\n# Specifies gem version of Rails to use when vendor/rails is not present\nRAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION\n\...
ruby
chosen
[ { "from": "system", "value": "Remove redundant transaction wrapper in new cluster rake task\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nnamespace :db do\n task new_cluster: :environment do\n ActiveRecord::Base.transaction do\n cluster = generate_cluster\n ad...
ruby
chosen
[ { "from": "system", "value": ":bug: Fix source han code jp font install error\n\nThe source URL should be quote using double quote to replace version string.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n# https://github.com/adobe-fonts/source-han-code-jp/archive/2.011R.tar...
ruby
chosen
[ { "from": "system", "value": "Add rake as a development dependency.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/hexillion/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Louis Simoneau\"]\n gem.email = [...
ruby
chosen
[ { "from": "system", "value": "Fix edge case with nil result\n" }, { "from": "human", "value": "class Cassandra::Mapper\n BATCH_SIZE = 100\n\n def insert(hash)\n data = InsertData.new config, hash\n keyspace.insert table, data.packed_keys, data.columns\n data.converted\n end\n\n def ...
ruby
chosen
[ { "from": "system", "value": "Update rake requirement from ~> 12.3 to ~> 13.0\n\nUpdates the requirements on [rake](https://github.com/ruby/rake) to permit the latest version.\n- [Release notes](https://github.com/ruby/rake/releases)\n- [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc)\n- [...
ruby
chosen
[ { "from": "system", "value": "Set the track to playing after scrobbling\n" }, { "from": "human", "value": "require \"lastfm\"\n\nmodule RackitScrobbler\n module LastFm\n class Client\n\n attr_accessor :lastfm_instance\n\n def initialize\n @lastfm_instance = Lastfm.new(LastFm...
ruby
chosen
[ { "from": "system", "value": "Update spacing in response text\n" }, { "from": "human", "value": "module SlackResponder\n # Reponds to Slack slash command and mentions.\n class CommandHandler\n def response\n tour\n end\n\n private\n\n def tour\n '*Welcome to slashrocket!*...
ruby
chosen
[ { "from": "system", "value": "Use bundler to load dependencies in the example app.\n" }, { "from": "human", "value": "dir = File.expand_path('..', __FILE__)\n$:.unshift(dir + '/../lib')\n$:.unshift(dir)\n\nrequire 'songkick/oauth2/provider'\nSongkick::OAuth2::Provider.realm = 'Notes App'\n\nrequ...
ruby
chosen
[ { "from": "system", "value": "Remove requirement as name attribute is always required.\n" }, { "from": "human", "value": "#\n# Cookbook: rabbitmq-cluster\n# License: Apache 2.0\n#\n# Copyright (C) 2015 Sunggun Yu <sunggun.dev@gmail.com>\n# Copyright (C) 2015 Bloomberg Finance L.P.\n#\n\nclass Ch...
ruby
chosen
[ { "from": "system", "value": "Whitelist the school profile attributes for profile updating" }, { "from": "human", "value": "class School::ParameterSanitizer < Devise::ParameterSanitizer\n def sign_up\n default_params.permit(\n :name,\n :town_id,\n :address,\n :contact_nam...
ruby
chosen
[ { "from": "system", "value": "Add user_id to innovation serializer\n" }, { "from": "human", "value": "class InnovationSerializer < ActiveModel::Serializer\n attributes :id, :title, :abstract, :body, :consented, :novelty_score, :value_score, :usability_score, :tooling_score, :lifespan_score\n\n ...
ruby
chosen
[ { "from": "system", "value": "Remove options hash from restaurant serializers, not it use\n" }, { "from": "human", "value": "class RestaurantSerializer\n attr_reader :record, :options\n\n def initialize(record, options = {})\n @record = record\n @options = options\n end\n\n def to_has...
ruby
chosen
[ { "from": "system", "value": "Improve name validation for cluster\n" }, { "from": "human", "value": "# ClusterNameValidator\n#\n# Custom validator for ClusterName.\nclass ClusterNameValidator < ActiveModel::EachValidator\n def validate_each(record, attribute, value)\n if record.user?\n ...
ruby
chosen
[ { "from": "system", "value": "Update of sponsor policy tests\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe SponsorPolicy, type: :policy do\n subject { described_class }\n\n permissions :create? do\n it \"should allow create if user in sponsor_admins\" do\n commi...
ruby
chosen
[ { "from": "human", "value": "Add tests for the Attribute class\n" }, { "from": "gpt", "value": "require 'minitest_helper'\nrequire 'json'\nclass AttributeTest < Minitest::Test\n\n test \"value returns value if present\" do\n assert_equal \"v\", GoogleContacts::Attribute.new({\"value\" => \"v...
ruby
chosen
[ { "from": "system", "value": "Add more robust \"check args\" tests\n" }, { "from": "human", "value": "# rubocop:disable Style/FileName\nrequire 'test_helper'\n\nclass GraphQLDocsTest < Minitest::Test\n def test_that_it_requires_a_file_or_url\n assert_raises ArgumentError do\n GraphQLDoc...
ruby
chosen
[ { "from": "system", "value": "Set pod swift version to 4.2\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'Bulldog'\n s.version = '1.0.0'\n s.license = { :type => 'MIT', :file => 'LICENSE' }\n s.summary = 'Bulldog is a super-fast json parser that will keep attacking until...
ruby
chosen
[ { "from": "system", "value": "Make generator less noisy in spec output\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'rails/generators'\nrequire 'redlock'\n\nfeature 'Creating a new Work', :workflow do\n before do\n Rails::Generators.invoke('hyrax:work', ['Catapult'], des...
ruby
chosen
[ { "from": "system", "value": "Remove channel prefix from specs" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe PusherController do\n describe \"#auth\" do\n describe \"when authenticating to a group channel\" do\n it \"only allows members of a group to authenticate to...
ruby
chosen
[ { "from": "human", "value": "Add tests for reset filters button.\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\nfeature 'Filter Resetter', feature: true do\n include WaitForAjax\n\n let(:project) { create(:project, :public) }\n let(:milestone) { create(:milestone, project: pro...
ruby
chosen
[ { "from": "system", "value": "Use the build-essential resource not the recipe\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "#\n# Cookbook:: test\n# Recipe:: default\n#\n# Copyright:: 2016-2017, Chef Software, Inc.\n\nnode.defaul...
ruby
chosen
[ { "from": "system", "value": "Add basic support for setting Cannon environment\n" }, { "from": "human", "value": "module Cannon\n class App\n attr_reader :routes, :app_binding\n attr_accessor :middleware, :public_path\n\n def initialize(app_binding, middleware: [], public_path: 'public...
ruby
chosen
[ { "from": "system", "value": "Add an user friendly message for 'config missing'\n" }, { "from": "human", "value": "require 'yaml'\n\nmodule GitlabCli\n autoload :Command, 'gitlab_cli/command'\n autoload :Config, 'gitlab_cli/config'\n autoload :Project, 'gitlab_cli/...
ruby
chosen
[ { "from": "system", "value": "Add requires for json/ld, rdf/turtle and rdf/microdata\n" }, { "from": "human", "value": "module LinkedData\n # @see http://rubygems.org/gems/rdf\n require 'rdf'\n require 'rdf/ntriples'\n require 'rdf/nquads'\n\n # @see http://rubygems.org/gems/rdf-isomorphic\...
ruby
chosen
[ { "from": "system", "value": "Fix tag in Podspec .source attribute\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'Lockbox'\n s.version = '3.0.0'\n s.license = 'MIT'\n s.summary = 'Lockbox is an Objective-C utility class for storing data securely in the keychain. U...
ruby
chosen
[ { "from": "system", "value": "Test the performance of the job\n" }, { "from": "human", "value": "require 'test_helper'\n\ndescribe ReleaseEpisodesJob do\n\n let(:podcast) { create(:podcast, prx_uri: '/api/v1/series/20829') }\n\n let(:job) { ReleaseEpisodesJob.new }\n\n it 'gets a list of podc...
ruby
chosen
[ { "from": "system", "value": "Extend formula to build in subdir\n" }, { "from": "human", "value": "class Openfpgaloader < Formula\n desc \"JTAG loader for various FPGA\"\n homepage \"https://github.com/trabucayre/openFPGALoader\"\n head \"https://github.com/trabucayre/openFPGALoader.git\"\n\n...
ruby
chosen
[ { "from": "system", "value": "Add the warning comment about flipping Board's internal state\n" }, { "from": "human", "value": "require_relative 'board'\nrequire_relative 'human_player'\n\nclass Checkers\n \n def initialize\n self.board = Board.new\n \n self.players = [\n HumanPla...
ruby
chosen
[ { "from": "system", "value": "Add test for no suffix\n" }, { "from": "human", "value": "describe String do\n it '#iec60027_2' do\n expect(\"1 Ki\".iec_60027_2_to_i).to eq(1_024)\n expect(\"1 Mi\".iec_60027_2_to_i).to eq(1_048_576)\n expect(\"1 Gi\".iec_60027_2_to_i).to eq(1_073_741_824...
ruby
chosen
[ { "from": "system", "value": "Test to see error CLIXML\n" }, { "from": "human", "value": "# Copyright 2016 Nordstrom, 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 obtain a copy of the L...
ruby
chosen
[ { "from": "system", "value": "Fix typo in versioned route option\n" }, { "from": "human", "value": "module JsonApiRoutes\n VALID_IDS = /[0-9]*/\n \n def id_constraint(path)\n { :\"#{ path.to_s.singularize }_id\" => VALID_IDS }\n end\n \n def create_links(path, links)\n links_regex = ...
ruby
chosen
[ { "from": "human", "value": "Add some silly tests for report generation\n" }, { "from": "gpt", "value": "class TestReportGeneration < Test::Unit::TestCase\n Report = Brakeman.run(\"#{TEST_PATH}/apps/rails3.2\").report\n\n def test_html_sanity\n report = Report.to_html\n\n assert report.i...
ruby
chosen
[ { "from": "system", "value": "Use RSpec.describe instead of just describe\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe DownloadService do\n subject { DownloadService }\n\n context 'windows', :vcr do\n before do\n subject.download_windows_versions\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Extend local manpages to Topics menus\n\nAs much as possible, readers who have selected their language would\nlike to remain with translated content.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule DocHelper\n\n def man(name, text = nil)\...
ruby
chosen
[ { "from": "system", "value": "Add color for status glyphicon\n" }, { "from": "human", "value": "module Glyphicons\n\n def glyphicon(name)\n \"<span class=\\\"glyphicon glyphicon-#{name}\\\"></span>\".html_safe\n end\n\n def status_span(status)\n glyphicon(glyphicon_for_status(status))\n...
ruby
chosen
[ { "from": "system", "value": "Add course type uniqueness validation\n" }, { "from": "human", "value": "class CourseType < ActiveRecord::Base\n has_many :courses\n\n validates :name, :presence => true\nend\n" }, { "from": "gpt", "value": "class CourseType < ActiveRecord::Base\n has...
ruby
chosen
[ { "from": "system", "value": "8394: Fix issue with handling of OGG files in new paperclip version\n" }, { "from": "human", "value": "class Media::Audio < Media::Object\n validates_attachment_content_type :item, content_type: [%r{\\Aaudio/.*\\Z}, 'video/webm']\n validates_attachment_file_name :...
ruby
chosen
[ { "from": "system", "value": "Sort loaded files in alphavetical order\n" }, { "from": "human", "value": "# gems\nrequire \"mechanize\"\n\n# libraries\nrequire \"syoboi_calendar/version\"\nrequire \"syoboi_calendar/agent\"\nrequire \"syoboi_calendar/title\"\nrequire \"syoboi_calendar/program\"\nr...
ruby
chosen
[ { "from": "system", "value": "Remove cursor checking, since it gives few more additional errors\n" }, { "from": "human", "value": "require 'json'\nrequire 'psych'\n\nclass WarningCounter < XCPretty::Simple\n def initialize(use_unicode, colorize)\n super\n @warnings_hash = Set.new()\n @...
ruby
chosen
[ { "from": "system", "value": "Use string for hash keys\n" }, { "from": "human", "value": "module WebPay\n class Customer < Entity\n install_class_operations :create, :retrieve, :all\n\n attr_accessor :updated_attributes\n\n def self.path\n '/customers'\n end\n\n def initiali...
ruby
chosen
[ { "from": "system", "value": "Use case sensitive version of English.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'english'\n\nlib = File.expand_path('lib', __dir__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'missingly/version'\n\nGem::Speci...
ruby
chosen
[ { "from": "system", "value": "Add code comments to gemspec\n" }, { "from": "human", "value": "# coding: utf-8\n\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'xcode/install/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Change CLAide dependency to allow 1.0.x versions\n\nFixes #112\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'xcode/install/version'\n\nGem::Specificat...
ruby
chosen
[ { "from": "human", "value": "Add day 02: Elevator Keypad\n" }, { "from": "gpt", "value": "parts = [{\n keypad: [\n [1, 2, 3],\n [4, 5, 6],\n [7, 8, 9],\n ],\n admit: ->(row, col) { [row, col].all? { |c| 0 <= c && c <= 2 } }\n}, {\n keypad: [\n [nil, nil, 1, nil, nil],\n [nil,...
ruby
chosen
[ { "from": "system", "value": "Use lambda instead of alias\n" }, { "from": "human", "value": "# encoding: utf-8\nrequire 'rubygems'\nrequire 'sinatra'\nrequire 'haml'\nrequire 'uri'\n\nget \"/\" do\n haml :index\nend\n\nget \"/create\" do\n @list = create(params)\n @width = params[:width].to_i...
ruby
chosen
[ { "from": "system", "value": "Add test-unit dependency for 2.2\n" }, { "from": "human", "value": "require File.expand_path('../lib/rack/revision/version', __FILE__)\n\nGem::Specification.new do |s|\n s.name = \"rack-revision\"\n s.version = Rack::Revision::VERSION\n s.summary =...
ruby
chosen
[ { "from": "system", "value": "Reorder methods to put initialize at top\n" }, { "from": "human", "value": "class Database\n def sanitized_entries_in\n dirty_entries = each_database_entry(@filename) do |entry|\n yield entry.to_s.strip\n end\n end\n\n def initialize(filename)\n @fi...
ruby
chosen
[ { "from": "system", "value": "Use proper env variable set by Travis to figure out which DB to generate\n" }, { "from": "human", "value": "namespace :refinery do \n namespace :testing do\n desc \"Generates a dummy app for testing\"\n task :dummy_app do\n require \"refinerycms\"\n\n ...
ruby
chosen
[ { "from": "system", "value": "Add cloud_entry_point_url that is added by 78b6bba to factory file.\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# Copyright 2014 TIS Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in c...
ruby
chosen
[ { "from": "system", "value": "Fix a test accidentally leaving User::SKIP_EMAIL_VALIDATION state dirty" }, { "from": "human", "value": "describe User do\n describe '#new' do\n it 'Creates a new user' do\n expect(User.new).to be_kind_of(User)\n end\n end\n\n describe 'SKIP_EMAIL_VALI...
ruby
chosen
[ { "from": "system", "value": "Fix due to syntax change in simplecov 0.11\n" }, { "from": "human", "value": "MINIMUM_COVERAGE = 68\n\nunless ENV['COVERAGE'] == 'off'\n require 'simplecov'\n require 'simplecov-rcov'\n require 'coveralls'\n Coveralls.wear!\n\n SimpleCov.formatter = SimpleCov::...
ruby
chosen
[ { "from": "system", "value": "Update spec to reflect new method name\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe ROM::Config do\n let(:root) { '/somewhere' }\n\n describe '.rewrite_config' do\n it 'rewrites database config hash to a URI for sqlite' do\n db_conf...
ruby
chosen
[ { "from": "system", "value": "Make the Warning.warn specs work indepent of the external warning level\n" }, { "from": "human", "value": "require File.expand_path(\"../../../spec_helper\", __FILE__)\n\ndescribe \"Warning.warn\" do\n ruby_version_is \"2.4\" do\n it \"complains\" do\n -> {...
ruby
chosen
[ { "from": "system", "value": "Fix direct restore after backup upload.\n" }, { "from": "human", "value": "# Backup Controller\nclass BackupsController < AttachmentsController\n defaults :resource_class => Backup\n\n def create\n @backup = Backup.new(params[:backup])\n if @backup.save\n ...
ruby
chosen
[ { "from": "system", "value": "Sort posts by score and published_at\n" }, { "from": "human", "value": "class PostSearchResultSet\n attr_reader :site\n\n def initialize(groonga_posts:, site:, query:, page:)\n @groonga_posts = groonga_posts\n @site = site\n @query = query\n @page = pa...
ruby
chosen
[ { "from": "system", "value": "Remove dev dependencies' version constraints\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path(\"../lib\", __FILE__)\n\nGem::Specification.new do |s|\n s.name = \"bcnd\"\n s.version = \"0.2.0\"\n s.authors = ['Kazunori Kajihiro...
ruby
chosen
[ { "from": "system", "value": "Replace accumulator by using each_cons\n" }, { "from": "human", "value": "class Series\n def initialize(series)\n @series = series\n end\n\n def slices(slice_length)\n raise ArgumentError if slice_length > series.length\n number_slices = series.length - ...
ruby
chosen
[ { "from": "system", "value": "Use exit code 1 on YAML lint failure\n" }, { "from": "human", "value": "require 'yaml'\n\npath = File.expand_path('../members', File.dirname(__FILE__))\n\nDir.glob(path + '/*.yaml') do |f|\n begin\n File.open(f) do |data|\n YAML.load(data)\n end\n rescu...
ruby
chosen
[ { "from": "human", "value": "Add tests to validate the do not trace option\n" }, { "from": "gpt", "value": "require 'minitest_helper'\nrequire 'rack/test'\nrequire 'rack/lobster'\nrequire 'oboe/inst/rack'\n\nclass RackTestApp < Minitest::Test\n include Rack::Test::Methods\n\n def app\n @app...
ruby
chosen
[ { "from": "system", "value": "Handle the situation when the comments of answer is nil, Expertiza should still ba able to append an empty string as comments.\n" }, { "from": "human", "value": "class TextField < TextResponse\n def complete(count, answer = nil)\n html = if self.type == 'TextFie...
ruby
chosen
[ { "from": "system", "value": "Fix a bug with bad file required in samples.\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire File.dirname(__FILE__) + '/lib/microsoft_push_notification_service'\n\nputs \"=== Test ===\"\n\nuri = \"<# Your Microsoft Push URI here #>\"\n\n#\n# => TOAST...
ruby
chosen
[ { "from": "system", "value": "test/cli: Add `kbsecret conf` flag tests\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire \"helpers\"\n\n# tests cli command: list\nclass CLIConfTest < Minitest::Test\n include Aruba::Api\n include Helpers\n include Helpers::CLI\n\n de...
ruby
chosen
[ { "from": "system", "value": "Add gem Rubocop (only development environment)\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'gimei/version'\n\nGem::Specification.new do |ge...
ruby
chosen
[ { "from": "system", "value": "Fix `url` stanza comment for Deep Dreamer.\n" }, { "from": "human", "value": "cask 'deep-dreamer' do\n version :latest\n sha256 :no_check\n\n url 'https://dl.devmate.com/com.realmacsoftware.deepdreamer/DeepDreamer.zip'\n name 'Deep Dreamer'\n homepage 'http://r...
ruby
chosen
[ { "from": "system", "value": "Use OTF version of Quivira font\n" }, { "from": "human", "value": "class FontQuivira < Cask\n url 'http://www.quivira-font.com/files/Quivira.ttf'\n homepage 'http://www.quivira-font.com/downloads.php'\n version '3.8'\n sha256 :no_check\n font 'Quivira.ttf'\nend...
ruby
chosen
[ { "from": "system", "value": "Add spec for special string sequence\n" }, { "from": "human", "value": "require \"spec_helper\"\n\nmodule Scanny::Checks\n describe InputFilteringCheck do\n before do\n @runner = Scanny::Runner.new(InputFilteringCheck.new)\n @message = \"Possible inje...
ruby
chosen
[ { "from": "human", "value": "Add basic specs for database provider.\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\nprovider_class = Puppet::Type.type(:database).provider(:mysql)\n\ndescribe provider_class do\n subject { provider_class }\n\n let(:root_home) { '/root' }\n let(:defaul...
ruby
chosen
[ { "from": "system", "value": "Fix character exceeding 80 chars.\n" }, { "from": "human", "value": "require File.expand_path(\"helper\", File.dirname(__FILE__))\n\nprepare do\n FileUtils.rm_rf(TARGET)\nend\n\n# monk add NAME REPOSITORY\nscope do\n test \"add the named repository to the configur...
ruby
chosen
[ { "from": "system", "value": "Add generator detector for env\n" }, { "from": "human", "value": "module Apperol\n class AppJson\n def initialize(file_path = 'app.json')\n @file_path = file_path\n end\n\n def env\n __json__[\"env\"].map do |key, definition|\n AppJson::En...
ruby
chosen
[ { "from": "system", "value": "Fix specs to run on ActiveRecord 5\n" }, { "from": "human", "value": "require 'active_record'\n\nActiveRecord::Base.establish_connection(:adapter=>'sqlite3', :database=>File.join(File.dirname(File.expand_path(__FILE__)), 'db', 'fd_spec.sqlite3'))\n\nclass Artist < A...
ruby
chosen
[ { "from": "system", "value": "Remove the newgem demo spec\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + '/spec_helper.rb'\n\n# Time to add your specs!\n# http://rspec.rubyforge.org/\ndescribe \"Place your specs here\" do\n \n it \"find this spec in spec directory\" do\n ...
ruby
chosen