conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Change main class name to match Gem name\n" }, { "from": "human", "value": "require 'parse-model-scaffold/parse_api'\nrequire 'parse-model-scaffold/parse_inspector'\nrequire 'parse-model-scaffold/parse_class_builder'\n\nclass ParseModelGenerator\n\n def initializ...
ruby
chosen
[ { "from": "system", "value": "Add ERB support in YAML files" }, { "from": "human", "value": "require 'yaml'\n\nmodule Persey\n module Adapters\n class Yaml < Persey::Adapters::Base\n class << self\n def load(file, env)\n begin\n raw_hash = YAML.load_file(file)...
ruby
chosen
[ { "from": "system", "value": "Use chr instead of pack\n\nIt expresses the intention more clearly, and it's about twice as fast.\n" }, { "from": "human", "value": "class HTMLEntities\n class Decoder #:nodoc:\n def initialize(flavor)\n @flavor = flavor\n @map = HTMLEntities::MAPPINGS...
ruby
chosen
[ { "from": "system", "value": "Refactor code to allow any params.\n" }, { "from": "human", "value": "class QuoteDisplayer\n attr_reader :quotes\n\n def initialize(app)\n @app = app #rails application\n @quotes= IO.readlines('lib/fixtures/rickygervais.txt').each { |line| line.chomp }\n en...
ruby
chosen
[ { "from": "system", "value": "Use << instead of +\n" }, { "from": "human", "value": "require 'json'\nrequire 'httparty'\nrequire 'hashie'\n\nmodule RbWunderground\n class Base\n FEATURES = %w[conditions forecast forecast10day almanac hourly hourly10day alerts astronomy tide yesterday current...
ruby
chosen
[ { "from": "system", "value": "Allow subscribe to take opts, and default durable: true\n" }, { "from": "human", "value": "require 'lagomorph/json_parser'\n\nmodule Lagomorph\n class Subscriber\n\n def initialize(worker_class)\n @worker_class = worker_class\n end\n\n def subscribe(q...
ruby
chosen
[ { "from": "system", "value": "Fix Nokogiri interpretation of empty nodes\n\nNokogiri::Element returns the number of nodes when you call\nchildren#each, leading to text returning 0 if there are none. Instead,\nlet's join the texts together and return that (\"\" instead in that last\ncase).\n\nSigned-off-by: ...
ruby
chosen
[ { "from": "system", "value": "Fix -- [!] Usage of the `.swift_version` file has been deprecated! Please delete the file and use the `swift_versions` attribute within your podspec instead.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"UIColor_Hex_Swift\"\n s.versi...
ruby
chosen
[ { "from": "system", "value": "Clean up spec a little bit around creating an event through the\norganizer\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe \"Creating a Talk\", type: :request do\n let(:organizer) { User.create username: \"corey\" }\n let(:event_params)...
ruby
chosen
[ { "from": "system", "value": "Fix for advanced_path requiring arguments.\n" }, { "from": "human", "value": "require 'htmlentities'\n\nmodule PagesHelper\n # Links to a page by title, or to its path.\n def link_page(page = nil, content = nil, options = {})\n return if page.nil?\n content ...
ruby
chosen
[ { "from": "system", "value": "Add rake task for segmenting users\n\nRake task will segment all subscribed users and print out errors if it encounters any.\n" }, { "from": "human", "value": "namespace :spree_chimpy do\n namespace :orders do\n desc 'sync all orders with mail chimp'\n task s...
ruby
chosen
[ { "from": "system", "value": "Check media_type instead of content_type.\n\nThis will allow Content-Types header values such as\n\"application/json;charset=utf-8\".\n" }, { "from": "human", "value": "module Pliny::Helpers\n module Params\n def body_params\n @body_params ||= parse_body_pa...
ruby
chosen
[ { "from": "system", "value": "Use sequel version 4.14.0 and update gem name to match file structure.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'postgresql_connector'\n s.summary = 'PostgreSQL Connector for Sequel'\n s.version = '0.0...
ruby
chosen
[ { "from": "system", "value": "Fix signature verification for external messages.\n\nMail::Body.encoded returns an altered string compared to the original if\nthe original wasn't created with Mail.\n" }, { "from": "human", "value": "module Mail\n module Gpg\n class SignPart < Mail::Part\n\n ...
ruby
chosen
[ { "from": "system", "value": "Fix database url parse: parse port num\n" }, { "from": "human", "value": "require 'erb'\nrequire 'yaml'\n\nclass Ridgepole::Config\n class << self\n def load(config, env = 'development')\n if File.exist?(config)\n parsed_config = parse_config_file(co...
ruby
chosen
[ { "from": "system", "value": "Fix up a few minor issues on the DevVM with VirtualBox\n" }, { "from": "human", "value": "#\n# Author:: Seth Vargo (<sethvargo@gmail.com>)\n# Recipe:: ruby\n#\n# Copyright 2013 Opscode, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# ...
ruby
chosen
[ { "from": "system", "value": "Convert hash argument to Credential data type" }, { "from": "human", "value": "module TwentyfourSevenOffice\n module Services\n class Authentication\n extend Savon::Model\n\n client wsdl: \"https://api.24sevenoffice.com/authenticate/v001/authenticate.a...
ruby
chosen
[ { "from": "system", "value": "Simplify and update combining filters\n\nCombining filters is only necessary for the or/should case.\nThe 'and' case is the default:\nhttps://www.elastic.co/guide/en/elasticsearch/guide/current/combining-filters.html#bool-filter\n\n:or and :and are deprecated and replaced by a ...
ruby
chosen
[ { "from": "system", "value": "Remove ivar only when defined\n\nthis fixes a failing test case\n" }, { "from": "human", "value": "require \"cases/helper\"\n\nclass MysqlQuotingTest < ActiveRecord::MysqlTestCase\n def setup\n @conn = ActiveRecord::Base.connection\n end\n\n def test_type_cast...
ruby
chosen
[ { "from": "system", "value": "Add RSpec dependency for development\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/zircon/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Ryo NAKAMURA\"]\n gem.email = [\"r7ka...
ruby
chosen
[ { "from": "system", "value": "Add BenchmarkExecution status update and fix mixing up execution and definition on save\n" }, { "from": "human", "value": "class PrepareBenchmarkExecutionJob < Struct.new(:benchmark_definition_id, :benchmark_execution_id)\n def perform\n puts \"Preparing benchma...
ruby
chosen
[ { "from": "system", "value": "Return all shipping methods when Shipping Methods aren't vendorized" }, { "from": "human", "value": "module Spree::Stock::PackageDecorator\n def shipping_methods\n if (vendor = stock_location.vendor)\n vendor.shipping_methods.to_a\n else\n shipping_...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.5.2.1 to 0.6.0.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'evt-log'\n s.version = '0.5.2.1'\n s.summary = 'Logging to STD IO with levels, tagging, and coloring'\n s...
ruby
chosen
[ { "from": "system", "value": "Disable loading in of extra tasks.\n" }, { "from": "human", "value": "# Because we use plugins that are shipped via gems, we lose their rake tasks.\n# So here, we find them (if there are any) and include them into rake.\nextra_rake_tasks = []\nif defined?(Refinery) ...
ruby
chosen
[ { "from": "system", "value": "Include all instance methods when checking attribute name\n\nThis change will allow more names to be used but given that\nthe current code at least requires validates_ it is very unlikely\nto cause confusion.\n" }, { "from": "human", "value": "module ValidatesWithBl...
ruby
chosen
[ { "from": "system", "value": "Fix to WillPaginate module structure due to poor merge.\n" }, { "from": "human", "value": "# WillPaginateSearch\n# Copyright (c) 2007 - 2010 Douglas F Shearer.\n# http://douglasfshearer.com\n\nmodule Foo::Acts::Indexed\n\n module WillPaginate\n\n module Search...
ruby
chosen
[ { "from": "system", "value": "Handle Application.new with no root\n" }, { "from": "human", "value": "require 'rack'\n\nmodule Hyperloop\n class Application\n include Rack::Utils\n\n def initialize(root='')\n @root = root\n @views_path = File.join(@root, 'app/views')\n e...
ruby
chosen
[ { "from": "system", "value": "Fix ActiveRecord instrumentation require path.\n" }, { "from": "human", "value": "module Metrica\n module Rails\n # @api private\n class Railtie < ::Rails::Railtie\n\n initializer \"mertike.middleware\" do |app|\n app.middleware.insert(0, Metrica:...
ruby
chosen
[ { "from": "system", "value": "Use Socket instead of Resolv for DNS\n\nThe Socket library is tied closer to the libc Ruby is using and is\nprobably going to have less issues in the long run.\n" }, { "from": "human", "value": "require \"ipaddr\"\nrequire \"resolv\"\n\nrequire \"private_address_che...
ruby
chosen
[ { "from": "system", "value": "Refactor routing helper to use built in Rails functionality\n" }, { "from": "human", "value": "require 'action_dispatch/routing/mapper'\n\nmodule Caprese\n module Routing\n module CapreseResources\n extend ActionDispatch::Routing::Mapper::Resources\n\n ...
ruby
chosen
[ { "from": "system", "value": "Change Util to a module\n" }, { "from": "human", "value": "class PSD\n class Util\n # Ensures value is a multiple of 2\n def self.pad2(i)\n ((i + 1) / 2) * 2\n end\n\n # Ensures value is a multiple of 4\n def self.pad4(i)\n i - (i.modulo(4)...
ruby
chosen
[ { "from": "system", "value": "Make target_dir parameter of migrate_assets rake task\n" }, { "from": "human", "value": "namespace :asset_manager do\n desc \"Migrates Assets to Asset Manager.\"\n task migrate_assets: :environment do\n MigrateAssetsToAssetManager.new.perform\n end\nend\n" }...
ruby
chosen
[ { "from": "human", "value": "Add integration test for MailCatcher\n" }, { "from": "gpt", "value": "require \"spec_helper\"\n\ndescribe \"practicingruby::_mailcatcher\" do\n it \"installs mailcatcher gem\" do\n expect(package \"mailcatcher\").to be_installed.by \"gem\"\n end\n\n it \"enable...
ruby
chosen
[ { "from": "system", "value": "Remove slashes in the to_slug method.\n" }, { "from": "human", "value": "# coding: utf-8\n\nclass String\n\n def to_slug\n s = self.dup.force_encoding(\"utf-8\")\n s.downcase!\n s = I18n.transliterate(s)\n s.gsub!('_', '-')\n # s.gsub!(/[^a-z0-9\\s-]...
ruby
chosen
[ { "from": "system", "value": "Change subscirbers to be notified with data.\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'monitor'\n\nmodule FiniteMachine\n # A class responsibile for storage of event subscribers\n class Subscribers\n include Enumerable\n include Monito...
ruby
chosen
[ { "from": "system", "value": "Change variabe name to board_arr\n" }, { "from": "human", "value": "$: << File.dirname(__FILE__)\n\nclass Game\n\n attr_reader :gametype, :ui, :rules, :comp_player\n\n def initialize(args)\n @ui = args.fetch(:ui, nil)\n @gametype = args.fetch(:gametype, nil)...
ruby
chosen
[ { "from": "system", "value": "Update post-receive worker for new format\n\nSigned-off-by: Dmitriy Zaporozhets <be23d75b156792e5acab51b196a2deb155d35d6a@gmail.com>\n" }, { "from": "human", "value": "class PostReceive\n include Sidekiq::Worker\n include Gitlab::Identifier\n\n sidekiq_options qu...
ruby
chosen
[ { "from": "system", "value": "Work with timestamps that have only one hour digit.\n" }, { "from": "human", "value": "class TimeStamp\n def self.parse(string)\n if /\\A(-?)([0-9]{2}):([0-9]{2}):([0-9]{2})\\Z/.match(string)\n negative, parts = $1, [$2, $3, $4]\n parts = parts.map(&:t...
ruby
chosen
[ { "from": "system", "value": "Swap case with conditionals, also remove some predicates\n\nthere were places where the predicates could be folded into the\nconditional statements hovering above them once this was turned\ninto an if\n\nSigned-off-by: Sam Phippen <e5a09176608998a68778e11d5021c871e8fae93c@googl...
ruby
chosen
[ { "from": "system", "value": "Add the ISC license to the source file too\n" }, { "from": "human", "value": "require 'rexml/document'\nrequire 'rexml/entity'\n\nmodule REXML\n class Entity < Child\n\t\tdef unnormalized\n document.record_entity_expansion!\n v = value()\n\t\t\treturn nil...
ruby
chosen
[ { "from": "system", "value": "Abort with non-zero exit status if any command fails\n" }, { "from": "human", "value": "run('rspec spec -cfdoc')\nrun('rake --trace spec')\nrun('rake --trace spec:requests')\nrun('rake --trace spec:models')\nrun('rake --trace spec:views')\nrun('rake --trace spec:con...
ruby
chosen
[ { "from": "system", "value": "Configure NoBrainer to use the test environment\n\nThis is to prevent it from trying to connect to localhost during\ntests which causes errors shown here:\nhttps://github.com/michaeldv/awesome_print/pull/228#issuecomment-217092622\n" }, { "from": "human", "value": "...
ruby
chosen
[ { "from": "system", "value": "Spec: Allow test to run on forked repos also\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire \"how_is/sources/ci/travis\"\nrequire \"how_is/sources/ci/appveyor\"\n\ndescribe HowIs::Sources::CI::Travis do\n subject do\n config =\n ...
ruby
chosen
[ { "from": "human", "value": "Add the tests for landing page\n\nThis file is going to test some features in the landing page\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe 'Hi5 web site' do\n\n describe 'on Footer Navigation Bar ' do\n context 'without page object' do\n ...
ruby
chosen
[ { "from": "human", "value": "Add work around for javadocs not playing friendly with gwt jar\n" }, { "from": "gpt", "value": "# Ugly hack required as the gwt jars cause the javadoc tool heart ache\nmodule Buildr\n module DocFix #:nodoc:\n include Extension\n after_define(:doc) do |project|...
ruby
chosen
[ { "from": "system", "value": "Remove mysql cookbook version constraint" }, { "from": "human", "value": "name 'php'\nmaintainer 'Chef Software, Inc.'\nmaintainer_email 'cookbooks@getchef.com'\nlicense 'Apache 2.0'\ndescription 'Installs and maintains php and p...
ruby
chosen
[ { "from": "system", "value": "Clay: Use current binary and homepage URLs\n\nThe Clay homepage has moved to http://claylabs.com/clay/. The claylanguage.org\nhostname still redirects to the old site, so that should be changed as well.\n\nCloses Homebrew/homebrew#8935.\n\nSigned-off-by: Charlie Sharpsteen <828...
ruby
chosen
[ { "from": "system", "value": "Add bearer_token for publishing_api authentication\n" }, { "from": "human", "value": "require 'gds_api/publishing_api_v2'\nrequire 'gds_api/rummager'\n\nmodule Services\n def self.publishing_api\n @publishing_api ||= GdsApi::PublishingApiV2.new(Plek.new.find('pu...
ruby
chosen
[ { "from": "system", "value": "Set user agent as required by Tick API\n" }, { "from": "human", "value": "require \"tockspit/version\"\nrequire \"tockspit/bad_credentials\"\n\nrequire \"net/https\"\nrequire \"json\"\n\nmodule Tockspit\n def self.roles(email, password)\n http = Net::HTTP.new('w...
ruby
chosen
[ { "from": "system", "value": "Add method Available_Images to populate image dropdown box\n\n\n(transferred from ManageIQ/manageiq@c6c4f0b7439796deb5a83f1a59ea7edf9a855259)\n" }, { "from": "human", "value": "module MiqAeMethodService\n class MiqAeServiceExtManagementSystem < MiqAeServiceModelBas...
ruby
chosen
[ { "from": "system", "value": "Add shipping to RSS feed.\n" }, { "from": "human", "value": "xml.instruct! :xml, :version=>\"1.0\", :encoding=>\"UTF-8\"\n\nxml.rss \"version\" => \"2.0\", \"xmlns:g\" => \"http://base.google.com/ns/1.0\" do\n xml.channel do\n xml.title Spree::GoogleMerchant::Co...
ruby
chosen
[ { "from": "system", "value": "Make constant references more precise\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass RefinanceTest < Minitest::Test\n def test_refinance_is_a_module\n assert_kind_of Module, ::Refinance\n end\n\n def test_version_is_a_string\n assert_kind...
ruby
chosen
[ { "from": "system", "value": "Fix opalminiracer variable name problem\n" }, { "from": "human", "value": "`/* global Java, GjsFileImporter */`\n\nbrowser = `typeof(document) !== \"undefined\"`\nnode = `typeof(process) !== \"undefined\" && process.versions && process.versions.no...
ruby
chosen
[ { "from": "system", "value": "Add source and issues url\n" }, { "from": "human", "value": "name 'chromedriver'\nmaintainer 'Dennis Hoer'\nmaintainer_email 'dennis.hoer@gmail.com'\nlicense 'MIT'\ndescription 'Selenium WebDriver for Chrome'\nlong_description IO.read(File.join(File.dirname(__FILE__...
ruby
chosen
[ { "from": "system", "value": "Use a SPDX standard license string\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "name 'chef-analytics'\nmaintainer 'Chef Software, Inc.'\nmaintainer_email 'cookbooks@chef.io'\nlicense 'Apache 2.0'\n...
ruby
chosen
[ { "from": "system", "value": "Switch down to kibana 1.4\n" }, { "from": "human", "value": "name 'kibana'\nmaintainer 'Andrew Jo'\nmaintainer_email 'andrew@verdigris.co'\nlicense 'Simplified BSD'\ndescription 'Installs and configures Kibana'\nlong_description IO.re...
ruby
chosen
[ { "from": "system", "value": "Remove old dead env vars\n" }, { "from": "human", "value": "#\n# Copyright 2022 Thoughtworks, 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...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary integration test override\n" }, { "from": "human", "value": "require 'integration_helper'\n\nclass Ubuntu12_04Test < IntegrationTest\n def user\n \"ubuntu\"\n end\n\n def image_id\n \"ami-9a873ff3\"\n end\n\n def prepare_command\n \"...
ruby
chosen
[ { "from": "system", "value": "Update test for submission form\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\nrequire File.expand_path('../../test_helper', __FILE__)\n\nmodule Peakium\n class SubmissionFormTest < Test::Unit::TestCase\n should \"create should return a new submissi...
ruby
chosen
[ { "from": "system", "value": "Update found_listing_keys, removed_listing_keys and snapshots to longtext.\n" }, { "from": "human", "value": "class CreateImportResults < ActiveRecord::Migration\n def change\n create_table :import_results do |t|\n t.references :import, index: true, foreig...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary code in poll images controller\n\nWe're already loading the answer with a `before_action`.\n" }, { "from": "human", "value": "class Admin::Poll::Questions::Answers::ImagesController < Admin::Poll::BaseController\n include ImageAttributes\n\n bef...
ruby
chosen
[ { "from": "system", "value": "Update Homepage address to github\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'zipping/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Add test regarding dependent relationship\n\nTest that expense is deleted after category is destroyed\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe Category do\n\n before do\n @budget = FactoryGirl.create(:budget)\n @category = Factory...
ruby
chosen
[ { "from": "system", "value": "Tidy up example spec runner\n" }, { "from": "human", "value": "require \"spec_helper\"\n\nrequire \"support/mapper_setup\"\nrequire \"support/sequel_persistence_setup\"\nrequire \"support/seed_data_setup\"\nrequire \"sequel_mapper\"\n\nrequire \"spec_helper\"\n\nreq...
ruby
chosen
[ { "from": "human", "value": "Add basic specs for the default recipe\n" }, { "from": "gpt", "value": "require 'spec_helper.rb'\n\ndescribe 'pci::default' do\n let(:attributes) { ::Chef::Node::VividMash.new }\n let(:chef_run) do\n ::ChefSpec::SoloRunner.new(platform: platform, version: platfo...
ruby
chosen
[ { "from": "system", "value": "Add rake to gemspec for Travis.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"traco/version\"\n\nGem::Specification.new do |s|\n s.name = \"traco\"\n s.version = Traco::VERSION\n ...
ruby
chosen
[ { "from": "system", "value": "Allow newer versions of rails and rack\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n$LOAD_PATH.push File.expand_path('lib', __dir__)\n\n# Maintain your gem's version:\nrequire 'envirorobots/version'\n\n# Describe your gem and declare its depen...
ruby
chosen
[ { "from": "system", "value": "Use boxen port over gh port.\n" }, { "from": "human", "value": "$:.unshift(File.expand_path('../../lib', __FILE__))\n\nrequire 'rubygems'\nrequire 'bundler'\n\nBundler.require(:default, :test)\n\nrequire 'plucky'\n\nrequire 'fileutils'\nrequire 'logger'\nrequire 'pp...
ruby
chosen
[ { "from": "system", "value": "Update attributes for device data updater\n" }, { "from": "human", "value": "#\n# Author:: Tim Smith(<tim.smith@webtrends.com>)\n# Cookbook Name:: wt_devicedataupdater\n# Attribute:: default\n#\n# Copyright 2012, Webtrends Inc.\n#\n\ndefault['wt_devicedataupdater'][...
ruby
chosen
[ { "from": "system", "value": "Change single quotes to double quotes in string not using variable interpolation\n" }, { "from": "human", "value": "begin\n require 'reek/rake/task'\n\n Reek::Rake::Task.new\nrescue LoadError\n task :reek do\n abort \"Reek is not available. In order to run ree...
ruby
chosen
[ { "from": "system", "value": "Return the challenge file contents.\n" }, { "from": "human", "value": "module LetsencryptPlugin\n class ApplicationController < ActionController::Base\n before_action :get_challenge_response, only: [:index]\n before_action :validate_length, only: [:index]\n ...
ruby
chosen
[ { "from": "human", "value": "Add check for ntp offset\n" }, { "from": "gpt", "value": "#! /usr/bin/env ruby\n#\n# Check NTP Offset\n# ===\n#\n# DESCRIPTION:\n# This plugin provides a method for checking the NTP offset.\n#\n# OUTPUT:\n# plain-text\n#\n# PLATFORMS:\n# all\n#\n# DEPENDENCIES:...
ruby
chosen
[ { "from": "system", "value": "Make the local podspec point to 'HEAD'\n" }, { "from": "human", "value": "Pod::Spec.new do |spec|\n spec.name = 'Typhoon'\n spec.version = '1.6.6'\n spec.license = 'Apache2.0'\n spec.summary = 'A dependency injection container for ...
ruby
chosen
[ { "from": "system", "value": "Make the Ruby benchmark more idiomatic" }, { "from": "human", "value": "class Natural\n def initialize\n @x = 2\n end\n\n def next\n return @x += 1\n end\nend\n\nclass Filter\n def initialize(number, filter)\n @number = number\n @filter = filter\n ...
ruby
chosen
[ { "from": "system", "value": "Fix type of synchronization_id in data_imports table\n" }, { "from": "human", "value": "# encoding: utf-8\n\nclass AddSynchronizationIdToDataImport < Sequel::Migration\n def up\n add_column :data_imports, :synchronization_id, :bigint\n end\n\n def down\n dr...
ruby
chosen
[ { "from": "system", "value": "Test generated HTML includes marker references\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + '/test_helper'\n\nclass GoogleMapTest < Test::Unit::TestCase\n # Replace this with your real tests.\n def setup\n @map = GoogleMap.new\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Remove circular dependency requirement in tests\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\nrequire 'tomlrb'\n\nrequire 'minitest/spec'\nrequire 'minitest/autorun'\nrequire \"minitest/reporters\"\nMinitest::Reporter...
ruby
chosen
[ { "from": "system", "value": "Remove dependency on ruby debug\n" }, { "from": "human", "value": "# Standard Ruby.\nrequire 'singleton'\nrequire 'set'\n\n# Gems.\nrequire 'rubygems'\nrequire 'active_support'\nrequire 'eventmachine'\nrequire 'json'\nrequire 'ruby-debug'\n\n# Application.\nrequire ...
ruby
chosen
[ { "from": "human", "value": "Patch over an overly-broad security fix in Rails.\n\nSee monkeypatch comments for more information.\n" }, { "from": "gpt", "value": "# An overly-broad security check introduced in Rails turns this:\n# \n# {\"abc\":[]}\n#\n# into (effectively) this:\n#\n# {\"a...
ruby
chosen
[ { "from": "system", "value": "Split the license & ports provider invocations to seperate recipes\n" }, { "from": "human", "value": "#\n# Cookbook Name:: cumulus-cl-ports-chef-test\n# Recipe:: default\n#\n# Copyright 2015, Cumulus Networks\n#\n# All rights reserved - Do Not Redistribute\n#\n\n# S...
ruby
chosen
[ { "from": "system", "value": "Update to latest Ratatool 0.3.11" }, { "from": "human", "value": "class Ratatool < Formula\n desc \"Tool for random data sampling and generation\"\n homepage \"https://github.com/spotify/ratatool\"\n url \"https://github.com/spotify/ratatool/releases/download/v0....
ruby
chosen
[ { "from": "system", "value": "Update spec, passing in a temp dir rather than stubbing.\n\nVerify that the mount points are actually different, don't rely on an\nexception in the code\n" }, { "from": "human", "value": "require \"spec_helper\"\nrequire 'util/mount/miq_generic_mount_session'\n\ndes...
ruby
chosen
[ { "from": "human", "value": "Add active record spec to test bulk insert sql\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe ActiveRecord::Base do\n\n let(:notification_status) { FactoryGirl.build(:notification_status) }\n let(:notification_status2) { FactoryGirl.build(:notif...
ruby
chosen
[ { "from": "system", "value": "Define a limited set of filters for SingleLinePipeline\n\nRemoves the following filters from its parent GfmPipeline:\n\n- SyntaxHighlightFilter\n- UploadLinkFilter\n- TableOfContentsFilter\n- LabelReferenceFilter\n- TaskListFilter\n\nCloses #1697\n" }, { "from": "human"...
ruby
chosen
[ { "from": "system", "value": "Raise errors based on status code\n" }, { "from": "human", "value": "require 'faraday'\nrequire 'eventbrite/error'\n\nmodule Eventbrite\n module REST\n module Response\n class RaiseError < Faraday::Response::Middleware\n def on_complete(response)\n ...
ruby
chosen
[ { "from": "system", "value": "Add spec to exercise Cohort.default_cohort\n" }, { "from": "human", "value": "# == Schema Information\n#\n# Table name: cohorts\n#\n# id :integer not null, primary key\n# title :string(255)\n# slug :string(255)\n# url :string(2...
ruby
chosen
[ { "from": "system", "value": "Test associations and allowed columns for map model\n" }, { "from": "human", "value": "require './spec/rb/spec_helper.rb'\n\ndescribe Map do\n describe '.remix' do\n it 'creates a copy of the map and lines' do\n map = create(:map)\n lines = create_list...
ruby
chosen
[ { "from": "system", "value": "Use strings for header names.\n" }, { "from": "human", "value": "module QueueingRabbit\n\n module JobExtensions\n\n module Retryable\n\n def retries\n headers[:qr_retries].to_i\n end\n\n def retry_upto(max_retries)\n if retries < max...
ruby
chosen
[ { "from": "human", "value": "Add some tests for interpret_command\n" }, { "from": "gpt", "value": "require_relative '../lib/world_command.rb'\nrequire_relative '../lib/util.rb'\nrequire_relative '../lib/Map/Map/map.rb'\nrequire_relative '../lib/Entity/player.rb'\n\n\nRSpec.describe do\n \n bef...
ruby
chosen
[ { "from": "system", "value": "Add description and summary to gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'lionel/version'\n\nGem::Specification.new do |gem|\n g...
ruby
chosen
[ { "from": "system", "value": "Add missing attribute for taxon\n" }, { "from": "human", "value": "module Spree\n module V2\n module Storefront\n class TaxonSerializer < BaseSerializer\n set_type :taxon\n\n attributes :name, :pretty_name, :permalink, :seo_title, :meta_titl...
ruby
chosen
[ { "from": "system", "value": "Fix test folder in gemspec\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"airplay\"\n s.version = \"0.2.6\"\n s.summary = \"Airplay client\"\n s.description = \"Send image/video to an airplay ...
ruby
chosen
[ { "from": "system", "value": "Fix typo in db migration\n" }, { "from": "human", "value": "class RemoveDiseaseSpecificFlagFromRaceCodes < ActiveRecord::Migration\n def self.up\n ExteranlCode.connection.execute \"UPDATE external_codes SET disease_specific = NULL WHERE external_codes.code_name ...
ruby
chosen
[ { "from": "system", "value": "Fix failing spec when directory didn't exist before spec was run\n" }, { "from": "human", "value": "require 'rspectacular'\nrequire 'chamber/commands/secure'\n\nmodule Chamber\nmodule Commands\ndescribe Secure do\n let(:rootpath) { Pathname.new(::Fi...
ruby
chosen
[ { "from": "system", "value": "Use before_action for authenticating admin\n" }, { "from": "human", "value": "module SwaggerUiEngine\n class ApplicationController < ActionController::Base\n include AuthConfigParser\n\n protect_from_forgery with: :exception\n layout false\n\n before_fi...
ruby
chosen
[ { "from": "system", "value": "Add preference_level AR validator to Availability\n\nSigned-off-by: Max Fierke <0706025b2bbcec1ed8d64822f4eccd96314938d0@maxfierke.com>\n" }, { "from": "human", "value": "class Availability < ActiveRecord::Base\n belongs_to :user\n\n validates :user_id, presence: ...
ruby
chosen
[ { "from": "system", "value": "PlantSample: Expand parameter names for clarity.\n" }, { "from": "human", "value": "require 'csv'\n\nclass PlantSample < ApplicationRecord\n belongs_to :plant\n belongs_to :biodiversity_report\n\n has_attached_file :photo, default_url: \"missing.png\", styles: { ...
ruby
chosen
[ { "from": "system", "value": "Update dependencies to allow Rails4 apps to use it\n" }, { "from": "human", "value": "# encoding: utf-8\nrequire File.expand_path('../lib/timecop_console/version', __FILE__)\n\nGem::Specification.new do |spec|\n spec.add_dependency 'rails', '~> 3.1'\n spec.add_dep...
ruby
chosen
[ { "from": "human", "value": "Add validations for creating post versions\n" }, { "from": "gpt", "value": "module TentValidator\n class PostEndpointValidator < TentValidator::Spec\n\n require 'tent-validator/validators/support/post_generators'\n class << self\n include Support::PostGen...
ruby
chosen
[ { "from": "system", "value": "Stabilize sms deployment. Eliminates service start returning (1) error.\n\n\nFormer-commit-id: b8bb2ad41e65f970d60480355998ba7080b87712 [formerly 2ba817cc6f8bc426fc75f3fed72d3e1c3d49ba5f] [formerly 5a9f228817c40c0c69c7d65f5f458bd34b624275 [formerly f44ae839af7b47e245dbaf79f3695...
ruby
chosen