conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add tests to check for regex\n" }, { "from": "human", "value": "require 'test_helper'\nrequire 'generators/jsonapi/resource_generator'\n\nmodule Jsonapi\n class ResourceGeneratorTest < Rails::Generators::TestCase\n tests ResourceGenerator\n destination Rails....
ruby
chosen
[ { "from": "system", "value": "Add a second dummy user\n" }, { "from": "human", "value": "# The data can then be loaded with rake db:seed\n# (or created alongside the db with db:setup).\n\n# The meta accounts to track money and stuff\nAccount.create(account_type: 'withdrawal')\nAccount.create(acc...
ruby
chosen
[ { "from": "system", "value": "Adjust in light of lack of state\n" }, { "from": "human", "value": "# encoding: utf-8\nclass Service::GeckoBoard < Service\n attr_writer :geckoboard\n\n def receive_logs\n raise_config_error 'Missing GeckoBoard API key' if settings[:token].to_s.empty?\n rais...
ruby
chosen
[ { "from": "system", "value": "Fix `Do not use prefix _ for a variable that is used.`\n" }, { "from": "human", "value": "module Buoys\n class Link\n attr_accessor :text, :options, :options_for_config\n attr_reader :current\n\n CONFIG = {\n current_class: (Buoys::Config.current_clas...
ruby
chosen
[ { "from": "system", "value": "Add methods to Buoys::Link class\n\nTo judge and decide the Link is the end of breadcrumbs\n" }, { "from": "human", "value": "module Buoys\n class Link\n attr_accessor :text, :url, :options\n\n def initialize(text, url, options)\n @text, @url, @options =...
ruby
chosen
[ { "from": "system", "value": "Allow users to visit to '/' without API key;;\n" }, { "from": "human", "value": "require 'json'\nrequire 'sinatra'\nrequire 'sinatra/logger'\n\nmodule Hato\n class Httpd\n def initialize(observer, config)\n @observer = observer\n @config = config\n ...
ruby
chosen
[ { "from": "human", "value": "Add a package manager file for Async\n" }, { "from": "gpt", "value": "require 'keen/async/storage/base_storage_handler'\nrequire 'keen/async/storage/redis_handler'\nrequire 'keen/async/storage/flat_file_handler'\nrequire 'keen/async/job'\nrequire 'keen/async/worker'\...
ruby
chosen
[ { "from": "system", "value": "Rename method so it's more descriptive.\n" }, { "from": "human", "value": "require \"space_cats/version\"\n\nmodule SpaceCats\n def space_cat\n \"<a href='http://omgcatsinspace.tumblr.com'><img src='#{ get_cat_url }'></img></a>\".html_safe\n end\n\n def get_ca...
ruby
chosen
[ { "from": "human", "value": "Add database backup rake task" }, { "from": "gpt", "value": "namespace :db do\n desc 'Dump the database to db/<time>._<name>.pgsql_dump'\n task dump: :environment do\n cmd = nil\n f_name = nil\n with_config do |_app, host, db, user, pass|\n f_name = \...
ruby
chosen
[ { "from": "system", "value": "Prepend the cache lookup to already defined _path methods\n" }, { "from": "human", "value": "require \"turbo_urls/version\"\nrequire 'turbo_urls/cache'\nrequire 'turbo_urls/railtie'\n\nmodule TurboUrls\n module Interceptor\n CACHE_LOOKUP = ->(*args) do\n pa...
ruby
chosen
[ { "from": "system", "value": "Check for peptide sequence and found weight\n" }, { "from": "human", "value": "require 'sinatra'\nrequire 'json'\nrequire './main'\n\nget '/' do\n erb :index\nend\n\npost '/possible-matches' do\n begin\n mass_type = MassTypes.parse params[:mass_type]\n # TOD...
ruby
chosen
[ { "from": "system", "value": "Add XCTest framework to podspec.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"PactConsumerSwift\"\n s.version = \"0.1.2\"\n s.summary = \"A Swift / ObjeciveC DSL for creating pacts.\"\n\n s.description = <<-DESC\n ...
ruby
chosen
[ { "from": "system", "value": "Include pact server scripts in cocoapod." }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"PactConsumerSwift\"\n s.version = \"0.1.2\"\n s.summary = \"A Swift / ObjeciveC DSL for creating pacts.\"\n\n s.description = <<-DESC\n...
ruby
chosen
[ { "from": "system", "value": "Fix fancy quotes that cause Travis CI build failed while submit to CocoaPods.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"RCDraggableButton\"\n s.version \t = “0.2”\n s.summary = \"A draggable button that appears in your view...
ruby
chosen
[ { "from": "system", "value": "Fix breaking changes (use scope)\nSet dependency versions\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"SHOmniAuthTwitter\"\n s.version = \"0.2.1\"\n s.summary = \"Twitter strategy for SHOmniAuth.\"\n s.description = <<-...
ruby
chosen
[ { "from": "system", "value": "Use HTTPParty instead of CURL\n" }, { "from": "human", "value": "class LittlePrinter\n def initialize(code)\n @code = code\n end\n\n def message(msg)\n `curl -X POST -d \"html=<html><head><meta charset='utf-8'></head><body><p>#{msg}</p></body></html>\" http...
ruby
chosen
[ { "from": "system", "value": "Put FFI stuff in private modules.\n" }, { "from": "human", "value": "require 'ffi'\n\nmodule GLib\n extend FFI::Library\n\n class GType\n extend FFI::Library\n ffi_lib \"gobject-2.0\"\n attach_function :g_type_init, [], :void\n def self.init; g_type_in...
ruby
chosen
[ { "from": "system", "value": "Fix tests for turn to reflect deletion of cards_won\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :turn do\n association :player, factory: :user\n association :round, factory: :round\n seconds_remaining 60\n cards_won 0\n end\nend\...
ruby
chosen
[ { "from": "system", "value": "Test pass-through to Rails application" }, { "from": "human", "value": "require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))\n\ndescribe 'SecureEscrow::Middleware' do\n let(:app) { MockEngine.new }\n let(:store) { MockRedis.new }\n let(:midd...
ruby
chosen
[ { "from": "system", "value": "Fix failed build on master\n" }, { "from": "human", "value": "RSpec.describe Spree::HomeController, type: :controller do\n routes { Spree::Core::Engine.routes }\n\n before do\n reset_spree_preferences\n SpreeI18n::Config.available_locales = [:en, :es]\n end...
ruby
chosen
[ { "from": "system", "value": "Load sass and uglifier as test deps\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"sprockets-rails\"\n s.version = \"2.2.0\"\n\n s.homepage = \"https://github.com/rails/sprockets-rails\"\n s.summary = \"Sprockets Rails integration...
ruby
chosen
[ { "from": "system", "value": "Remove repository key contents from chef output\n" }, { "from": "human", "value": "#\n# Copyright 2013, Dennis Klein\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 ma...
ruby
chosen
[ { "from": "system", "value": "Add brand to product title.\n" }, { "from": "human", "value": "module Spree\n module ProductsHelper\n\n def property_value_for(product, property)\n return nil unless property = product.properties.find_by_name(property)\n property.value\n end\n\n en...
ruby
chosen
[ { "from": "system", "value": "Raise on zero byte CSV\n" }, { "from": "human", "value": "# This is a service object that works with importer classes. It factors out\n# shared logic that downloads CSVs and cleans them up before import.\nclass CsvDownloader\n\n def initialize(log:, client:, remote...
ruby
chosen
[ { "from": "system", "value": "Update migration for external_guid in sites table\n\nSigned-off-by: Tim Morgan <5ee0edb9e2229c0838f1959779f1949031de0123@timmorgan.org>\n" }, { "from": "human", "value": "class AddPcguidToSites < ActiveRecord::Migration\n def self.up\n add_column :sites, :pc_gui...
ruby
chosen
[ { "from": "system", "value": "Use zip compression rather than tar + gzip which will default to following symlinks rather than adding the actual symlink to the archive\n" }, { "from": "human", "value": "require 'capistrano/ext/multistage'\n\nset :application, \"TriSano\"\nset :stages, %w(vagrant ...
ruby
chosen
[ { "from": "system", "value": "Add link to GitHub page in /\n" }, { "from": "human", "value": "require \"rubygems\"\nrequire \"bundler/setup\"\nBundler.require(ENV[\"RACK_ENV\"])\n\nrequire \"sinatra/base\"\nrequire \"premailer\"\nrequire \"oj\"\n\nclass App < Sinatra::Base\n get '/' do\n hea...
ruby
chosen
[ { "from": "system", "value": "Add hash equality to Peg class\n" }, { "from": "human", "value": "class Peg\n COLORS = [\"red\", \"green\", \"blue\", \"yellow\", \"brown\", \"orange\", \"black\", \"white\"]\n\n attr_reader :color_index\n def initialize(color)\n @color_index = COLORS.index(co...
ruby
chosen
[ { "from": "system", "value": "Fix controller spec for challenges.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe ChallengesController do\n\n describe \"GET 'index'\" do\n it \"returns http success\" do\n get 'index'\n response.should be_success\n end\n end...
ruby
chosen
[ { "from": "system", "value": "Add href to explain schema validation spec in error message\n" }, { "from": "human", "value": "describe \"database schema\" do\n it \"is structured as expected\" do\n ret = EvmDatabase.check_schema\n\n expect(ret).to be_nil, <<-EOS.gsub!(/^ +/, \"\")\n #...
ruby
chosen
[ { "from": "system", "value": "Add test-unit to dev dependencies in order to run tests with rails 3.2 and ruby 2.2\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"rails-footnotes/version\"\n\nGem::Specification.new do |s|\n ...
ruby
chosen
[ { "from": "system", "value": "Adjust tests for user authorisation changes\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass FluffyPawsTest < Minitest::Test\n include Rack::Test::Methods\n\n def app\n FluffyPaws::App\n end\n\n def test_that_it_has_a_version_number\n refu...
ruby
chosen
[ { "from": "system", "value": "Remove the sound of surprise from the spec.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Gemfiler::Output do\n let(:cabinet) { Gemfiler::Cabinet.new('./spec/support/gemfiles/SampleGemfileForOutput') }\n let(:filer) { Gemfiler::Filer.new(cab...
ruby
chosen
[ { "from": "system", "value": "Add a test for supported events\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\ndescribe 'Plugin' do\n subject { Dimples::Plugin.new(site) }\n\n let(:site) { double }\n\n describe '.inherited' do\n context 'when a subclass of Plugin is incl...
ruby
chosen
[ { "from": "system", "value": "Add simplecov configuration to filter out the spec folder\n" }, { "from": "human", "value": "# encoding: utf-8\n\nbegin\n require 'rspec' # try for RSpec 2\nrescue LoadError\n require 'spec' # try for RSpec 1\n RSpec = Spec::Runner\nend\n\n# require spec suppo...
ruby
chosen
[ { "from": "system", "value": "Revert \"Move to Chrome for tests\"\n\nWill have to get to Travis CI later.\n\nThis reverts commit c1c9edffbce89bbd39249d8fe5e4287c8b94af5f.\n" }, { "from": "human", "value": "# This file is copied to spec/ when you run 'rails generate rspec:install'\nENV[\"RAILS_EN...
ruby
chosen
[ { "from": "system", "value": "Remove the files in spec/ dir from coverage result\n" }, { "from": "human", "value": "require \"simplecov\"\nSimpleCov.start\n\n# Configure Rails Environment\nENV[\"RAILS_ENV\"] = \"test\"\n\n# Configure Rails Environment\nENV[\"DB\"] ||= 'sqlite3' # \"mysql2\"\n\nr...
ruby
chosen
[ { "from": "system", "value": "Remove deprecation warning regarding rspec configuration\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'bundler'\nrequire 'fakeweb'\n\nBundler.setup\nrequire 'ptilinopus'\n\nRSpec.configure do |config|\n config.treat_symbols_as_metadata_keys_with_t...
ruby
chosen
[ { "from": "system", "value": "Remove deprecated setting, rspec3 forces this true.\n\nRSpec::Core::Configuration#treat_symbols_as_metadata_keys_with_true_values= is deprecated. Called from /Users/sane/work/ruby-study/tachikoma/spec/spec_helper.rb:8:in `block in <top (required)>'.\n\nDeprecate config.treat_sy...
ruby
chosen
[ { "from": "system", "value": "Use require_relative in shared_context load\n" }, { "from": "human", "value": "# Added by ChefSpec\nrequire 'chefspec'\n\n# Uncomment to use ChefSpec's Berkshelf extension\nrequire 'chefspec/berkshelf'\n\nRSpec.configure do |config|\n # Specify the path for Chef So...
ruby
chosen
[ { "from": "system", "value": "Remove unused constant from spec env\n" }, { "from": "human", "value": "# encoding: utf-8\n\n# SimpleCov MUST be started before require 'rom-relation'\n#\nif ENV['COVERAGE'] == 'true'\n require 'simplecov'\n require 'coveralls'\n\n SimpleCov.formatter = SimpleCov...
ruby
chosen
[ { "from": "system", "value": "Print running example groups to ease debugging\n" }, { "from": "human", "value": "require 'coveralls'\nCoveralls.wear!\n\nRSpec.configure do |config|\n config.expect_with :rspec do |expectations|\n expectations.include_chain_clauses_in_custom_matcher_description...
ruby
chosen
[ { "from": "system", "value": "Add test for out of block should be able to call\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass TestToriDefine < Test::Unit::TestCase\n class Dammy\n extend Tori::Define\n tori :test_image\n tori :def_image do |model|\n \"foo/#{__to...
ruby
chosen
[ { "from": "system", "value": "Use pty and expect to test interactive init dialog\n" }, { "from": "human", "value": "require 'helper'\n\nclass TestInit < Test::Pwm::AppTestCase\n #\n # Tests that initing with two passwords that don't match fails\n #\n def test_init_unmatching_passwords\n #...
ruby
chosen
[ { "from": "system", "value": "Patch the change in, instead.\n" }, { "from": "human", "value": "require 'redmine'\n\nRedmine::Plugin.register :overview_view_page_forward do\n name 'Overview->View page forward'\n author 'Jon McManus'\n url 'http://github.com/jmcb/overview-view-page-forward'\n ...
ruby
chosen
[ { "from": "system", "value": "Switch over to wel-osx-apps for imagemagick and nodejs\n\nThis commit switches wel_station to wel-osx-apps as it is being slowly deprecated.\n" }, { "from": "human", "value": "include_recipe \"wel_station::rvm\"\ninclude_recipe \"wel_station::gem_setup\"\ninclude_re...
ruby
chosen
[ { "from": "system", "value": "Define PHP's directives needed by Symfony\n" }, { "from": "human", "value": "# Vagrant Settings\ndefault[:vagrant][:workspace_path] = '/opt/vboxsf/workspace'\ndefault[:vagrant][:workspace_nfs_path] = '/opt/nfs/workspace'\n\n# Core settings\ndefault[:core][:workspace...
ruby
chosen
[ { "from": "system", "value": "Fix source recipe looking up URL with double slash\n\nIntroduced in 503926c7.\n" }, { "from": "human", "value": "default['racktables']['install_method'] = \"source\"\n\ndefault['racktables']['source']['version'] = \"0.20.4\"\ndefault['racktables']['source']['checksu...
ruby
chosen
[ { "from": "system", "value": "Remove personal customization from attributes.\n" }, { "from": "human", "value": "default['boulder']['config']['boulder-config']['va']['portConfig']['httpPort'] = 80\ndefault['boulder']['config']['boulder-config']['va']['portConfig']['httpsPort'] = 443\ndefault['bou...
ruby
chosen
[ { "from": "system", "value": "Define specs for marking a setter method as deprecated\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe \"Sample spec\" do\n specify \"AttrDeprecated is defined\" do\n defined?(AttrDeprecated).should be_true\n end\n\n specify \"A class that...
ruby
chosen
[ { "from": "system", "value": "Make umask spec work with different host process starting umasks, clean up literals to be easier to read through.\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + '/../../spec_helper'\n\ndescribe \"File.umask\" do\n before :each do\n @file = '...
ruby
chosen
[ { "from": "system", "value": "Make tests compatible with 1.8.7.\n" }, { "from": "human", "value": "module ImageHelper\n\n def process_image_version(test_file_name, version)\n result, content = nil, nil\n Tempfile.open(\"specs\", :encoding => 'binary') do |file|\n file.close\n\n ...
ruby
chosen
[ { "from": "human", "value": "Fix of weird conflict file\n" }, { "from": "gpt", "value": "# == Schema Information\n#\n# Table name: documents\n#\n# id :integer(4) not null, primary key\n# name :string(255)\n# description :text\n# data_file_name :strin...
ruby
chosen
[ { "from": "system", "value": "Upgrade to latest activerecord-postgres-hstore gem\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\nGem::Specification.new do |s|\n s.name = \"serialize_typed_attributes\"\n s.version = \"0.0.1\"\n s.authors = [\...
ruby
chosen
[ { "from": "system", "value": "Add warning when using options with mutiple gems\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Bundler\n class CLI::Add\n def initialize(options, gems)\n @gems = gems\n @options = options\n @options[:group] = @options[...
ruby
chosen
[ { "from": "system", "value": "Add tests for the helper methods\n" }, { "from": "human", "value": "require 'spec_helper'\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Cyclid::UI::Helpers do\n include Rack::Test::Methods\n\n subject { Class.new { extend Cyclid::U...
ruby
chosen
[ { "from": "system", "value": "Add myself to the contributors.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'bob/version'\n\nGem::Specification.new do |spec|\n spec.name =...
ruby
chosen
[ { "from": "system", "value": "Add docs about latest libcurl version.\n" }, { "from": "human", "value": "require 'logger'\nrequire 'ffi'\nrequire 'rbconfig'\nrequire 'thread'\nrequire 'mime/types'\nrequire 'tempfile'\n\nrequire 'ethon/curl'\nrequire 'ethon/errors'\nrequire 'ethon/easy'\nrequire '...
ruby
chosen
[ { "from": "system", "value": "Make Hanzo.run return the output\n" }, { "from": "human", "value": "require 'optparse'\nrequire 'yaml'\nrequire 'highline/import'\n\nrequire 'hanzo/base'\nrequire 'hanzo/cli'\nrequire 'hanzo/heroku'\nrequire 'hanzo/version'\n\nmodule Hanzo\n def self.run(command)\n...
ruby
chosen
[ { "from": "system", "value": "Add NRSER::ROOT pointing to Gem root dir.\n" }, { "from": "human", "value": "module NRSER; end\n\nrequire_relative './nrser/version'\nrequire_relative './nrser/no_arg'\nrequire_relative './nrser/collection'\nrequire_relative './nrser/truthy'\nrequire_relative './nrs...
ruby
chosen
[ { "from": "system", "value": "Check for valid range in Table Class\n" }, { "from": "human", "value": "class Table\n\n def initialize(width,height)\n @width = width\n @height = height\n end\n\nend" }, { "from": "gpt", "value": "class Table\n\n def initialize(width,height)\n ...
ruby
chosen
[ { "from": "system", "value": "Upgrade Rspec, peg Chronic at 0.10\n" }, { "from": "human", "value": "\nGem::Specification.new do |s|\n\n s.name = 'rufus-scheduler'\n\n s.version = File.read(\n File.expand_path('../lib/rufus/scheduler.rb', __FILE__)\n ).match(/ VERSION *= *['\"]([^'\"]+)/)[1...
ruby
chosen
[ { "from": "system", "value": "Update to latest rethinkdb library (v1.11.0)\n" }, { "from": "human", "value": "# encoding: utf-8\n$:.unshift File.expand_path(\"../lib\", __FILE__)\n$:.unshift File.expand_path(\"../../lib\", __FILE__)\n\nrequire 'no_brainer/version'\n\nGem::Specification.new do |s...
ruby
chosen
[ { "from": "system", "value": "Add helper to retrieve foreign keys for the received table\n" }, { "from": "human", "value": "module ConnectionHelpers\n def postgresql_db?\n ActiveRecord::Base.connection.adapter_name.downcase == 'postgresql'\n end\nend\n" }, { "from": "gpt", "valu...
ruby
chosen
[ { "from": "system", "value": "Update rubocop to fix vulnerability in < 0.48.1\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 'orats/version'\n\nGem::Specification.new do |spec|\n ...
ruby
chosen
[ { "from": "system", "value": "Replace the requirements URL with a link to /check\n" }, { "from": "human", "value": "# coding: utf-8\n# This file is part of Mconf-Web, a web application that provides access\n# to the Mconf webconferencing system. Copyright (C) 2010-2015 Mconf.\n#\n# This file is ...
ruby
chosen
[ { "from": "system", "value": "Fix foreign_key not correct for agneda and time\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass AgendaTime < ApplicationRecord\n has_many :agendas, dependent: :nullify\n belongs_to :day, class_name: 'AgendaDay', inverse_of: :times\n\n va...
ruby
chosen
[ { "from": "system", "value": "Fix issue where suite_cpi is shadowed by nil\n\nruby is fun\n\nSigned-off-by: Zak Auerbach <84a275e6a279738f2aa78daf0002615dee69cc28@pivotal.io>\n" }, { "from": "human", "value": "require 'spec_helper'\n\nRSpec.configure do |rspec_config|\n include LifecyclePropert...
ruby
chosen
[ { "from": "system", "value": "Add option to add default desires\n" }, { "from": "human", "value": "require 'base'\n\nmodule RemoteEntities\n\tmodule Entities\n\t\tdef self.setup(in_type, &block)\n\t\t\tsu = SetupDefinition.new in_type\n\t\t\tsu.evaluate &block\n\t\tend\n\n\t\tclass SetupDefiniti...
ruby
chosen
[ { "from": "system", "value": "Use a test output file for reading and writing test. Delete the file at the end of the test for a clean test environment.\n" }, { "from": "human", "value": "require_relative 'test_helper'\nrequire_relative 'metainfo_test_helper'\nrequire_relative '../lib/kademlia/t...
ruby
chosen
[ { "from": "system", "value": "Move languages to chef app.\n" }, { "from": "human", "value": "default['cdo-apps'] = {\n 'dashboard' => {\n 'port' => 8080,\n },\n\n 'pegasus' => {\n 'port' => 8081, \n },\n\n 'levelbuilder' => {\n 'enabled' => false,\n 'port' => 8082, \n },\...
ruby
chosen
[ { "from": "system", "value": "Add rspec gem development dependency version 3.2\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'skroutz_api/version'\n\nGem::Specification.new do |spec...
ruby
chosen
[ { "from": "system", "value": "Upgrade Vivaldi.app to v1.0.174.8 (Snapshot)\n" }, { "from": "human", "value": "cask :v1 => 'vivaldi-snapshot' do\n version '1.0.167.2'\n sha256 'ded8ebb78e7f49bfdc56ed4444782dc90ec0d51965c672076f5c8e5109515608'\n\n url \"https://vivaldi.com/download/download.php...
ruby
chosen
[ { "from": "human", "value": "Add task for installing scanner library\n" }, { "from": "gpt", "value": "namespace sanescan do\n desc \"Install sane library for scanners\"\n task :sanescan do\n version = \"sane-backends_1.0.23\"\n url = \"https://launchpad.net/ubuntu/+archive/pr...
ruby
chosen
[ { "from": "system", "value": "Use module prepend to include ActiveRecordPGTasks\n\nSo that a host app can orverride it by reopening the module and callng super from #drop\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule ActiveRecord\n module Tasks\n class PostgreSQL...
ruby
chosen
[ { "from": "system", "value": "Change constraint to be a protected method\n\n* Cannot be called on the class directly, except by other instances\n of that class.\n" }, { "from": "human", "value": "# encoding: utf-8\n\nmodule Axiom\n module Types\n\n # Abstract base class for every type\n ...
ruby
chosen
[ { "from": "system", "value": "Fix module instead of class in Plugins\n" }, { "from": "human", "value": "# encoding: utf-8\n# frozen_string_literal: true\n\nrequire 'chatrix/bot/plugin'\n\nmodule Chatrix\n module Bot\n # Contains a number of standard plugins for the bot.\n module Plugins\n...
ruby
chosen
[ { "from": "system", "value": "[Sass] Fix a test incompatibility with Ruby 1.9.\n" }, { "from": "human", "value": "lib_dir = File.dirname(__FILE__) + '/../lib'\nrequire File.dirname(__FILE__) + '/linked_rails'\n\nrequire 'test/unit'\nrequire 'fileutils'\n$:.unshift lib_dir unless $:.include?(lib_...
ruby
chosen
[ { "from": "system", "value": "Fix bugs and add :default_scope class method\n" }, { "from": "human", "value": "module Fish0\n module Concerns\n module Base\n extend ActiveSupport::Concern\n\n def primary_key\n self.class.primary_key\n end\n\n def primary_key_value\n...
ruby
chosen
[ { "from": "system", "value": "Stop throwing away company info\n\nCompany information is returned as a top-level key in the response to `/account/who_am_i`. By feeding that response directly into `Harvest::User.parse`, we throw away that data. This change preserves that data and makes it accessible by simply...
ruby
chosen
[ { "from": "system", "value": "Fix perform list priority number.\n" }, { "from": "human", "value": "module QPush\n module Base\n KEY = 'qpush:v1'.freeze\n SUB_KEYS = [:delay,\n :queue,\n :perform,\n :stats,\n :heart,\n ...
ruby
chosen
[ { "from": "system", "value": "Remove redundant tld handling code\n" }, { "from": "human", "value": "require \"invoker/power/http_response\"\nrequire \"invoker/power/dns\"\nrequire \"invoker/power/balancer\"\n\nmodule Invoker\n module Power\n class << self\n def set_tld(tld_value)\n ...
ruby
chosen
[ { "from": "system", "value": "Enable pages to be used in iframes\n\nSee https://github.com/alphagov/manuals-frontend/pull/123\n\nRails 4+ sets the X-Frame-Options header to SAMEORIGIN by default. This means\nthat the resource can only be put into an iframe on the same domain.\n\nOne problem this causes is t...
ruby
chosen
[ { "from": "human", "value": "Add tests for `Comma::Extractor` extentions\n" }, { "from": "gpt", "value": "describe Comma::Extractor do\n describe '#hash_to_method_path' do\n subject { described_class.new(self, :default, {}) }\n\n it 'converts simple hash to array correctly' do\n sour...
ruby
chosen
[ { "from": "system", "value": "Handle ./plugins as plugins directory too\n" }, { "from": "human", "value": "module Magi\n class PluginManager\n def plugins_directory\n @plugins_directory ||= Rails.root + \"plugins\"\n end\n\n def load_plugins\n Dir.glob(\"#{plugins_directory}/...
ruby
chosen
[ { "from": "system", "value": "Replace weird nbsp by a regular space\n" }, { "from": "human", "value": "module Bootscale\n class Entry\n DL_EXTENSIONS = [\n RbConfig::CONFIG['DLEXT'],\n RbConfig::CONFIG['DLEXT2'],\n ].reject { |ext| ext.nil? || ext.empty? }.map { |ext| \".#{ext}\...
ruby
chosen
[ { "from": "system", "value": "Fix code to no longer reference non-existent methods\n\n* This code is not final, but I could not figure out a clean way to\n reference the error and output stream from this method.\n" }, { "from": "human", "value": "module Mutant\n class Killer\n # Runner for ...
ruby
chosen
[ { "from": "system", "value": "Store validators as proper Requestors\n" }, { "from": "human", "value": "module Pedant\n class Organization\n attr_reader :name, :validator_key\n def initialize(name, key)\n @name = name\n raw = if key =~ /^-----BEGIN RSA PRIVATE KEY-----.*/\n ...
ruby
chosen
[ { "from": "system", "value": "Add .bundle to simplecov filter\n" }, { "from": "human", "value": "$:.unshift File.expand_path(\"../..\", __FILE__)\nrequire 'simplecov'\nSimpleCov.start\n\nrequire 'lib/lxc'\n\ndef fixture_path(filename=nil)\n path = File.expand_path(\"../fixtures\", __FILE__)\n ...
ruby
chosen
[ { "from": "system", "value": "Use doc format for specs" }, { "from": "human", "value": "require 'opal-rspec'\nrequire 'opal/jquery'\nrequire 'opal/jquery/rspec'\n\nmodule JQueryTestHelpers\n def find(selector)\n Element.find selector\n end\nend\n\nRSpec.configure do |config|\n config.inclu...
ruby
chosen
[ { "from": "system", "value": "Update SimpleCov filter to exclude \"gemfiles\" folder from coverage\n" }, { "from": "human", "value": "if ENV['COVERAGE'] || ENV['TRAVIS']\n require 'simplecov'\n \n if ENV['TRAVIS']\n require 'coveralls'\n SimpleCov.formatter = Coveralls::SimpleCov::Forma...
ruby
chosen
[ { "from": "system", "value": "Exclude lib/support from spec coverage\n" }, { "from": "human", "value": "if ENV['COVERAGE']\n require 'simplecov'\n SimpleCov.start do\n add_filter \"/spec/\"\n end\nend\n\nrequire 'coercible'\n\ninclude Coercible\n\nENV['TZ'] = 'UTC'\n\nDir[File.expand_path(...
ruby
chosen
[ { "from": "system", "value": "Handle RestClient exceptions; also lack of network." }, { "from": "human", "value": "module Troo\n module API\n class Request\n class << self\n def make(verb, urn, query = {})\n new(verb, urn, query).response\n end\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "[SPEC] Fix code coverage reporting: ensure nokogiri is loaded first\n" }, { "from": "human", "value": "# encoding: utf-8\n# frozen_string_literal: true\n\n%w{\n rspec/its\n coveralls\n}.each { |f| require f }\n\nDir[File.dirname(__FILE__) + \"/support/**/*.rb\"].e...
ruby
chosen
[ { "from": "system", "value": "Use map to create an array, instead of each" }, { "from": "human", "value": "require 'json'\nrequire 'yaml'\nrequire 'pathname'\n\nmodule Zxcvbn\n class Omnimatch\n def initialize\n @matchers = build_matchers\n end\n\n def matches(password, user_input...
ruby
chosen
[ { "from": "system", "value": "Add VCR allow connections when no cassette option\n" }, { "from": "human", "value": "require 'vcr'\n\nVCR.configure do |c|\n c.cassette_library_dir = \"spec/cassettes\"\n c.hook_into :webmock\n c.configure_rspec_metadata!\nend\n\nRSpec.configure do |c|\n # In rs...
ruby
chosen
[ { "from": "system", "value": "Fix old migration by hard-coding value. It doesn't won't since it references a method that doesn't exist any more.\n" }, { "from": "human", "value": "class AddStatusToUsers < ActiveRecord::Migration\n def change\n add_column :users, :status, :integer\n User.u...
ruby
chosen
[ { "from": "system", "value": "Add dependency check to custom cucumber rake task.\n" }, { "from": "human", "value": "vendored_cucumber_bin = Dir[\"#{RAILS_ROOT}/vendor/{gems,plugins}/cucumber*/bin/cucumber\"].first\n\nnamespace :cucumber do\n Cucumber::Rake::Task.new(:rcov) do |t|\n t.binary ...
ruby
chosen
[ { "from": "system", "value": "Add comma to tags when youtube video has several tags\n" }, { "from": "human", "value": "class YoutubeVideoTools\n DEFAULT_TAGS = 'reverse,funny'\n\n def self.add_tags_from_youtube_api_video_reponse(youtube_video, youtube_api_video_response)\n if (youtube_api_v...
ruby
chosen
[ { "from": "human", "value": "Add boolean, coin, and die instance methods to the Random class\n" }, { "from": "gpt", "value": "# Magician's extensions to the Random class.\nclass Random\n\n def boolean\n [true, false].sample\n end\n\n def coin\n ['heads', 'tails'].sample\n end\n\n def ...
ruby
chosen