conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Upgrade Thunderbird Beta to 37.0b1 (from 34.0b1)" }, { "from": "human", "value": "cask :v1 => 'thunderbird-beta' do\n version '34.0b1'\n sha256 '7f6025c689633e893203490f11504b4790c46eca88393d7ab678b5405b8a8acb'\n\n url \"https://download-installer.cdn.mozilla.net...
ruby
chosen
[ { "from": "system", "value": "Add limit to avoid accidental infinite loop.\n" }, { "from": "human", "value": "describe :thread_wakeup, :shared => true do\n it \"can interrupt Kernel#sleep\" do\n exit_loop = false\n after_sleep1 = false\n after_sleep2 = false\n\n t = Thread.new do\n ...
ruby
chosen
[ { "from": "human", "value": "Add Canary track to Android Studio cask\n" }, { "from": "gpt", "value": "class AndroidStudioCanary < Cask\n version '0.8.13'\n sha256 '8718a91fead9d90e24272d39a9140b131c2c411d38d1e26dc825cd0c5fd41e15'\n\n url \"http://dl.google.com/dl/android/studio/ide-zips/#{ver...
ruby
chosen
[ { "from": "system", "value": "Fix formatting of conditional email body text\n\nIf the user sets the target branch to master and considers the deploy\nrequest a non-special one, then this would result in two empty lines\nafter the line with the name of the current branch.\n\nIf none of the two trigger, then ...
ruby
chosen
[ { "from": "system", "value": "Add more descriptive comment for Scraper" }, { "from": "human", "value": "# Houses all higher level scraping logic\nclass Scraper\n def initialize(url, base_url)\n @url = url\n @base_url = base_url\n end\n\n def links\n header_link.map { |link| format_li...
ruby
chosen
[ { "from": "system", "value": "Use named arguments for non-blocking recv\n" }, { "from": "human", "value": "require 'flatware/socket'\nmodule Flatware\n module Sink\n extend self\n attr_accessor :client\n\n class Client\n attr_reader :die\n\n def initialize(sink_endpoint)\n ...
ruby
chosen
[ { "from": "system", "value": "Change Fixtures.identify to mimic MySQL’s binary(16) representation of integer input.\n" }, { "from": "human", "value": "# Replace Fixtures.identify for binary UUIDs.\nmodule GoldRecord\n module Fixtures\n def self.included(base)\n base.class_eval do\n ...
ruby
chosen
[ { "from": "system", "value": "Remove location from response by default\n" }, { "from": "human", "value": "module RablRails\n #\n # Override default responder's api behavior to not\n # user to_format methods on a resource as a default\n # representation but instead use a rabl template\n #\n ...
ruby
chosen
[ { "from": "human", "value": "Add a Rake task for bulk updating organisations\n\nThis uses the bulk organisation updater class to perform the actual\nchange.\n" }, { "from": "gpt", "value": "namespace :data_hygiene do\n desc \"Bulk update the organisations associated with users.\"\n task :bulk_...
ruby
chosen
[ { "from": "system", "value": "Use class_eval over reopening the class.\n\nThis way an exception is raised if the class doesn't exist, rather\nthan silently/potentially erroneously defining it as a new class.\n" }, { "from": "human", "value": "module TextHelpers\n\n class Railtie < Rails::Railti...
ruby
chosen
[ { "from": "system", "value": "Fix spec by replacing the mock with an Object instance\n\n* For some reason RSpec::Mocks::Mock defines #to_str in rspec 2, and with the\n spec we're trying to assert what will happen when a non-String-like object is\n passed to the string coercion method.\n" }, { "fro...
ruby
chosen
[ { "from": "system", "value": "Add retry to capybara spec\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe 'User login' do\n let!(:user) { create(:teacher) }\n\n it 'can be completed within a valid email and password', :js do\n visit root_path\n click_link 'Log...
ruby
chosen
[ { "from": "system", "value": "Add title search that were failing.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe \"Default search\" do\n\n it \"Should match call numbers\" do\n default_search('b3340555', 'Pubmed', 3)\n end\n\nend" }, { "from": "gpt", "value...
ruby
chosen
[ { "from": "system", "value": "Add Visit Subject, User Feature Test, DRY Up Code\n" }, { "from": "human", "value": "require 'rails_helper'\nrequire 'capybara/rspec'\n\nRSpec.feature \"Users\", type: :feature do\n\tdescribe \"#sign_up\" do\n \tcontext \"with all fields fill post\" do\n \t\tit \"...
ruby
chosen
[ { "from": "system", "value": "Fix VersionConcern spec helper for Ruby18\n" }, { "from": "human", "value": "# This file copies the test database into locations for the `Foo` and `Bar` namespace,\n# then defines those namespaces, then establishes the sqlite3 connection for the namespaces\n# to sim...
ruby
chosen
[ { "from": "system", "value": "Fix indents in permit_params block\n\nIndents changed to use 2 spaces instead of 1," }, { "from": "human", "value": "ActiveAdmin.register <%= class_name %> do\n\n<% if Rails::VERSION::MAJOR == 4 || defined?(ActionController::StrongParameters) %>\n # See permitted p...
ruby
chosen
[ { "from": "system", "value": "Write a method to extract a hash from a pstore." }, { "from": "human", "value": "require 'yaml/store'\n\nmodule CiInACan\n\n module Persistence\n\n def self.save type, id, value\n store = store_for(type)\n store.transaction { store[id] = value }\n e...
ruby
chosen
[ { "from": "system", "value": "Remove unused code from plugin. [minor]\n" }, { "from": "human", "value": "module Minitest\n\n def self.plugin_minitap_options(opts, options)\n opts.on \"--tapy\", \"Use TapY reporter.\" do\n options[:minitap] = 'tapy'\n end\n\n opts.on \"--tapj\", \"...
ruby
chosen
[ { "from": "system", "value": "Add `send_request` to explicitly call `subject`\n" }, { "from": "human", "value": "require \"rspec/request_describer/version\"\n\nmodule RSpec\n module RequestDescriber\n RESERVED_HEADER_NAMES = %w(\n Content-Type\n Host\n HTTPS\n )\n\n SUPP...
ruby
chosen
[ { "from": "system", "value": "Allow backend seeds to optionally require TLS\n\nThe router is going to be hosted with a different provider to some of\nthe apps (eg EFG and Licensify).\n\nThe router needs to reverse proxy to Licensify but as the data is travelling\nacross the internet we should use HTTPS rath...
ruby
chosen
[ { "from": "system", "value": "Change name to username in auth signin features spec\n" }, { "from": "human", "value": "require 'spec_helper'\nfeature \"Auth\" do\n context \"signin\" do\n scenario \"A user can access the signin page\" do\n visit signin_path\n expect(page).to have_co...
ruby
chosen
[ { "from": "human", "value": "Use OptionParser to read arguments, and connect to the database\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\n\nrequire 'optparse'\nrequire 'mysql2'\nrequire 'io/console'\n\n# Argument definitions\noptions = {}\noptparse = ::OptionParser.new do |opts|\n\topts...
ruby
chosen
[ { "from": "human", "value": "Add basic specs to Config class\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe HumanApi::Config do\n let(:config) { described_class.new }\n\n it 'sets some defaults' do\n expect(config.hardcore).to be false\n expect(config.raise...
ruby
chosen
[ { "from": "system", "value": "Fix (cosmetic) typo in snapshotter spec\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Snapshotter do\n let(:snapshot) { create(:snapshot, :pending) }\n subject { Snapshotter.new(snapshot) }\n\n describe '#take_snapshot!' do\n befo...
ruby
chosen
[ { "from": "system", "value": "Config: Put the secret token into a separate file\n\n* Having it into the source code is madness. Use an installation-specific\n configuration file to store it\n\n* If this file is not found during application startup, Corylus will\n generate a new secret token\n\nThis code w...
ruby
chosen
[ { "from": "system", "value": "Remove possibly confusing comment about secret token\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\n# Your secret key for verifying the integrity of signed cookies.\n# If you change this key, all old signed cookies ...
ruby
chosen
[ { "from": "system", "value": "Make the rails version in the gemspec more restrictive\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"transam_audit/version\"\n\n# Describe your gem and declare its dependencies:\nGem::S...
ruby
chosen
[ { "from": "system", "value": "Set gem version to 0.6.0\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'scoped_search'\n s.version = '0.3.0'\n s.date = '2008-09-21'\n \n s.summary = \"A Rails plugin to search your models using a named_scope\"\n s.descripti...
ruby
chosen
[ { "from": "system", "value": "Test that requests can succeed and fail with a custom event retriever\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe StripeEvent::WebhookController do\n before do\n @base_params = { :use_route => :stripe_event }\n end\n\n context \"with v...
ruby
chosen
[ { "from": "system", "value": "Revert \"Markje pullen. Broken commit pushen.\"\n\nThis reverts commit 58466fb069650cf9ef78cc27ecd8c60f55c7cdd5.\n" }, { "from": "human", "value": "require File.expand_path('../../../app/classes/lazy.rb', __FILE__)\n\ndescribe \"Fukushima\" do\n it \"should fail\" ...
ruby
chosen
[ { "from": "system", "value": "Remove null constraint on tag slug. SQLite3 did /not/ appreciate that.\n" }, { "from": "human", "value": "class AddSlugToTags < ActiveRecord::Migration\n def up\n add_column :tags, :slug, :text, null: false\n end\n\n def down\n remove_column :tags, :slug\n ...
ruby
chosen
[ { "from": "system", "value": "Fix reference to refactored method\n" }, { "from": "human", "value": "class AddRawContents < ActiveRecord::Migration[5.2]\n ANNOTATABLES = [Case, TextBlock]\n\n def up\n create_table :raw_contents do |t| \n t.text :content\n t.references :source, pol...
ruby
chosen
[ { "from": "system", "value": "Add index.md to gem files\n" }, { "from": "human", "value": "# coding: utf-8\n\nGem::Specification.new do |spec|\n spec.name = \"yefeme\"\n spec.version = \"0.4.4\"\n spec.authors = [\"Yefim Vedernikoff\"]\n spec.email = [\"yefim323@...
ruby
chosen
[ { "from": "system", "value": "Add another example api for design by contract\n" }, { "from": "human", "value": "# Design by contract example\n\nclass A\n\n def initialize\n @transactions = []\n @total = 0\n end\n\n def buy price\n @transactions << price\n @total += price\n end\n\...
ruby
chosen
[ { "from": "system", "value": "Add sourceforge appcast for DisplayCAL\n" }, { "from": "human", "value": "cask 'displaycal' do\n version '3.1.1.0'\n sha256 '7cae3f96378833875bdbd3e010c379616c9750494a871c5a117dcde0a619d02d'\n\n # sourceforge.net/projects/dispcalgui was verified as official when ...
ruby
chosen
[ { "from": "system", "value": "Fix `url` stanza comment for LogDNA CLI.\n" }, { "from": "human", "value": "cask 'logdna-cli' do\n version '1.0.9'\n sha256 '76531e0538c9c8945ade50fc5707e1d34945b364a6475f38af6ccd499aad2aaa'\n\n url \"https://github.com/logdna/logdna-cli/releases/download/#{versi...
ruby
chosen
[ { "from": "system", "value": "Remove request_time - other notifications do that\n" }, { "from": "human", "value": "require 'socket'\n\nmodule Heroku\n module UnicornMetrics\n class Queue\n ADDR = IPSocket.getaddress(Socket.gethostname).to_s+':'+ENV['PORT']\n\n def initialize(app)\n...
ruby
chosen
[ { "from": "human", "value": "Add Prolific PL2303 Serial to USB Driver v1.5.1\n" }, { "from": "gpt", "value": "class Pl2303 < Cask\n homepage 'http://www.prolific.com.tw/US/ShowProduct.aspx?p_id=229&pcid=41'\n version '1.5.1'\n url \"http://www.prolific.com.tw/UserFiles/files/md_PL2303_MacOSX_...
ruby
chosen
[ { "from": "system", "value": "Update TG Pro.app to v2.7.4\n" }, { "from": "human", "value": "cask :v1 => 'tg-pro' do\n version '2.7.3'\n sha256 '085ef1270ae2393e1460bb19d3bf3d5430507007a16de9f83bf50bfee5e5dc14'\n\n url \"http://www.tunabellysoftware.com/resources/TGPro_#{version.gsub('.','_')...
ruby
chosen
[ { "from": "system", "value": "Add a missing require statement.\n\nIt appears that the `recap setup` task is untested.\n" }, { "from": "human", "value": "require 'thor'\n\nmodule Recap::Support\n\n # Recap provides a simple command-line tool (`recap`) to generate a `Capfile` in your\n # project...
ruby
chosen
[ { "from": "system", "value": "Make the call to SP in its own thread\n" }, { "from": "human", "value": "module SaasPulse\n BASE_URI = \"http://sdr.saaspulse.com/pixel.gif/?sdr_s=\".freeze unless self.const_defined?(:BASE_URI)\n\n class << self\n attr_reader :client\n\n def srv_id(srv_id)\...
ruby
chosen
[ { "from": "system", "value": "Test that json files are served with correct mime type\n\n[#89505182]\n\nSigned-off-by: Colin Jackson <a89a308d481f83b953c5ad185298958072312fde@gmail.com>\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'deploy a staticfile app' do\n let(:app) ...
ruby
chosen
[ { "from": "system", "value": "Add tvOS support to Podspec" }, { "from": "human", "value": "require 'json'\npackage = JSON.parse(File.read('./package.json'))\n\nPod::Spec.new do |s|\n s.name = 'ReactNativePermissions'\n s.dependency \"React\"\n\n s.version = package[\...
ruby
chosen
[ { "from": "system", "value": "Add in a task description so the db:compile task shows in rake -T\n" }, { "from": "human", "value": "namespace :db do\n task :compile => 'environment' do\n require 'dbcompile'\n DbCompile.build_transaction\n end\nend\n" }, { "from": "gpt", "value...
ruby
chosen
[ { "from": "human", "value": "Add script to migrate S3 log changed in v0.7.0\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\nrequire 'aws-sdk-core'\nrequire 'json'\nrequire 'logger'\n\nbucket = ENV.fetch('BARBEQUE_S3_BUCKET_NAME')\nnum_workers = Integer(ENV.fetch('BARBEQUE_MIGRATOR_NUM_WORK...
ruby
chosen
[ { "from": "system", "value": "Add rake dependency to gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"qtapp/version\"\n\nGem::Specification.new do |s|\n s.name = \"qtapp\"\n s.version = Qtapp::VERSION\n ...
ruby
chosen
[ { "from": "system", "value": "Use ActiveRecord::Generators::Migration in custom user generator\n\nThe former usage of `Rails::Generators::Migration` forced us to write our own `next_migration_number` generator. This generator was erroneous and sometimes lead to duplicated migration versions. Using the activ...
ruby
chosen
[ { "from": "human", "value": "Add a Redis connection pool.\n" }, { "from": "gpt", "value": "require 'connection_pool'\nrequire 'redis'\nrequire 'metriks'\n \nclass RedisPool\n def initialize(options)\n @options = options.delete(:pool)\n @options[:size] ||= 10\n @options[:timeout] ||= 10...
ruby
chosen
[ { "from": "system", "value": "Bump to new autogenerated gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"pidgin2adium/version\"\n\nGem::Specification.new do |s|\n s.name = \"pidgin2adium\"\n s.date ...
ruby
chosen
[ { "from": "system", "value": "Add quick test for testing set_team_captain code in the team model.\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass TeamTest < ActiveSupport::TestCase\n test 'team with ineligible user is ineligible for prizes' do\n assert_equal(false, teams(:t...
ruby
chosen
[ { "from": "system", "value": "Update development dependencies and lock them properly\n" }, { "from": "human", "value": "lib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\n\nrequire 'fork_break/version'\n\nGem::Specification.new do |gem|\n gem.au...
ruby
chosen
[ { "from": "system", "value": "Fix controller issue with environment\n" }, { "from": "human", "value": "require \"rulers/version\"\nrequire \"rulers/array\"\nrequire \"rulers/routing\"\n\nmodule Rulers\n\n class Application\n HTML = 'text/html'\n CONTENT = 'Content-Type'\n\n def call...
ruby
chosen
[ { "from": "system", "value": "Fix bug with comment create\n" }, { "from": "human", "value": "require \"policial\"\n\nrequire \"./lib/custom_ruby\"\n\nclass Runner\n def initialize(config)\n @config = config\n @octokit = Octokit::Client.new(access_token: ENV.fetch(\"GITHUB_TOKEN\"))\n c...
ruby
chosen
[ { "from": "human", "value": "Remove photos that contain nil images\n" }, { "from": "gpt", "value": "class DestroyEmptyPhotos < Mongoid::Migration\n def self.up\n for perspective in Perspective.all\n if perspective.pictures\n for picture in perspective.pictures\n if pictu...
ruby
chosen
[ { "from": "system", "value": "Add rake as a development dependency\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'code_output/version'\n\nGem::Specification.new do |gem|\n...
ruby
chosen
[ { "from": "system", "value": "Upgrade Rubymine EAP to v140.2694\n" }, { "from": "human", "value": "cask :v1 => 'rubymine-eap' do\n version '139.262'\n sha256 'e255b6a0f94fee55e72c9969919619c3431bf6507e678e0ac9303edc0d441072'\n\n url \"http://download.jetbrains.com/ruby/RubyMine-#{version}.dmg...
ruby
chosen
[ { "from": "system", "value": "Change Adamantium.included to call super\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'ice_nine'\nrequire 'memoizable'\n\n# Allows objects to be made immutable\nmodule Adamantium\n\n # Defaults to less strict defaults\n module Flat\n\n # Retu...
ruby
chosen
[ { "from": "system", "value": "Fix breaking change in omniauth-oauth2" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/omniauth-tradegecko/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Bradley Priest\"]\n gem.email ...
ruby
chosen
[ { "from": "system", "value": "Allow undefined events to be logged.\n" }, { "from": "human", "value": "module Aggro\n # Private: Used as a proxy to apply and save events to an aggregate.\n class EventProxy\n def initialize(aggregate, id)\n @aggregate = aggregate\n @id = id\n end...
ruby
chosen
[ { "from": "system", "value": "Fix tests for device init 0.1.8\n\nSigned-off-by: Dieter Reuter <554783fc552b5b2a46dd3d7d7b9b2cce9a82c122@me.com>\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe package('device-init') do\n it { should be_installed }\nend\n\ndescribe command('d...
ruby
chosen
[ { "from": "system", "value": "Return actual json in 404 (fixes issue with recent cehf bootstrap)\n" }, { "from": "human", "value": "module ChefZero\n module Endpoints\n class NotFoundEndpoint\n def call(request)\n return [404, {\"Content-Type\" => \"application/json\"}, \"Object ...
ruby
chosen
[ { "from": "system", "value": "Remove custom error from stub\n" }, { "from": "human", "value": "class SimpleCalculator\n ALLOWED_OPERATIONS = ['+', '/', '*']\n\n UnsupportedOperation = Class.new(StandardError)\n\n def self.calculate(first_operand, second_operand, operation)\n raise NotImple...
ruby
chosen
[ { "from": "system", "value": "Validate selections for dynamic fields\n" }, { "from": "human", "value": "module GraphQL\n module StaticValidation\n # Scalars _can't_ have selections\n # Objects _must_ have selections\n class FieldsHaveAppropriateSelections\n include GraphQL::Static...
ruby
chosen
[ { "from": "system", "value": "Add \"sully\" to maintainer user seeds\n" }, { "from": "human", "value": "if Rails.env.development? || ENV['STAGING']\n names = %w[kevin rachel austin]\n\n names.each do |name|\n User.find_or_create_by!(email: \"#{name}@odin.com\") do |user|\n user.usernam...
ruby
chosen
[ { "from": "system", "value": "Fix gemspec to use relative paths\n\nCloses #3.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nGem::Specification.new do |gem|\n gem.authors = [\"Jason Webb\"]\n gem.email = [\"bigjasonwebb@gmail.com\"]\n gem.summary = \"A sma...
ruby
chosen
[ { "from": "system", "value": "Add homepage to store location conditional so if user sign in from homepage redirect to courses and not back to root\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n protect_from_forgery\n include BootstrapFlashHelper\n in...
ruby
chosen
[ { "from": "system", "value": "Add rspec as dev dependency\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'delegate_to_instance/version'\n\nGem::Specification.new do |spec|\n spec.na...
ruby
chosen
[ { "from": "system", "value": "Add tests for inc and hlf.\n" }, { "from": "human", "value": "require 'test-helper'\nrequire 'day-23-opening-the-turing-lock'\n\nclass TestDay23OpeningTheTuringLock < Minitest::Test\n def test_run_program\n input = <<END\ninc a\njio a, +2\ntpl a\ninc a\nEND\n ...
ruby
chosen
[ { "from": "system", "value": "Extend Redcarpet markdown to support footnotes for the one copy that uses them" }, { "from": "human", "value": "module Discuss\n module ApplicationHelper\n def message_person(mailbox_name, message)\n mailbox_name == 'inbox' ? message.sender : message.recipi...
ruby
chosen
[ { "from": "system", "value": "Update encidong for file with my name\n" }, { "from": "human", "value": "require \"attrtastic/semantic_attributes_helper\"\nrequire \"attrtastic/semantic_attributes_builder\"\n##\n# Attrtastic, in its assumption, should be similar to formtastic and\n# ease displayin...
ruby
chosen
[ { "from": "system", "value": "Fix mobi spec by require the mobi file" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Mobi do\n it \"should instantiate a Mobi::Metadata object\" do\n file = File.open('spec/fixtures/test.mobi')\n Mobi.metadata(file).should be_an_instance_...
ruby
chosen
[ { "from": "system", "value": "Add html-pipeline dependency again because upstream is fixed\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'html/pipeline/gitlab/version'\n\nGem::Speci...
ruby
chosen
[ { "from": "system", "value": "Remove excess alias from register mime type\n" }, { "from": "human", "value": "require 'imgkit'\nrequire 'asciiart'\nrequire 'tempfile'\n\nmodule Croissant\n class Engine\n\n def initialize(source)\n @source = source\n end\n\n def render\n img_pa...
ruby
chosen
[ { "from": "system", "value": "Use the version from the conventional version.rb file." }, { "from": "human", "value": "require 'guard'\nrequire 'guard/guard'\nrequire 'less'\n\nmodule Guard\n class Less < Guard\n\n # ================\n # = Guard method =\n # ================\n\n def ...
ruby
chosen
[ { "from": "system", "value": "Use the correct globbed Array syntax.\n" }, { "from": "human", "value": "require 'formula'\n\nclass Chruby < Formula\n\n url 'https://github.com/downloads/postmodern/chruby/chruby-0.2.1.tar.gz'\n homepage 'https://github.com/postmodern/chruby#readme'\n md5 '8ed8b...
ruby
chosen
[ { "from": "system", "value": "Use public_send instead of send\n" }, { "from": "human", "value": "module LazyConst\n\n CACHE = {}\n\n def lazy_const(name, &block)\n raise Error(\"lazy_const requires a block\") unless block_given?\n LazyConst::CACHE[\"#{self.name}.#{name}\"] = nil\n def...
ruby
chosen
[ { "from": "human", "value": "Write tests for excluding log messages based on an environment variable.\n" }, { "from": "gpt", "value": "require_relative 'test_init'\n\nclass ExcludeLogMessages\n attr_accessor :logger\n\n def self.build\n instance = new\n Telemetry::Logger.configure instan...
ruby
chosen
[ { "from": "system", "value": "Rewrite get_rand method - less LOC, better alhorithm, names.\n\nComplexity is now O(N), where N is number of array elements.\n" }, { "from": "human", "value": "class Array\n \n def get_rand(arr)\n raise \"Wrong number of arguments\" unless arr.size == self.size...
ruby
chosen
[ { "from": "system", "value": "Add json converting methods to HetsOptions\n\nThose are needed for async calls with sidekiq, because it can only\npass basic data types to asynchronously called methods.\n" }, { "from": "human", "value": "module Hets\n class HetsOptions\n attr_reader :options\n\...
ruby
chosen
[ { "from": "system", "value": "Correct gem name in gemspec\n\n\tmodified: exceltocsv.gemspec\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'exceltocsv/version'\n\nGem::Specificatio...
ruby
chosen
[ { "from": "system", "value": "Validate uniqueness of image upload only for new records\n" }, { "from": "human", "value": "class PictureImageValidator < ActiveModel::Validator\n def validate(record)\n unless record.image_file.attached?\n record.errors[:base] << 'Image missing'\n ret...
ruby
chosen
[ { "from": "system", "value": "Rename 'lsd' to 'lys' internally\n" }, { "from": "human", "value": "require 'logger'\n\nLOG ||= Logger.new($stdout)\n\n# CI service with hooks for GitHub, BitBucket and git repositories\nmodule Lysergide\n def self.start(port)\n GC.enable\n require 'lysergide...
ruby
chosen
[ { "from": "system", "value": "Add missing argument for completeness worker\n\nThere was a missing argument, as well as as a missing call to self.class\nfor symbolize_keys which prevented the completeness metric from working.\nThis commit fixes that.\n\nSigned-off-by: Konrad Reiche <4ff0213f56e2082fcd8c882d0...
ruby
chosen
[ { "from": "system", "value": "Allow precision algorithm to process integers\n" }, { "from": "human", "value": "require 'encoded_polyline'\n\nmodule OSRM\n class Route\n attr_accessor :geometry, :summary\n\n def initialize(geometry: nil, summary: nil)\n @geometry = decode_geometry(geo...
ruby
chosen
[ { "from": "system", "value": "Add additional test coverage for edition role appointments\n\nThis adds some missing coverage around exposing the role appointments in search\ndata when present.\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass Edition::RoleAppointmentsTest < Active...
ruby
chosen
[ { "from": "system", "value": "Set minimum password score for Admin model to 3\n\nThis is the score for zxcvbn\n" }, { "from": "human", "value": "class Admin < ActiveRecord::Base\n include PgSearch\n\n # Include default devise modules. Others available are:\n # :confirmable, :lockable, :timeou...
ruby
chosen
[ { "from": "system", "value": "Fix issue with loading polymorphic association from Audit\n" }, { "from": "human", "value": "class Audit < Sequel::Model\n\n many_to_one :auditable, reciprocal: :audits, reciprocal_type: :many_to_one,\n setter: (proc do |auditable|\n ...
ruby
chosen
[ { "from": "system", "value": "Add a data bag to result objects" }, { "from": "human", "value": "require \"next_step/version\"\n\nmodule NextStep\n\n StepResult = Struct.new(:continue, :message, :exception, :payload, :step)\n EventMissingError = Class.new(StandardError)\n\n autoload :StepRunne...
ruby
chosen
[ { "from": "system", "value": "Fix crash when runing Rails4\n\n- wrong number of arguments (given 2, expected 1)\n" }, { "from": "human", "value": "class OpenHash < ActiveSupport::HashWithIndifferentAccess\n class << self\n def [](hash = {})\n new(hash)\n end\n end\n \n def initial...
ruby
chosen
[ { "from": "system", "value": "Fix migration for envs without distributors\n" }, { "from": "human", "value": "class EnsureShippingMethodsHaveDistributors < ActiveRecord::Migration\n def up\n d = Enterprise.is_distributor.first\n sms = Spree::ShippingMethod.where('distributor_id IS NULL')\n...
ruby
chosen
[ { "from": "system", "value": "Add Swift version into podspec\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'OAuthSwift'\n s.version = '1.2.2'\n s.license = 'MIT'\n s.summary = 'Swift based OAuth library for iOS and macOS.'\n s.homepage = 'https://github.com/OAuthSwift/O...
ruby
chosen
[ { "from": "system", "value": "Use File.basename instead of regex to determine slugs\n" }, { "from": "human", "value": "module Trackler\n # Problems is the collection of problems that we have metadata for.\n class Problems\n include Enumerable\n\n SLUG_PATTERN = Regexp.new(\".*\\/exercise...
ruby
chosen
[ { "from": "system", "value": "Fix build info script to use the correct BuildInfo class.\n" }, { "from": "human", "value": "puts 'building /target/build-metadata.json'\nrequire 'java'\nrequire 'rubygems'\nrequire 'json'\nrequire File.join( File.dirname( __FILE__ ), '../../../modules/core/target/t...
ruby
chosen
[ { "from": "system", "value": "Fix config all questions arg is 0\n" }, { "from": "human", "value": "module Rorr\n class Init\n def initialize(arguments)\n @arguments = arguments\n end\n\n def run\n parse_options\n Rorr::Main.choose\n end\n\n private\n\n def parse...
ruby
chosen
[ { "from": "system", "value": "Add an inspect method to FD\n" }, { "from": "human", "value": "module Rubysh\n class FD\n attr_accessor :fileno\n\n def initialize(fileno)\n case fileno\n when Integer\n # pass\n when :stdin\n fileno = 0\n when :stdout\n ...
ruby
chosen
[ { "from": "human", "value": "Create a helper class that constructs Fog::Compute connection strings and gathers AWS IAM credentials from instance metadata.\n" }, { "from": "gpt", "value": "require 'open-uri'\nrequire 'json'\nrequire 'fog'\n\n# Support IAM instance profiles\nclass EC2Helper\n\n #...
ruby
chosen
[ { "from": "system", "value": "Add a method to download a users public orgs" }, { "from": "human", "value": "class GithubUser < ActiveRecord::Base\n has_many :github_contributions\n has_many :github_repositories, primary_key: :github_id, foreign_key: :owner_id\n has_many :source_github_reposit...
ruby
chosen
[ { "from": "system", "value": "Add default from address to Usermailer class\n\n- Add default from address to Usermailer class\n" }, { "from": "human", "value": "class UserMailer < Devise::Mailer\n \n def confirmation_instructions(record, opts={})\n end\n \n def signup_notification(user)\n ...
ruby
chosen
[ { "from": "system", "value": "Add swift version to podspec\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'SnapKit'\n s.version = '4.0.0'\n s.license = 'MIT'\n s.summary = 'Harness the power of auto layout with a simplified, chainable, and compile time safe syntax.'\n s....
ruby
chosen
[ { "from": "system", "value": "Simplify code to reuse ContentPlanner.needs_api\n" }, { "from": "human", "value": "require 'gds_api/need_api'\n\nclass ImportNeeds\n class << self\n def api\n @api ||= GdsApi::NeedApi.new( Plek.current.find('need-api'), API_CLIENT_CREDENTIALS )\n end\n\n...
ruby
chosen