conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Send full user for api login\n" }, { "from": "human", "value": "class API::V1::SessionsController < API::APIController\n\n def create\n @user = User.find_by username: user_params[:username]\n if @user.present? && @user.authenticate(user_params[:password])\n ...
ruby
chosen
[ { "from": "system", "value": "Remove transaction to try to remedy \"Deadlock found when trying to get lock; try restarting transaction\"\n\nReplace with a simpler scheme that just retries\n" }, { "from": "human", "value": "class ConnectionLogsController < ApplicationController\n skip_before_fil...
ruby
chosen
[ { "from": "system", "value": "Add with_commas method to NumberFormatter module\n" }, { "from": "human", "value": "module NumberFormatter\n def with_suffix\n suffix = [\"k\", \"m\"]\n if (self < 1000)\n self.to_s\n else\n exp = (Math.log(self) / Math.log(1000)).to_i\n \"%...
ruby
chosen
[ { "from": "system", "value": "Use Chef::Version in VersionedRecipeList CHEF-1818\n" }, { "from": "human", "value": "#\n# Author:: Stephen Delano (<stephen@opscode.com>)\n# Copyright:: Copyright (c) 2010 Opscode, Inc.\n# License:: Apache License, Version 2.0\n#\n# Licensed under the Apache Licens...
ruby
chosen
[ { "from": "system", "value": "Add puntine dependance on ruote, ruote-redis and ruote-sequel" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'bumbleworks/version'\n\nGem::Specification.n...
ruby
chosen
[ { "from": "system", "value": "Add rake as a development dependency\n" }, { "from": "human", "value": "$LOAD_PATH.push File.expand_path(\"lib\")\nrequire 'bundler_ext/version'\n\n\nGem::Specification.new do |s|\n s.name = \"bundler_ext\"\n s.version = BundlerExt::VERSION\n s.platfor...
ruby
chosen
[ { "from": "system", "value": "Define the plugin name before yielding the block\n" }, { "from": "human", "value": "module Rack\n module Tracker\n module Plugins\n class DSL\n include Rack::Tracker::Macros\n\n @@currently_defining = nil\n\n def initialize plugin_name,...
ruby
chosen
[ { "from": "human", "value": "Add rspec tests for collections controller\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe CollectionsController do\n\n let(:user) {User.create!(first_name: 'John', last_name: \"Doe\", username: \"john123\", password: 'password ' )}\n let(:game) ...
ruby
chosen
[ { "from": "system", "value": "Make clean folder recursive so that it clears an entire tree of files\n" }, { "from": "human", "value": "class Cleaner\n def self.clean_folder path\n Dir.glob(path + \"/**\").sort.each do |file|\n if File.file?(file)\n self.rename_file file, path\n ...
ruby
chosen
[ { "from": "system", "value": "Update bundler requirement from ~> 1.5 to ~> 2.2\n\nUpdates the requirements on [bundler](https://github.com/rubygems/rubygems) to permit the latest version.\n- [Release notes](https://github.com/rubygems/rubygems/releases)\n- [Changelog](https://github.com/rubygems/rubygems/bl...
ruby
chosen
[ { "from": "system", "value": "Test app is not called when limit exceeded\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'rack/test'\nrequire 'penguin'\n\ndescribe Penguin do\n include Rack::Test::Methods\n\n let(:middleware) {\n Penguin::Middleware.new(\n lambda { |e...
ruby
chosen
[ { "from": "system", "value": "Use HTTPS for schema.org requests\n" }, { "from": "human", "value": "module SchemaOrgHelper\n def meta_person_schema_url\n 'http://schema.org/Person'\n end\n\n def meta_address_schema_url\n 'http://schema.org/Address'\n end\n\n def meta_article_schema_url...
ruby
chosen
[ { "from": "human", "value": "Add integration_id to SIS models\n\nAn integration_id can be used in a way similar to sis_source_id in\nthat it documents a 3rd party identifier for a particular object. The\nreason we use an integration_id instead of a sis_source_id for some\nSIS integrations is that there is B...
ruby
chosen
[ { "from": "system", "value": "Handle deleted projects when filtering suggestions" }, { "from": "human", "value": "class ProjectSuggestion < ActiveRecord::Base\n validates_presence_of :user, :project, :notes\n\n belongs_to :user\n belongs_to :project\n\n def done?\n !pending\n end\n\n de...
ruby
chosen
[ { "from": "system", "value": "Update gemspec with more detail\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'kato/cli/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Make RSS feed author list and section bold.\n" }, { "from": "human", "value": "xml.instruct!\nxml.rss(\"version\" => \"2.0\", \"xmlns:dc\" => \"http://purl.org/dc/elements/1.1/\") do\n xml.channel do\n xml.title @feed_title\n xml.link @feed_url\n xml.descr...
ruby
chosen
[ { "from": "system", "value": "Remove ':tel' display on member page when nil\n\nAdded logic to application_helper to check if phone\nvalue is nil and remove ':tel' display value\n" }, { "from": "human", "value": "module ApplicationHelper\n def phone_to(number)\n link_to number, \"tel:#{number...
ruby
chosen
[ { "from": "system", "value": "Change client method to return authorized client when authenticated.\n" }, { "from": "human", "value": "module ApplicationHelper\n module AuthorizeHelper\n def client\n @client ||= Instagram.client\n end\n\n def authenticated?\n session[:access_t...
ruby
chosen
[ { "from": "system", "value": "Update byebug to latest and greatest\n" }, { "from": "human", "value": "$:.push File.expand_path('../lib', __FILE__)\nrequire 'icepick/version'\n\nGem::Specification.new do |gem|\n gem.name = 'icepick'\n gem.version = Icepick::VERSION\n gem.authors...
ruby
chosen
[ { "from": "system", "value": "Define private interface for import task report\n" }, { "from": "human", "value": "class ImportTaskReport\n\n attr_accessor :models_for_report\n\n def initialize(models_for_report)\n @models_for_report = models_for_report\n end\n\n def humanize_class_name(kla...
ruby
chosen
[ { "from": "system", "value": "Remove useless category lookup in ArticleService\n" }, { "from": "human", "value": "class ArticleService\n def initialize(db)\n @db = db\n end\n \n def fetch(id)\n article = @db[:articles].where(:id => id).first\n article[:category] = CategoryService.ne...
ruby
chosen
[ { "from": "system", "value": "Add input value portion scaffolding.\n" }, { "from": "human", "value": "module PPCurses\n\n class InputElement\n\n attr_accessor :label\n attr_accessor :size\n\n def initialize(label, size )\n @label = label\n @size = size\n end\n\n def sho...
ruby
chosen
[ { "from": "system", "value": "Remove unused VarintField.decode method (handled by Decoder)\n" }, { "from": "human", "value": "require 'protobuf/field/base_field'\n\nmodule Protobuf\n module Field\n class VarintField < BaseField\n\n ##\n # Constants\n #\n\n INT32_MAX = 2...
ruby
chosen
[ { "from": "system", "value": "Add logging to scheduled transfer invocation\n" }, { "from": "human", "value": "require \"bundler\"\nBundler.require\n\nrequire \"./lib/initializer\"\nrequire \"clockwork\"\n\n$stdout.sync = true\n\nclass LogStub\n # Pliny does not make it easy to log without actua...
ruby
chosen
[ { "from": "system", "value": "Add MIT license to gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.unshift File.expand_path('../lib', __FILE__)\nrequire 'history_book/version'\n\nGem::Specification.new do |s|\n s.name = 'history_book'\n s.version = HistoryBook...
ruby
chosen
[ { "from": "system", "value": "Fix race conditions in this trivial unit test. Headdesk.\n" }, { "from": "human", "value": "require \"spec_helper\"\nrequire \"bunny/concurrent/synchronized_sorted_set\"\n\ndescribe Bunny::Concurrent::SynchronizedSortedSet do\n it \"synchronizes common operations n...
ruby
chosen
[ { "from": "system", "value": "fix(db): Fix typo for aurora postgresql\n\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Drivers\n module Db\n class Postgresql < Base\n adapter :postgresql\n allowed_engines :postgres, :postgresql, :'aurora-postresql'\n ...
ruby
chosen
[ { "from": "system", "value": "Allow Net::HTTP to use it's default delimiter\n\nA semicolon with no space is no longer supported by rack, so request\nwill be malformed\n" }, { "from": "human", "value": "require 'uri'\nrequire 'net/https'\nrequire 'yaml'\nrequire 'rubygems'\nrequire 'json'\nrequir...
ruby
chosen
[ { "from": "system", "value": "Refactor “class << self” to “extend self” in module Congress.\n" }, { "from": "human", "value": "require 'congress/client'\n\nmodule Congress\n class << self\n attr_accessor :key\n def configure\n yield self\n end\n\n # Alias for Congress::Client.n...
ruby
chosen
[ { "from": "system", "value": "Add missing require for allocator builder\n" }, { "from": "human", "value": "require 'singleton'\nrequire_relative 'knapsack/version'\nrequire_relative 'knapsack/config/env'\nrequire_relative 'knapsack/config/tracker'\nrequire_relative 'knapsack/logger'\nrequire_rel...
ruby
chosen
[ { "from": "human", "value": "Add compare method and Card class\n" }, { "from": "gpt", "value": "class Deck\n\n\n def compare\n if user_input == pick_card.question\n output_correct\n pick_card\n elsif user_input == 'exit'\n puts \"Quitter.\"\n else\n output_incorrect...
ruby
chosen
[ { "from": "system", "value": "Use caller filename by default\n" }, { "from": "human", "value": "require 'rblineprof'\nrequire 'rack/lineprof/source_extension'\n\nclass Lineprof\n IGNORE_PATTERN = /lib\\/lineprof\\.rb$/\n\n class << self\n def profile(&block)\n value = nil\n result...
ruby
chosen
[ { "from": "system", "value": "Add learn-open as runtime dep\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'learn/version'\n\nGem::Specification.new do |spec|\n spec.name =...
ruby
chosen
[ { "from": "system", "value": "[REFACTORING] Use the fantastic new .each method\n" }, { "from": "human", "value": "require 'pp'\n\ndb_configs = []\nfull_configuration[:environments].each_key do |env|\n next if env == :all\n full_configuration[:environments][env].each_pair do |target, data|\n ...
ruby
chosen
[ { "from": "system", "value": "Fix ruby 1.9 issue where it doesn't ignore most assigns because controller.protected_instance_variables array looks like string in ruby 1.8.7 and like :string in 1.9\n" }, { "from": "human", "value": "require \"#{File.dirname(__FILE__)}/abstract_note\"\n\nmodule Foo...
ruby
chosen
[ { "from": "system", "value": "Remove explicit versions of development dependencies\n\nProbably better to fix problems with newer versions of development\ntooling, rather than pin to old versions.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOA...
ruby
chosen
[ { "from": "system", "value": "Fix admin/ migration problem with 0_initial_schema, from Eridius\n\ngit-svn-id: 70ab0960c3db1cbf656efd6df54a8f3de72dc710@607 820eb932-12ee-0310-9ca8-eeb645f39767\n" }, { "from": "human", "value": "module Migrator\n mattr_accessor :offer_migration_when_available\n ...
ruby
chosen
[ { "from": "system", "value": "Send message even when spam for now\n" }, { "from": "human", "value": "class SpamWorker\n include Sidekiq::Worker\n\n def perform(message_id)\n @message = Georgia::Message.find(message_id)\n @message.update_attributes(spam: @message.spam?, verified_at: Time....
ruby
chosen
[ { "from": "system", "value": "Allow admins to use SCIM API\n" }, { "from": "human", "value": "class Ability\n include SocialStream::Ability\n\n def initialize(subject)\n super\n\n if subject.is_a?(Application) && subject.store?\n can :create, Purchase\n end\n\n can :read, Rela...
ruby
chosen
[ { "from": "system", "value": "Revert \"Forcing logger enabling from outside to HTTPI\"\n\nThis reverts commit 3035c99cb09764fc02052c7e418a8229b867734f.\n" }, { "from": "human", "value": "require 'singleton'\nrequire 'httpi'\nrequire 'nokogiri'\nrequire 'json'\n\nrequire \"rbraspag/version\"\nreq...
ruby
chosen
[ { "from": "system", "value": "Use config const instead of hardcoded value in Bot\n\nIt was using a hardcoded string for the default config path.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'logger'\n\nrequire 'chatrix/bot/errors'\nrequire 'chatrix/bot/version'\nre...
ruby
chosen
[ { "from": "system", "value": "Use translated text for shipment in AdjustmentsHelper\n" }, { "from": "human", "value": "module Spree\n module Admin\n module AdjustmentsHelper\n def adjustment_state(adjustment)\n state = adjustment.state.to_sym\n icon = { closed: 'icon-lock'...
ruby
chosen
[ { "from": "system", "value": "Add a failing spec for ignoring comments\n\nOS-10\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Expando::Expander do\n it 'properly expands tokenized text' do\n lines = [ '(I|we|they) heard you (love|hate) (cars|boats|bikes)' ]\n expand...
ruby
chosen
[ { "from": "system", "value": "Update podspec to point to correct file\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n\ns.name = 'SwiftyReceiptValidator'\ns.version = '6.0.0'\ns.license = 'MIT'\ns.summary = 'A swift helper for in app purchase receipt validation.'\n\ns.homepage = 'https:...
ruby
chosen
[ { "from": "human", "value": "Add custom RSpec Twilio matchers from CityVoice, via @ohrite\n" }, { "from": "gpt", "value": "require 'nokogiri'\n\nRSpec::Matchers.define :redirect_twilio_to do |expected|\n match do |actual|\n doc = Nokogiri::XML::Document.parse(actual)\n node = doc.xpath('R...
ruby
chosen
[ { "from": "system", "value": "Fix query builder specs by including :order => nil" }, { "from": "human", "value": "require \"#{File.dirname(__FILE__)}/../spec_helper\"\n\ndescribe ScopedSearch::QueryBuilder do\n\n before(:each) do\n @definition = mock('ScopedSearch::Definition')\n @definit...
ruby
chosen
[ { "from": "system", "value": "Use `module_fuction` instead of `extend self`\n\nhttps://github.com/rubocop-hq/ruby-style-guide#module-function\n" }, { "from": "human", "value": "module HooksUtils\n extend self\n\n # Gets an array of Git push options from the environment\n def get_push_options\...
ruby
chosen
[ { "from": "system", "value": "Use dots instead of underscores for statsd keys.\n" }, { "from": "human", "value": "require 'geocoder'\n\nclass GeocodeAdviserJob < ActiveJob::Base\n def perform(adviser)\n coordinates = Geocoder.coordinates(adviser.full_street_address)\n coordinates ? stat(:...
ruby
chosen
[ { "from": "human", "value": "Test for get of stream that doesn't exist\n" }, { "from": "gpt", "value": "require_relative './database_integration_init'\n\ndescribe \"Get a Stream that Doesn't Exist\" do\n stream_name = EventStore::Client::HTTP::Controls::StreamName.get \"testNotFound\"\n path =...
ruby
chosen
[ { "from": "human", "value": "Add MongoHub.app latest\ncurrent version 3.1.4" }, { "from": "gpt", "value": "cask :v1 => 'mongohub' do\n version :latest\n sha256 :no_check\n\n url 'https://mongohub.s3.amazonaws.com/MongoHub.zip'\n name 'MongoHub'\n homepage 'https://github.com/jeromelebel/Mon...
ruby
chosen
[ { "from": "human", "value": "Add new cask for Sqwiggle.app.\n" }, { "from": "gpt", "value": "class Sqwiggle < Cask\n url 'https://www.sqwiggle.com/download/mac'\n homepage 'https://www.sqwiggle.com'\n version '0.4.2'\n sha1 '15c49c5443780749ca833605bd61f9ee0b4d8105'\n link 'Sqwiggle.app'\ne...
ruby
chosen
[ { "from": "system", "value": "Use latest release of bundler.\n\nRequired for ruby_22 flag.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'gutentag'\n s.version = '0.6.0'\n s.authors = ['Pat Allan']\n s.email = ['pa...
ruby
chosen
[ { "from": "system", "value": "Fix issue with orphaned adjustments in migration\n" }, { "from": "human", "value": "class AddOrderToAdjustments < ActiveRecord::Migration\n class Spree::Adjustment < ActiveRecord::Base\n belongs_to :adjustable, polymorphic: true\n belongs_to :order, class_nam...
ruby
chosen
[ { "from": "system", "value": "Update require path, amateur hour over here\n" }, { "from": "human", "value": "class SpotRate\n class CurrencyNotFound < RuntimeError; end\n\n attr_accessor :from_currency, :to_currency\n\n def self.available_converters\n @@available_converters ||= {}\n end\n...
ruby
chosen
[ { "from": "system", "value": "Fix | Contextualizing delayed message config with adapter\n" }, { "from": "human", "value": "module RailsAdmin\n module Models\n module Setup\n module DelayedMessageAdmin\n extend ActiveSupport::Concern\n\n included do\n rails_admin d...
ruby
chosen
[ { "from": "system", "value": "Test options for location_only and timezone_only\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass LocotimezoneTest < Minitest::Test\n attr_reader :loco\n\n def test_that_it_has_a_version_number\n refute_nil ::Locotimezone::VERSION\n end\n\n d...
ruby
chosen
[ { "from": "system", "value": "Revert \"Fix bug during deployment on not null column conditionning_unit in products.\"\n\nThis reverts commit 27b3244eba4901962aef6b3f2832efb3d532d740.\n" }, { "from": "human", "value": "class AddConditioningUnitToProducts < ActiveRecord::Migration\n def up\n a...
ruby
chosen
[ { "from": "system", "value": "Fix missing dev dependency rake\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nGem::Specification.new do |s|\n s.name = 'aruba-doubles'\n s.version = '0.3.0b'\n s.authors = [\"Björn Albers\"]\n s.email = [\"bjoernalbers@goog...
ruby
chosen
[ { "from": "system", "value": "Add wirble as a development dependency.\n" }, { "from": "human", "value": "$:.unshift File.expand_path('lib', File.dirname(__FILE__))\nrequire 'looksee/version'\n\nGem::Specification.new do |s|\n s.name = 'looksee'\n s.version = Looksee::VERSION\n s.authors = [\"...
ruby
chosen
[ { "from": "human", "value": "Add user id to search terms\n" }, { "from": "gpt", "value": "migration 7, :add_user_id_to_search_terms do\n up do\n execute 'DROP INDEX searchable_messages_tsv'\n execute 'DROP MATERIALIZED VIEW searchable_messages;'\n\n execute <<~SQL\n CREATE MATERIA...
ruby
chosen
[ { "from": "system", "value": "Use selenium jar version 1.47.1\n" }, { "from": "human", "value": "default['selenium']['url'] =\n 'https://selenium-release.storage.googleapis.com/2.47/selenium-server-standalone-2.47.0.jar'\n\ndefault['selenium']['windows']['home'] = \"#{ENV['SYSTEMDRIVE']}/seleni...
ruby
chosen
[ { "from": "human", "value": "Add chef-spec for restore recipe\n" }, { "from": "gpt", "value": "require_relative '../spec_helper'\n\ndescribe 'backup_restore::restore' do\n let(:chef_run) do\n runner = ChefSpec::Runner.new(\n cookbook_path: %w(site-cookbooks cookbooks),\n platform: ...
ruby
chosen
[ { "from": "system", "value": "Use split instead of gsub.\n" }, { "from": "human", "value": "class String\n\n def namespace\n underscore.split(\"/\")[0...-1].join(\"/\")\n end\n\n def extract_settings\n gsub(/ /, '').split(',')\n end\n\n def remove_prefix(prefix = 'admin/')\n partit...
ruby
chosen
[ { "from": "system", "value": "Remove pry require in Document\n" }, { "from": "human", "value": "require 'nokogiri'\nrequire 'pry'\n\nmodule Minotaur\n class Document\n def initialize(html)\n @html = Nokogiri::HTML(html)\n end\n\n def preview_elements\n html.css('img, video, i...
ruby
chosen
[ { "from": "system", "value": "Check if the file exists before we try to get version information from it\n" }, { "from": "human", "value": "require 'serverspec'\n\ninclude Serverspec::Helper::Exec\ninclude Serverspec::Helper::DetectOS\n\n%w[haskell haskell-min].each do |p|\n describe package(p) ...
ruby
chosen
[ { "from": "system", "value": "Use bundle exec in post install message's suggested command\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"localdoc/version\"\n\n# Describe your gem and declare its dependencies:\nGem::S...
ruby
chosen
[ { "from": "system", "value": "Bump gem version and allow Ruby 2.4.\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'classy_hash'\n s.version = '0.2.0'\n s.license = 'MIT'\n s.files = ['lib/classy_hash.rb', 'lib/classy_hash/generate.rb']\n s.summary = 'Classy Hash...
ruby
chosen
[ { "from": "system", "value": "Add method to parse XML booleans\n\nCurrently we don't convert boolean objects returned by the server to the\nRuby representation of booleans. This complicates further treatment of\nthese values, as they have to be treated as strings. To avoid that this\npatch introduces a new ...
ruby
chosen
[ { "from": "system", "value": "Use forwardable from the stdlib\n" }, { "from": "human", "value": "module Rack\n module Test\n \n module Methods\n \n def self.delegate_to_rack_test_session(*meths)\n meths.each do |meth|\n self.class_eval <<-RUBY\n def #{...
ruby
chosen
[ { "from": "system", "value": "Fix the cucumber virus checker so that it mimics the VirusScanHelper\n\nThis is needed as we will mark the files a not clean otherwise.\nAnd Images on people have many variations which also need moving\n" }, { "from": "human", "value": "\nWhen(/^I make unsaved chang...
ruby
chosen
[ { "from": "system", "value": "Remove .m files from public_header_files in .podspec\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'MDCSwipeToChoose'\n s.version = '0.2.1'\n s.summary = 'Swipe to \"like\" or \"dislike\" any view, just like Tinder.app. Build a flashcard app,...
ruby
chosen
[ { "from": "system", "value": "fix: Make update scheduler more performant\n" }, { "from": "human", "value": "class UpdateScheduler\n include Sidekiq::Worker\n include Sidetiq::Schedulable\n\n sidekiq_options :queue => 'update_scheduler'\n\n recurrence { hourly }\n\n def perform\n Componen...
ruby
chosen
[ { "from": "system", "value": "Allow ActiveRecord and ActiveSupport 6.0" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'acts_as_paranoid/version'\n\nGem::Specification.new do |spec|\n ...
ruby
chosen
[ { "from": "system", "value": "Add carrier wave AWS configuration\n" }, { "from": "human", "value": "Crowdblog.user_class = 'Identity'\n\nRails.application.config.discus_key = ENV['DISQUS_KEY']\nRails.application.config.publishers = ENV['PUBLISHERS']\n" }, { "from": "gpt", "value": "C...
ruby
chosen
[ { "from": "human", "value": "Add US States abbreviations -> full name hash\n" }, { "from": "gpt", "value": "US_STATES = {\n 'AL' => 'Alabama',\n 'AK' => 'Alaska',\n 'AS' => 'America Samoa',\n 'AZ' => 'Arizona',\n 'AR' => 'Arkansas',\n 'CA' => 'California',\n 'CO' => 'Colorado',\n 'CT' =>...
ruby
chosen
[ { "from": "system", "value": "Use cwd instead of cd for gohai software\n" }, { "from": "human", "value": "name \"datadog-gohai\"\ndefault_version \"last-stable\"\nalways_build true\n\nenv = {\n \"GOROOT\" => \"/usr/local/go\",\n \"GOPATH\" => \"/var/cache/omnibus/src/datadog-gohai\"\n}\n\nbuil...
ruby
chosen
[ { "from": "human", "value": "Add test for parsing MovieWalker page.\n" }, { "from": "gpt", "value": "# -*- coding: utf-8 -*-\n\nrequire 'test-unit'\nrequire 'nokogiri'\nrequire 'open-uri'\n\nrequire 'shishakai_bot/movie_walker'\n\nmodule ShishakaiBot\n class TestMovieWalkerParse < Test::Unit::T...
ruby
chosen
[ { "from": "system", "value": "Fix url generation by meeting proposal model\n" }, { "from": "human", "value": "class MeetingProposal < ActiveRecord::Base\n self.table_name = 'meetings_proposals'\n\n belongs_to :meeting, counter_cache: :proposals_count\n belongs_to :proposal\n\n delegate :titl...
ruby
chosen
[ { "from": "system", "value": "Update home page link to 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 'vagrant-proxyconf/version'\n\nGem::Specification.new do |spec|\n spec....
ruby
chosen
[ { "from": "system", "value": "Disable Discourse per commit benchmarks.\n" }, { "from": "human", "value": "module BenchmarkPool\n def self.enqueue(repo_name, commit_sha)\n case repo_name\n when 'ruby'\n RemoteServerJob.perform_later(commit_sha, 'ruby_trunk')\n RemoteServerJob.per...
ruby
chosen
[ { "from": "system", "value": "Add unimplemented test for display of attachments\n\nThis test replaces some of the tests that we've just removed...\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass Admin::GenericEditionsController::AttachmentsWorkflowTest < ActionController::TestC...
ruby
chosen
[ { "from": "human", "value": "Update bsf area east-of-england to eastern\n" }, { "from": "gpt", "value": "class UpdateEasternArea < Mongoid::Migration\n def self.up\n updated = []\n BusinessSupportEdition.where(:state.ne => \"archived\", :areas.in => [\"east-of-england\"]).each do |edition...
ruby
chosen
[ { "from": "system", "value": "Load achievements on achievement index page\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass AchievementsController < ApplicationController\n before_action :load_game, :filter_access_before_game_open, :load_message_count\n include ActionVi...
ruby
chosen
[ { "from": "system", "value": "Add task list to params and add destroy action\n" }, { "from": "human", "value": "class Api::V1::TasksController < ApplicationController\n before_action :authenticate_user!\n before_action :find_task, only: [:show, :update]\n\n def show\n respond_with @task\n ...
ruby
chosen
[ { "from": "human", "value": "Add partial coverage for Handler.\n" }, { "from": "gpt", "value": "require \"spec_helper\"\n\ndescribe Lita::Handler do\n let(:robot) do\n robot = double(\"Robot\")\n allow(robot).to receive(:name).and_return(\"Lita\")\n robot\n end\n\n describe \"#comman...
ruby
chosen
[ { "from": "system", "value": "Add spec on labels validation\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Label do\n let(:label) { create(:label) }\n it { label.should be_valid }\n\n it { should belong_to(:project) }\nend\n" }, { "from": "gpt", "value": "req...
ruby
chosen
[ { "from": "system", "value": "Fix temporary file unlinking problem: manual GC\n" }, { "from": "human", "value": "def generate_rules(sequences,annotations = [],options = Hash.new)\n scaffold,sequence = generate_scaffold_files(sequences)\n\n rules = Genomer::RulesDSL.new\n rules.scaffold_file ...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary `includes` in the home\n" }, { "from": "human", "value": "class StaticPagesController < ApplicationController\n before_action :logged_in_user, only: :donation\n\n def home\n @song = Song.includes(playings: :user).pickup\n @lives = Live.inc...
ruby
chosen
[ { "from": "system", "value": "Change sleep times to be same case as other constants.\n" }, { "from": "human", "value": "require 'cassanity/retry_strategies/retry_strategy'\n\nmodule Cassanity\n module RetryStrategies\n class ExponentialBackoff < RetryStrategy\n ForeverSentinel = :foreve...
ruby
chosen
[ { "from": "system", "value": "Add intro paragraph to new request template\n" }, { "from": "human", "value": "# Add a callback - to be executed before each request in development,\n# and at startup in production - to patch existing app classes.\n# Doing so in init/environment.rb wouldn't work in ...
ruby
chosen
[ { "from": "system", "value": "Allow setting the signal on a DTMF event" }, { "from": "human", "value": "module Punchblock\n module Protocol\n class Rayo\n module Event\n class DTMF < RayoNode\n register :dtmf, :core\n\n def signal\n read_attr :signal\...
ruby
chosen
[ { "from": "system", "value": "Set publishing-api timeout to 10 seconds\n\nPublishing API is sometimes a bit slow when handling large linksets\nlike the education taxonomy.\n" }, { "from": "human", "value": "require 'gds_api/publishing_api_v2'\n\nmodule Services\n def self.publishing_api\n @p...
ruby
chosen
[ { "from": "system", "value": "Fix parameters when running Sidekiq job\n" }, { "from": "human", "value": "class SendContactMessageWorker\n include Sidekiq::Worker\n\n def perform(contact_params)\n ContactMailer.send_contact_message(contact_params[:name], contact_params[:email], contact_param...
ruby
chosen
[ { "from": "system", "value": "Modify to use `YAML.safe_load` instead of `YAML.load`\n" }, { "from": "human", "value": "require 'erb'\nrequire 'yaml'\n\nclass Convergence::Config\n ATTRIBUTES = %i[adapter database host port username password].freeze\n\n attr_accessor(*ATTRIBUTES)\n\n def initi...
ruby
chosen
[ { "from": "system", "value": "Add BUTTONS constant hash to Controls\n" }, { "from": "human", "value": "class Controls\n\n PARAMS_REQUIRED = [:window]\n\n def initialize(params)\n Params.check_params(params, PARAMS_REQUIRED)\n \n end\n\nend\n" }, { "from": "gpt", "value": "cl...
ruby
chosen
[ { "from": "system", "value": "Fix connectable? due to a new error type in Rails 6.1\n" }, { "from": "human", "value": "module ActiveRecord\n class Base\n include Vmdb::Logging\n\n # Truncates the table.\n #\n # ==== Example\n #\n # Post.truncate\n def self.truncate\n ...
ruby
chosen
[ { "from": "system", "value": "Add some more code to this gem\n" }, { "from": "human", "value": "class GoodbyeTranslated\n def self.say_goodbye\n return \"Goodbye, World!\"\n end\n \n def self.say_goodbye_to(people)\n if people.nil?\n return self.say_goodbye\n elsif people.respo...
ruby
chosen
[ { "from": "system", "value": "Support unicode spaces like U+00a0\n\nOn some platform, spaces may be converted to Unicode spaces, and\n`\\s+` is not matched with such Unicode spaces.\n\nThis patch just changes regex pattern from `\\s` to `[[:space:]]`.\n\nI confirmed that Slack on Mac OS X will convert `\" ...
ruby
chosen
[ { "from": "system", "value": "Add a todo to return a single resposne when a single string is requested\n" }, { "from": "human", "value": "class Snmpjr\n class Getter\n\n def initialize args = {}\n @target = args.fetch(:target)\n @max_oids_per_request = args.fetch(:config).max_oids_...
ruby
chosen
[ { "from": "system", "value": "Make .prompt a private method\n\nBecause .get! wraps .prompt, we don't want to expose .prompt directly to\nthe user\n" }, { "from": "human", "value": "require 'keychain'\nrequire 'userinput'\n\nmodule Keylime\n ##\n # Easy wrapper around getting and setting secret...
ruby
chosen