conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix podspec so that it passes lint\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"HTCopyableLabel\"\n s.version = \"0.0.5\"\n s.summary = \"HTCopyableLabel is a subclass of UILabel that makes it easy to allow users to copy ...
ruby
chosen
[ { "from": "system", "value": "Fix demo controller connexion spec\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Administrateurs::SessionsController, type: :controller do\n before do\n @request.env[\"devise.mapping\"] = Devise.mappings[:administrateur]\n end\n\n descri...
ruby
chosen
[ { "from": "human", "value": "Add custom sample capistrano task\n" }, { "from": "gpt", "value": "desc \"Check that we can access everything\"\ntask :check_write_permissions do\n on roles(:all) do |host|\n if test(\"[ -w #{fetch(:deploy_to)} ]\")\n info \"#{fetch(:deploy_to)} is writable ...
ruby
chosen
[ { "from": "system", "value": "Fix Judy URL (case was bad)\n" }, { "from": "human", "value": "require 'formula'\n\nclass Judy <Formula\n url 'http://downloads.sourceforge.net/project/judy/judy/judy-1.0.5/judy-1.0.5.tar.gz'\n homepage 'http://judy.sourceforge.net/'\n md5 '115a0d26302676e962ae2f...
ruby
chosen
[ { "from": "system", "value": "Add default config for paging\n" }, { "from": "human", "value": "require 'caprese/controller'\nrequire 'caprese/record'\nrequire 'caprese/routing/caprese_resources'\nrequire 'caprese/serializer'\nrequire 'caprese/version'\n\nmodule Caprese\n def self.config\n Co...
ruby
chosen
[ { "from": "system", "value": "Break up handling of errors.\n" }, { "from": "human", "value": "# encoding: utf-8\n\nmodule GithubCLI\n module DSL\n @@program_name = $0.split(/\\//)[-1]\n @@error_block = nil\n\n # Defines a program name.\n #\n def program_name(name=nil)\n if ...
ruby
chosen
[ { "from": "system", "value": "Update Dwarf Fortress MacNewbie to 0.9.9.\n" }, { "from": "human", "value": "class DwarfFortressMacnewbie < Cask\n version '0.9.8a'\n sha256 '863cc4736f69fba53599027e7cab42f9401e4963be1bca83773627b0ce7520ab'\n\n url \"http://dffd.wimbli.com/download.php?id=7922&f...
ruby
chosen
[ { "from": "system", "value": "Set authenticated user header for all requests\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n # Prevent CSRF attacks by raising an exception.\n # For APIs, you may want to use :null_session instead.\n protect_from_forger...
ruby
chosen
[ { "from": "system", "value": "Add hacky Null User, if there's no current user.\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n # Prevent CSRF attacks by raising an exception.\n # For APIs, you may want to use :null_session instead.\n protect_from_forg...
ruby
chosen
[ { "from": "system", "value": "Add the current_user and logged_in? methods to the Application\ncontroller.\n\nThese methods will be available to all controllers that inherit from\nApplication Controller. They have been declared as helper methods as\nwell, so that the views can also make use of them.\n" }, ...
ruby
chosen
[ { "from": "system", "value": "Edit CORS methods and frontend https to http for server to client communication\n" }, { "from": "human", "value": "class ApplicationController < ActionController::API\nend\n" }, { "from": "gpt", "value": "class ApplicationController < ActionController::A...
ruby
chosen
[ { "from": "system", "value": "Add Pingdom as valid user-agent in application controller.\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n protect_from_forgery with: :exception\n\n before_filter :check_browser\n before_filter :check_terms\n\n def not_f...
ruby
chosen
[ { "from": "system", "value": "Add numeric validation on BP before invoking custom validator\n\nThis ensures sys and dias are valid numbers before passing we use the > operator to check dias is less than syst\n" }, { "from": "human", "value": "module Renalware\n class BloodPressure < NestedAttri...
ruby
chosen
[ { "from": "system", "value": "Update layout, facilitate updates for GDAL Framework\n" }, { "from": "human", "value": "class GdalFramework < Cask\n url 'http://www.kyngchaos.com/files/software/frameworks/GDAL_Complete-1.11.dmg'\n homepage 'http://www.kyngchaos.com/software/frameworks'\n versio...
ruby
chosen
[ { "from": "system", "value": "Add helpers for report attributes\n" }, { "from": "human", "value": "module Spree\n module Admin\n module ReportsHelper\n\n def product_available?(item)\n (!(item[:available_on].nil? || item[:available_on].future?) && item[:deleted_at].nil? && item[:...
ruby
chosen
[ { "from": "system", "value": "Update cask for radiant player.\n" }, { "from": "human", "value": "class RadiantPlayer < Cask\n url 'https://github.com/kbhomes/google-music-mac/releases/download/v1.2.0/Radiant.Player.zip'\n homepage 'http://kbhomes.github.io/google-music-mac/'\n version '1.2.0'...
ruby
chosen
[ { "from": "human", "value": "Add brew pull for easy integration of user patches\n" }, { "from": "gpt", "value": "# Gets a patch from a GitHub commit or pull request and applies it to Homebrew.\n# Optionally, installs it too.\n\nrequire 'utils.rb'\n\nif ARGV.empty?\n puts 'This command requires ...
ruby
chosen
[ { "from": "system", "value": "Reorganize gemspec and add nokogiri as a dev dependency.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/liquor/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Peter Zotov\"]\n gem.emai...
ruby
chosen
[ { "from": "system", "value": "Add provider attribute to Voucher\n" }, { "from": "human", "value": "module Rabatt\n class Voucher\n\n ATTRIBUTES = %i(code expires_on valid_from url summary terms program)\n\n attr_accessor *ATTRIBUTES\n attr_accessor :payload\n\n def self.build(&block...
ruby
chosen
[ { "from": "system", "value": "Use open-uri instead of plain net/http\n" }, { "from": "human", "value": "\nmodule RailsInstaller # Ensure that the RailsInstaller project root is defined.\n Root = File.expand_path(File.join(File.dirname(__FILE__), \"..\"))\nend\n\n%w{\n ostruct\n yaml\n erb\n ...
ruby
chosen
[ { "from": "human", "value": "Add spec for Whitespace check\n\nNow that we have a convenient way to test anything involving\n`StagedFile`s, we should try to add tests for these files.\n\nChange-Id: If1c6cfee179cbd2dd13f2ed450b04f23cbe19195\nReviewed-on: https://gerrit.causes.com/25161\nTested-by: jenkins <d9...
ruby
chosen
[ { "from": "system", "value": "Revert \"fix(middleware): fix server_middleware register step\"\n\nThis reverts commit f93896d582f29da1854dccdd0e52795e0c39832c.\n" }, { "from": "human", "value": "require_relative \"sidekiq/merger\"\n\nSidekiq.configure_client do |config|\n config.client_middlewar...
ruby
chosen
[ { "from": "system", "value": "Make the code match the narrative\n\nSpotted by the Mr. Eagle Eye, @videlalvaro.\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n# encoding: utf-8\n\nrequire \"bunny\"\n\nconn = Bunny.new(:automatically_recover => false)\nconn.start\n\nch = conn.create_cha...
ruby
chosen
[ { "from": "system", "value": "Validate Doorkeeper PreAuthorization to ensure the client is accessible\n\nAs of https://github.com/doorkeeper-gem/doorkeeper/pull/1296 Doorkeeper's\nPreAuthorization controller is no longer passed the Client upon instantiation,\nbut instead retrieves it during validation.\n\nT...
ruby
chosen
[ { "from": "system", "value": "Store errors in `pliny.error` env key\n" }, { "from": "human", "value": "module Pliny::Middleware\n class RescueErrors\n def initialize(app, options = {})\n @app = app\n @raise = options[:raise]\n end\n\n def call(env)\n @app.call(env)\n ...
ruby
chosen
[ { "from": "system", "value": "Adjust error messages to truncate more effectively\n\nLog the response first then the request so when the message gets\ntruncated, we can actually see useful information about what the backend\nsent.\n" }, { "from": "human", "value": "require 'stream_service/http_er...
ruby
chosen
[ { "from": "human", "value": "Add tasks to add privateName, citation and allowDownload to widgets metadata\n" }, { "from": "gpt", "value": "namespace :widgets do\n desc 'Add privateName, citation and allowDownload metadata fields to the existing widgets'\n task update_metadata: :environment do\...
ruby
chosen
[ { "from": "system", "value": "Add gem site on 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 'simple_token/version'\n\nGem::Specification.new do |gem|\n gem.name ...
ruby
chosen
[ { "from": "system", "value": "Use API instead of screen scraping Scoreboard\n" }, { "from": "human", "value": "require 'open-uri'\nrequire 'date'\nrequire_relative 'box_score'\n\nclass ScoreBoard\n SB_URI = \"http://scores.espn.go.com/nba/scoreboard?date=%s\"\n GIDS_RE = %r|/nba/boxscore\\?ga...
ruby
chosen
[ { "from": "system", "value": "Simplify the method creation logic in Mpeg4.rb\n" }, { "from": "human", "value": "require_relative 'box_path'\nrequire_relative 'box_parsers/meta_box'\nrequire_relative 'box_parsers/mvhd_box'\n\nmodule FileData\n Mpeg4ValueInfo = Struct.new(:name, :parser_class, :m...
ruby
chosen
[ { "from": "human", "value": "Add schema examples support file\n\nThis file contains an `Example` class inside a module which allows us to\ninclude it and call `govuk_content_schema_example(name)` to get the\nschema for that format.\n" }, { "from": "gpt", "value": "# Include this module to get ac...
ruby
chosen
[ { "from": "system", "value": "Fix parsing of date from Japanese text\n" }, { "from": "human", "value": "module KindleManager\n module Parsers\n module Common\n extend ActiveSupport::Concern\n\n included do\n attr_accessor :fetched_at\n end\n\n def parse_date(date_t...
ruby
chosen
[ { "from": "system", "value": "Add api_key reader for instance objects.\n" }, { "from": "human", "value": "require 'spec_helper'\n\nclass APIKey\n @default_api_key = nil\n class << self\n attr_accessor :default_api_key\n end\nend\n\ndescribe APIKey do\n let( :apiKeyClass ) { APIKey }\n\n ...
ruby
chosen
[ { "from": "system", "value": "Set file_cache_path and version for coverage\n\ndefault_spec does not cover release and go recipes as they are tested\nseparately.\n" }, { "from": "human", "value": "describe 'mikoi::default' do\n context 'with release install method' do\n let(:chef_run) do\n ...
ruby
chosen
[ { "from": "system", "value": "Add thread id to log output item\n" }, { "from": "human", "value": "require 'logger'\n\nmodule Bitcoin\n\n # Simple Logger module\n module Logger\n\n # Create a logger with given +name+.log in $HOME/.bitcoinrb/log.\n def self.create(name, level = ::Logger::I...
ruby
chosen
[ { "from": "system", "value": "Fix error after user confirms account\n\n" }, { "from": "human", "value": "class ConfirmationsController < Devise::ConfirmationsController\n private\n def after_confirmation_path_for(resource_name, resource)\n #After the account is confirme, it should redirec t...
ruby
chosen
[ { "from": "system", "value": "Update IntelliJ IDEA with bundled JDK to 14.1.4" }, { "from": "human", "value": "cask :v1 => 'intellij-idea-bundled-jdk' do\n version '14.1.1'\n sha256 'fef01bad9a244a92c78a21969980829b101236ec11a9fd5c779dd344a4c9f7e3'\n\n url \"https://download.jetbrains.com/ide...
ruby
chosen
[ { "from": "system", "value": " Fix gemspec so that MIT license will be visible when running the -d flag\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"devise/version\"\n\nGem::Specification.new do |s|\n s.name = \"d...
ruby
chosen
[ { "from": "system", "value": "Fix to use friendly_id syntax\n" }, { "from": "human", "value": "class ActivitiesController < ApplicationController\n def index\n @user = User.find(params[:user_id])\n @activities = @user.activities.order('created_at DESC')\n\n respond_to do |format|\n ...
ruby
chosen
[ { "from": "system", "value": "Fix verify_fk for correct cas hash\n" }, { "from": "human", "value": "class Backend::FkController < Backend::BackendController\n skip_before_filter :verify_club\n before_filter :verify_fk\n def verify_fk\n # Development backdoor\n return session[:club] = \"...
ruby
chosen
[ { "from": "system", "value": "Allow output document to be rendered as html in styleguide\n" }, { "from": "human", "value": "class StyleguideController < ApplicationController\n def index\n end\n\n def base\n end\n\n def pages_input\n render template: 'styleguide/pages/input'\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Allow all 0.2 patch releases\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'alephant/logger/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Fix step fallback for resource url\n" }, { "from": "human", "value": "module Concerns\n module ParticipatoryProcessSerializerUrl\n def url\n scope && scope.url_for(id: object, controller: \"/#{controller_name}\", action: :show,\n ...
ruby
chosen
[ { "from": "human", "value": "Add YAML test to Content Spec\n" }, { "from": "gpt", "value": "require_relative 'spec_helper'\n\ndescribe \"Content\" do\n\n before(:each) do\n @posts = []\n Dir.foreach('_posts') do |p|\n @posts << IO.read(\"_posts/#{p}\") if p.match(/^[^.]\\w/)\n end...
ruby
chosen
[ { "from": "system", "value": "Fix Context.context spec to actually compare against a Context from another thread\n" }, { "from": "human", "value": "# Run some basic specs on Krb5::Context to check that:\n# - the FFI interface can load the library and call functions\n# - the error handling in the...
ruby
chosen
[ { "from": "system", "value": "Add spec for 'extract!' function\n" }, { "from": "human", "value": "require_relative 'spec_helper'\n\ndescribe Jblazer do \n def make_template context=nil\n json = Jblazer::Template.new context\n\n yield json\n\n json\n end\n \n it 'should have a contex...
ruby
chosen
[ { "from": "system", "value": "Use Sendgrid API key for authentication\n" }, { "from": "human", "value": "SMTP_SETTINGS = {\n address: ENV.fetch(\"SMTP_ADDRESS\"), # example: \"smtp.sendgrid.net\"\n authentication: :plain,\n domain: ENV.fetch(\"SMTP_DOMAIN\"), # example: \"this-app.com\"\n en...
ruby
chosen
[ { "from": "system", "value": "Remove tests for removed library version check\n" }, { "from": "human", "value": "require 'introspection_test_helper'\n\ndescribe \"loading the shared library\" do\n before do\n # Avoid cluttering the error stream with method redefinition warnings.\n stub(GOb...
ruby
chosen
[ { "from": "system", "value": "Fix deletion attempts on dropped tables\n" }, { "from": "human", "value": "require 'database_cleaner/active_record/deletion'\n\nmodule FakeInformationSchema\n # Work around a bug in DatabaseCleaner when using the deletion strategy:\n # https://github.com/DatabaseC...
ruby
chosen
[ { "from": "system", "value": "Send commit statuses through websocket to Smokey\n" }, { "from": "human", "value": "class GithubController < ApplicationController\n skip_before_action :verify_authenticity_token\n\n def hook\n # Check signature from GitHub\n\n signature = 'sha1=' + OpenSSL:...
ruby
chosen
[ { "from": "system", "value": "Test migration visualizations.id type check\n" }, { "from": "human", "value": "# encoding: utf-8\nrequire 'sequel'\nrequire_relative '../../../services/data-repository/backend/sequel'\n\n# encoding: utf-8\nmodule CartoDB\n module Visualization\n class Migrator\n...
ruby
chosen
[ { "from": "system", "value": "Fix JRuby SSL issue - eventmachine issue remains" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\n\nGem::Specification.new do |s|\n s.name = \"pusher\"\n s.version = \"0.9.4\"\n s.platform =...
ruby
chosen
[ { "from": "system", "value": "Allow interop with Rails 4\n\nAlso, bumped version to '0.0.4'\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"active_guid\"\n s.summary = \"Add a GUID to Active Record instances.\"\n s.description = \"Add a GUID to Active Record inst...
ruby
chosen
[ { "from": "human", "value": "Add address factory with randomized attributes\n\nRandomizing all addresses generated will be explored separately.\n" }, { "from": "gpt", "value": "FactoryBot.modify do\n factory :address do\n trait :randomized do\n firstname { Faker::Name.first_name }\n ...
ruby
chosen
[ { "from": "system", "value": "Use ps command that works on travis-ci as well.\n" }, { "from": "human", "value": "require \"aruba/api\"\n\nWhen /^I run (cognizant) `([^`]*)`$/ do |_, cmd|\n cmd = \"cognizant #{cmd} --socket ./cognizant/cognizantd.sock\"\n step \"I run `#{cmd}`\"\nend\n\nWhen /^...
ruby
chosen
[ { "from": "system", "value": "Upgrade a second machine to a chef 12 client\n" }, { "from": "human", "value": "name \"urmel\"\ndescription \"Master role applied to urmel\"\n\ndefault_attributes(\n :networking => {\n :interfaces => {\n :internal_ipv4 => {\n :interface => \"eth0\",\...
ruby
chosen
[ { "from": "system", "value": "Test concurrency from 10 to 30\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass UpdateBatch < ApplicationRecord\n attr_accessor :start_time\n\n after_initialize :set_defaults\n\n has_many :requests, class_name: 'ApiRequest', dependent: :n...
ruby
chosen
[ { "from": "system", "value": "Expire QA users after an hour :frog:\n" }, { "from": "human", "value": "require 'exlibris-aleph'\nclass UserSession < Authlogic::Session::Base\n pds_url Settings.pds.login_url\n redirect_logout_url Settings.pds.logout_url\n aleph_url Exlibris::Aleph::Config.base_...
ruby
chosen
[ { "from": "system", "value": "Check that AMIs are HVM\n" }, { "from": "human", "value": "require 'aws-sdk'\n\nmodule RSchema\n module AwsAmi\n extend self\n\n def exists?(region, ami_id)\n image(region, ami_id)\n end\n\n private\n\n def image(region, ami_id)\n @images |...
ruby
chosen
[ { "from": "system", "value": "Apply the same fix in SHA: 61457e1c1b to safe_meta_def\n" }, { "from": "human", "value": "class Object\n def safe_meta_def method_name, &block\n metaclass.remember_original_method(method_name)\n meta_eval { define_method method_name, &block }\n end\n\n def ...
ruby
chosen
[ { "from": "system", "value": "Add migration for existing recents\n" }, { "from": "human", "value": "class CreateRecents < ActiveRecord::Migration\n def change\n create_table :recents do |t|\n t.references :classification, index: true, foreign_key: true\n t.references :subject, inde...
ruby
chosen
[ { "from": "system", "value": "Move sending 'comment_created' mail delivery to after_commit_on_create hook from after_create hook\n" }, { "from": "human", "value": "# Copyright 2014 Square Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this f...
ruby
chosen
[ { "from": "system", "value": "Add MIT license to gemspec\n\nSee. https://github.com/cookpad/garage/blob/master/MIT-LICENSE\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"garage/version\"\n\n# Describe your gem and de...
ruby
chosen
[ { "from": "system", "value": "Cover first `GobiertoCommon::ContentBlockField` case and fix scope\n" }, { "from": "human", "value": "module GobiertoCommon\n class ContentBlockField < ApplicationRecord\n belongs_to :content_block\n\n attr_accessor :available_locales\n\n before_create :se...
ruby
chosen
[ { "from": "system", "value": "Add 'multi_json' gem to gemspec so that route_guide_server can work\n" }, { "from": "human", "value": "# -*- ruby -*-\n# encoding: utf-8\n\nGem::Specification.new do |s|\n s.name = 'grpc-demo'\n s.version = '1.0.0'\n s.authors = ['gRPC Author...
ruby
chosen
[ { "from": "system", "value": "Use special PPA only for Precise\n\nFor Trusty, there is a package from\nhttp://packages.ubuntu.com/trusty/libzmq3\n" }, { "from": "human", "value": "#\n# Cookbook Name:: zeromq\n# Recipe:: ppa\n#\n# Copyright 2011-2013, Travis CI Development Team <contact@travis-ci...
ruby
chosen
[ { "from": "system", "value": "Add thor gem to 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 'agharta/version'\n\nGem::Specification.new do |gem|\n gem.name ...
ruby
chosen
[ { "from": "system", "value": "Add short summary 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 'subspp/version'\n\nGem::Specification.new do |spec|\n spec.name =...
ruby
chosen
[ { "from": "system", "value": "Replace progress tag to div class progress\n" }, { "from": "human", "value": "module MilestonesHelper\n def progress_tag_for(progress_bar)\n text = number_to_percentage(progress_bar.percentage, precision: 0)\n\n content_tag :span do\n content_tag(:span, ...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.1.6 to 0.2.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'set_attributes'\n s.version = '0.1.6'\n s.summary = \"Set an object's attributes from an object or hash with a...
ruby
chosen
[ { "from": "system", "value": "Support Erlang 17.0-rc2 with kerl" }, { "from": "human", "value": "default[:kerl][:releases] = %w(R14B02 R14B03 R14B04 R15B R15B01 R15B02 R15B03 R16B R16B01 R16B02 R16B03 R16B03-1 17.0-rc1)\ndefault[:kerl][:path] = \"/usr/local/bin/kerl\"\n" }, { "from":...
ruby
chosen
[ { "from": "system", "value": "Allow assignment of user ID\n" }, { "from": "human", "value": "class Thing < ActiveRecord::Base\n include Geokit::Geocoders\n attr_accessible :name\n validates_uniqueness_of :city_id, allow_nil: true\n validates_presence_of :lat, :lng\n belongs_to :user\n has_...
ruby
chosen
[ { "from": "system", "value": "Fix page title html escaping\n" }, { "from": "human", "value": "module ApplicationHelper\n def page_title(title)\n \"#{title} - Ralin Chimev\"\n end\n\n def gravatar_url(email, size)\n gravatar = Digest::MD5.hexdigest(email).downcase\n \"//gravatar.com/a...
ruby
chosen
[ { "from": "system", "value": "Fix csv download in rails 5\n" }, { "from": "human", "value": "module Carnival\n class QueryForm\n attr_accessor :scope, :search_term, :date_period_label,\n :date_period_from, :date_period_to, :sort_column,\n :sort_direction, :p...
ruby
chosen
[ { "from": "system", "value": "Fix on_complete callback never getting hit\n" }, { "from": "human", "value": "module S3Multipart\n class Upload < ::ActiveRecord::Base\n extend S3Multipart::TransferHelpers\n\n before_create :validate_file_type, :validate_file_size\n\n def self.create(para...
ruby
chosen
[ { "from": "system", "value": "Revert \"Avoid raising exceptions when user is not present\"\n\nIt's just better to raise an exception in case a user is not found\ninstead of silently fail to perform the increase score operation.\n\nThis reverts commit 6dc5e21a7ab0beb16076b5bd56c73f8c295394bb.\n" }, { ...
ruby
chosen
[ { "from": "system", "value": "Move params into let block\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe NewsletterSubscriptionsController do\n describe \"POST 'newsletter'\" do\n\n let!(:member) do\n FactoryGirl.create(\n :member,\n :email => \"test@e...
ruby
chosen
[ { "from": "system", "value": "Make script export JSON of all images / albums\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\nrequire \"rubygems\"\nrequire \"bundler/setup\"\n\nrequire \"imgur\"\n\nclass ImgurExport\n def initialize(username=nil, **opts)\n opts[:config_path] ||= Fil...
ruby
chosen
[ { "from": "system", "value": "Fix migration broken with mongoid 3.x\n" }, { "from": "human", "value": "class RenameBackupExceptionToExclusion < Mongoid::Migration\n def self.up\n if Mongoid.database.collections.map(&:name).include? 'backup_exceptions'\n Mongoid.database.drop_collection(...
ruby
chosen
[ { "from": "system", "value": "Remove -E option from flock since it is only available in newer versions. Add --preserve-status to timeout so we always see the return status what we ran, not timeout.\n" }, { "from": "human", "value": "default['postgresql']['wal_e'] = {\n enabled: false,\n packa...
ruby
chosen
[ { "from": "system", "value": "Update migration with better logic and cosmetics\n" }, { "from": "human", "value": "class SplitCustomersName < ActiveRecord::Migration[6.1]\n class Spree::DummyAddress < ApplicationRecord\n self.table_name = 'spree_addresses'\n end\n class Customer < Applicati...
ruby
chosen
[ { "from": "system", "value": "Drop support for Ruby 2.2\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nlib = File.expand_path(\"../lib\", __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire \"bashcov/version\"\n\nGem::Specification.new do |gem|\n gem...
ruby
chosen
[ { "from": "system", "value": "Add github page as homepage\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'geofsh/version'\n\nGem::Specification.new do |gem|\n gem.name ...
ruby
chosen
[ { "from": "system", "value": "Add spec for bugfix from 1942b8e\n" }, { "from": "human", "value": "RSpec.describe SomethingLikeThat::Query do\n let(:test_query) { described_class.new('Harry Potter') }\n\n describe '#match' do\n it 'handles identical strings' do\n expect(test_query.match...
ruby
chosen
[ { "from": "system", "value": "Make sure we ship the license file with the gem\n\nWe need this for license scout\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\n$:.unshift(File.dirname(__FILE__) + \"/li...
ruby
chosen
[ { "from": "human", "value": "Add implementation of twelfth rule of disambiguator prefix\n" }, { "from": "gpt", "value": "module Sastrawi\n module Morphology\n module Disambiguator\n class DisambiguatorPrefixRule12\n def disambiguate(word)\n contains = /^mempe(.*)$/.match...
ruby
chosen
[ { "from": "system", "value": "Add spec reproducing the comparison error\n" }, { "from": "human", "value": "require 'spec_helper'\n\nRSpec.describe LazyObject do\n\n class TargetObject\n attr_accessor :value\n\n def method_with_yield(foo)\n yield foo\n end\n end\n\n let(:lazy_obj...
ruby
chosen
[ { "from": "system", "value": "Add prettier as dev dependency\n" }, { "from": "human", "value": "# coding: utf-8\n# frozen_string_literal: true\nlib = File.expand_path('lib', __dir__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'rack/rejector/version'\n\nGem::Specification.n...
ruby
chosen
[ { "from": "system", "value": "Fix implementation of \"ArrayDictionary\" class\n" }, { "from": "human", "value": "module Sastrawi\n module Dictionary\n class ArrayDictionary\n attr_accessor :words\n\n def initialize\n self.words = []\n end\n\n def lookup(word)\n ...
ruby
chosen
[ { "from": "system", "value": "Fix broken search results after GDS API Adapters change\n\nThe new version of GDS API Adapters changes the type of return values\nfrom API calls. It now returns a GdsApi::Response instead of native\ntypes like Array or Hash. GdsApi::Response quacks like a Hash but it\nisn't one...
ruby
chosen
[ { "from": "system", "value": "Store all code classes in a hash for easy lookup\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Discordrb\n # Custom errors raised in various places\n module Errors\n # Raised when authentication data is invalid or incorrect.\n cl...
ruby
chosen
[ { "from": "system", "value": "Use the correct row count\n" }, { "from": "human", "value": "module DocParser\n # The Output base class.\n # All Output classes inherit from this one.\n class Output\n attr_reader :rowcount\n\n # Creates a new output\n # @param filename [String] Output f...
ruby
chosen
[ { "from": "system", "value": "Make test login work with CAS servers that aren't mounted at /.\n" }, { "from": "human", "value": "require 'uri'\nrequire 'rack'\n\nWhen /^(?:a user )?requests a service ticket for \"([^\"]*)\"$/ do |service|\n # CAS servers will redirect to the requested service i...
ruby
chosen
[ { "from": "system", "value": "Fix referenced form ID for filter reference popup\n" }, { "from": "human", "value": "module Admin::EventsHelper\n def event_edit_javascripts\n <<-CODE\n var lastFilter = '#{@event.filter_id}';\n var filterWindows = {};\n function loadFilterReferen...
ruby
chosen
[ { "from": "system", "value": "Fix link to donate page not working.\n" }, { "from": "human", "value": "module VoteButtonHelpers\n\n def link_to_vote_always_show(project, name = nil, html_options = nil, &block)\n link_to_vote(project, name, html_options, &block) ||\n capture(&(block || pr...
ruby
chosen
[ { "from": "system", "value": "Use git to find gem files\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"capybara-webkit\"\n s.version = \"0.1.0\"\n s.authors = [\"thoughtbot\", \"Joe Ferris\", \"Jason Morrison\", \"Tristan Dunn\"]\n s.email = \"support@thoughtbo...
ruby
chosen
[ { "from": "system", "value": "Add Failing test printer to Formatter\n" }, { "from": "human", "value": "require 'colorize'\n\nmodule Dest\n\n class Formatter\n\n def initialize(evald_result)\n @evald_result\n end\n\n def print\n if @evald_result[:result][0]\n print_pass...
ruby
chosen
[ { "from": "human", "value": "Add check for CVE-2012-3463 (select_tag)\n" }, { "from": "gpt", "value": "require 'brakeman/checks/base_check'\n\n#Checks for CVE-2012-3463, unescaped input in :prompt option of select_tag:\n#https://groups.google.com/d/topic/rubyonrails-security/fV3QUToSMSw/discussi...
ruby
chosen
[ { "from": "system", "value": "Disable caching on home controller\n" }, { "from": "human", "value": "module Spree\n class HomeController < Spree::StoreController\n helper 'spree/products'\n respond_to :html\n\n def index\n @searcher = build_searcher(params)\n @products = @sear...
ruby
chosen
[ { "from": "human", "value": "Add rake task to invoke import worker\n" }, { "from": "gpt", "value": "namespace :subjects do\n desc \"Import subjects from a CSV file\"\n task :import, [:project_id, :user_id, :subject_set_id, :url] => [:environment] do |t, args|\n SubjectImportWorker.perform_a...
ruby
chosen