conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add Aichi11Target import to importer\n" }, { "from": "human", "value": "module Stats::CountryStatisticsImporter\n def self.import\n import_stats(stats_csv_path, CountryStatistic)\n import_stats(pame_csv_path, PameStatistic)\n\n # Import stats from DOPA se...
ruby
chosen
[ { "from": "system", "value": "Update documentation spec to rescue HTTP code errors\n" }, { "from": "human", "value": "require \"json\"\nrequire \"net/http\"\nrequire \"open-uri\"\n\nRSpec.describe \"neovim-ruby documentation\" do\n it \"has up-to-date generated method docs\" do\n begin\n ...
ruby
chosen
[ { "from": "system", "value": "Return a calltree file instead of appending the html call graph to the page\n" }, { "from": "human", "value": "require 'ruby-prof'\nrequire 'set'\n\nmodule ActionController\n module ActionProfiler\n MODES = Set.new(%w(process_time wall_time cpu_time allocated_ob...
ruby
chosen
[ { "from": "system", "value": "Duplicate the env when calling the app\n" }, { "from": "human", "value": "require 'fiber_pool'\n\nmodule Rack\n class FiberPool\n VERSION = '0.9.3'\n SIZE = 100\n\n # The size of the pool is configurable:\n #\n # use Rack::FiberPool, :size => 25\n ...
ruby
chosen
[ { "from": "human", "value": "Add a memory-based backend for testing\n" }, { "from": "gpt", "value": "require 'singleton'\nmodule Replay\n class Backends\n def self.register(shorthand, klass)\n @backends ||= {}\n @backends[shorthand] = klass\n return klass\n end\n def sel...
ruby
chosen
[ { "from": "system", "value": "Add getter for chroot directory\n" }, { "from": "human", "value": "\nrequire 'thor'\n\nmodule Chroot\n module Repository\n module Client\n module Helper\n\n def get_config_path\n File.expand_path(CONFIG_PATH)\n end\n\n def rela...
ruby
chosen
[ { "from": "system", "value": "Fix Rails 5 deprecation warning for to_prepare\n" }, { "from": "human", "value": "module DeviseSecurityExtension\n class Engine < ::Rails::Engine\n ActiveSupport.on_load(:action_controller) do\n include DeviseSecurityExtension::Controllers::Helpers\n end...
ruby
chosen
[ { "from": "system", "value": "Add .pre for next release\n" }, { "from": "human", "value": "# This file is maintained by a herd of rabid monkeys with Rakes.\nmodule EY\n class CloudClient\n VERSION = '1.0.7'\n end\nend\n# Please be aware that the monkeys like tho throw poo sometimes.\n" },...
ruby
chosen
[ { "from": "system", "value": "Add configurable size to ProcessingPool\n" }, { "from": "human", "value": "module Trusted\n module Request\n class ProcessingPool\n attr_reader :handler, :thread_pool\n\n def initialize(handler)\n @handler = handler\n @thread_pool = Concu...
ruby
chosen
[ { "from": "system", "value": "Use new value for validation.\n" }, { "from": "human", "value": "class UrlFormatValidator < ActiveModel::EachValidator\n def validate_each(record, attribute, value)\n format_value(record, attribute, value)\n unless URI.parse(value).kind_of?(URI::HTTP) && valu...
ruby
chosen
[ { "from": "system", "value": "Revert \"Remove unused factory for ReadingGroup\"\n\nThis reverts commit 7048a0b677ffc7213917a3cb0e011309a2f2cb8a.\n\nSigned off by: Heitor Reis <marcheing@gmail.com>\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :reading_group do\n name \"M...
ruby
chosen
[ { "from": "system", "value": "Make `VERSION` specs more accurate\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire_relative '../../lib/filewatcher/version'\n\ndescribe 'Filewatcher::VERSION' do\n subject { Object.const_get(self.class.description) }\n\n it { is_expecte...
ruby
chosen
[ { "from": "human", "value": "Add tests for `orgs` and `orgs:open`\n" }, { "from": "gpt", "value": "require \"spec_helper\"\nrequire \"heroku/command/orgs\"\n\nmodule Heroku::Command\n describe Orgs do\n\n before(:each) do\n stub_core\n stub_organizations\n end\n\n after(:each...
ruby
chosen
[ { "from": "system", "value": "Add test for SetFrontPageMinQuality config.\n" }, { "from": "human", "value": "# encoding: UTF-8\n\nrequire 'rails_helper'\n\ndescribe MemeCaptainWeb::Config do\n\n context 'when the MC_SET_FRONT_PAGE_MIN_QUALITY env var is not set' do\n\n it 'uses the default' ...
ruby
chosen
[ { "from": "system", "value": "Change back gem description to single line description\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"monupco-openshift-express-ruby/version\"\n\nGem::Specification.new do |s|\n s.name ...
ruby
chosen
[ { "from": "system", "value": "Harden: Enable per-form CSRF tokens and origin-checking CSRF mitigation\n\n Enable two security hardening mechanisms that were added as part of\n Rails 5. These counter cross-site request forgery (CSRF). Specifically:\n * Enable per-form CSRF tokens.\n * Enable origin-chec...
ruby
chosen
[ { "from": "system", "value": "Update validation to work with new API\n" }, { "from": "human", "value": "require 'pathname'\nrequire 'sparkle_formation'\nrequire 'knife-cloudformation'\n\nclass Chef\n class Knife\n # Cloudformation validate command\n class CloudformationValidate < Knife\n\...
ruby
chosen
[ { "from": "system", "value": "Fix up some DB migration issues with Rails 3\n\n* The public_body_tags table had already been removed\n* The index has_tag_string_tags generated a name longer than the Postgres maximum of 63 characters. It was ignored in earlier Rails versions, see: https://rails.lighthouseapp....
ruby
chosen
[ { "from": "system", "value": "Add 'can access as methods directly from the breadcrumb' test\n" }, { "from": "human", "value": "require 'test_helper'\n\ndescribe 'Redis::Breadcrumb' do\n before do\n Redis::Breadcrumb.redis = MockRedis.new\n end\n\n it 'can create a method to access the key ...
ruby
chosen
[ { "from": "system", "value": "Add required gem to get server running" }, { "from": "human", "value": "require 'rails/generators'\n\nmodule DynamoKickstarter\n class AppGenerator < Rails::Generators::NamedBase\n source_root File.expand_path('../templates', __FILE__)\n\n def readme\n r...
ruby
chosen
[ { "from": "system", "value": "Use amazon rds compatible recursion method as default\n" }, { "from": "human", "value": "require 'rake'\nrequire 'rake/file_utils'\n\nclass PerconaAr::PtOnlineSchemaChangeExecutor\n include FileUtils\n\n attr_accessor :sql\n\n def initialize(sql)\n @sql = sql\...
ruby
chosen
[ { "from": "system", "value": "Define status for an OmniauthSignin\n" }, { "from": "human", "value": "class OmniauthSignIn\n attr_accessor :provider\n\n delegate :authorization, :user, :no_account_conflicts?,\n to: :@user_initializer, allow_nil: true\n\n def initialize(user, provider)\n ...
ruby
chosen
[ { "from": "system", "value": "Fix gemspec sequel minimal version\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"sequel_nested_set\"\n s.version = \"0.9.9\"\n s.date = \"2009-01-11\"\n s.summary = \"Nested set implementation for Sequel Models\"\n s.em...
ruby
chosen
[ { "from": "system", "value": "Use encrypted credentials for authentication of the admin page\n" }, { "from": "human", "value": "# All Administrate controllers inherit from this `Admin::ApplicationController`,\n# making it the ideal place to put authentication logic or other\n# before_actions.\n#...
ruby
chosen
[ { "from": "system", "value": "Fix a bug where v3 runs had golds of 0\n" }, { "from": "human", "value": "class Api::V3::Detail::RunSerializer < Api::V3::ApplicationSerializer\n belongs_to :user, serializer: Api::V3::UserSerializer\n belongs_to :game, serializer: Api::V3::GameSerializer\n belon...
ruby
chosen
[ { "from": "system", "value": "Add debug output for NPM deployment\n\nUsers report persistent 401 while publishing to npmjs.\nWe investigate whether `#flush` was enough or not by\ndumping the file's size\n" }, { "from": "human", "value": "require 'json'\n\nmodule DPL\n class Provider\n class ...
ruby
chosen
[ { "from": "system", "value": "Update DEVONthink Pro to 2.8.6\n" }, { "from": "human", "value": "cask :v1 => 'devonthink-pro' do\n version '2.8.5'\n sha256 '161632818b26eb6f2ee2e9818e7c3506d1b54d5ceb934d546403bbc6f62674a6'\n\n # amazonaws.com is the official download host per the vendor homepa...
ruby
chosen
[ { "from": "system", "value": "Exclude spec files from gem archive, remove deprecated test_files setting\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n# frozen_string_literal: true\n\nrequire File.expand_path('../lib/rails-timeago/version', __FILE__)\n\nGem::Specification.new do |...
ruby
chosen
[ { "from": "system", "value": "Add automatically restart nodeJs App\n" }, { "from": "human", "value": "include_recipe 'deploy'\ninclude_recipe \"nginx::service\"\n\nnode[:deploy].each do |application, deploy|\n\tif deploy[:application_type] != 'nodejs'\n\t\tnext\n\tend\t\n\tChef::Log.info(\"Deplo...
ruby
chosen
[ { "from": "system", "value": "Maintain just one Redis connection\n" }, { "from": "human", "value": "require 'redis'\nrequire 'redis-namespace'\n\nclass Environment\n class << self\n def run(command)\n @script = command\n end\n attr_reader :script\n end\n\n def script\n self.c...
ruby
chosen
[ { "from": "system", "value": "Update example use in video spec\n" }, { "from": "human", "value": "require 'spec_helper'\n\ninclude Support::ResourceExamples\n\ndescribe Fulcrum::Video do\n let(:test_file) { './spec/data/test.mp4' }\n\n include_context 'with client'\n include_context 'with med...
ruby
chosen
[ { "from": "human", "value": "Add check for supervisord - check all processes are running\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\n\nrequire 'rubygems' if RUBY_VERSION > \"1.9\"\nrequire 'sensu-plugin/check/cli'\nrequire 'ruby-supervisor'\n\nclass CheckSupervisor < Sensu::Plugin::Che...
ruby
chosen
[ { "from": "human", "value": "Add rspec tests for create plants\n\nAdded basic validation test for plant creation. Every field must be filled to create a new plant.\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\nRSpec.describe Plant, type: :model do\n describe 'Validations' do\n #...
ruby
chosen
[ { "from": "system", "value": "Add class comment to alias controller\n" }, { "from": "human", "value": "# Encoding: utf-8\nrequire 'test_helper'\n\nclass AliasesControllerTest < ActionController::TestCase\n # test \"the truth\" do\n # assert true\n # end\nend\n" }, { "from": "gpt", ...
ruby
chosen
[ { "from": "system", "value": "Add an alias to the payment factory\n\nSo we can reference this specifically\n\ncherry-picked from a4112c8432b92400b3a002c65d7a65eefcd221f8 in bonobos/spree\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :payment, class: Spree::Payment do\n a...
ruby
chosen
[ { "from": "system", "value": "Remove duplicate article parent_id index\n" }, { "from": "human", "value": "class IndexArticlesFilteredFields < ActiveRecord::Migration\n def self.up\n %w[articles article_versions].each do |table|\n add_index table, [:parent_id]\n add_index table, [:p...
ruby
chosen
[ { "from": "system", "value": "Add convience method for configuration\n" }, { "from": "human", "value": "require 'netsuite'\n\nrequire 'netsuite_rails/configuration'\nrequire 'netsuite_rails/poll_timestamp'\nrequire 'netsuite_rails/transformations'\nrequire 'netsuite_rails/url_helper'\n\nrequire ...
ruby
chosen
[ { "from": "human", "value": "Add step definitions for recipe alternatives (missed in previous commit)\n" }, { "from": "gpt", "value": "Given /^no other recipes$/ do\n # nop\nend\n\nGiven /^the three pancake recipes are alternate preparations of each other$/ do\n alternates = {\n :type => \"...
ruby
chosen
[ { "from": "system", "value": "Revert \"Run restart command right away on the postgresql service.\"\n\nReverting commit 5d056092ed7dae32229b6086c31a1071d3ec8d4b. This change\nis not appropriate for many use cases. If you need this behavior, please\nconsider using a wrapper cookbook to modify this service res...
ruby
chosen
[ { "from": "system", "value": "Install requires sudo privileges, so let's not deal with that for now.\n" }, { "from": "human", "value": "version = \"0.1.6\"\nenv_vars = {\n :AWS_REGION => ENV['AWS_REGION'],\n :AWS_ACCESS_KEY_ID => ENV['AWS_ACCESS_KEY_ID'],\n :AWS_SECRET_ACCESS_KEY => ENV['AWS_...
ruby
chosen
[ { "from": "system", "value": "Add new, edit, and update methods to CheatsheetsController\n" }, { "from": "human", "value": "class CheatsheetsController < ApplicationController\n\n def index\n\n end\n\n def show\n @user = User.find(params[:user_id])\n @cheatsheets = @user.cheatsheets.all...
ruby
chosen
[ { "from": "system", "value": "Add spec for Enumerator::Generator to be Enumerable\n" }, { "from": "human", "value": "require File.expand_path('../../../../spec_helper', __FILE__)\n\nruby_version_is \"1.9\" do\n describe \"Enumerator::Generator#each\" do\n it \"Supports enumeration with a blo...
ruby
chosen
[ { "from": "human", "value": "Add rspec formatter: Hybrid of documentation and progress.\n" }, { "from": "gpt", "value": "require \"rspec/core/formatters/base_text_formatter\"\n\nclass DocumentationProgressFormatter < RSpec::Core::Formatters::BaseTextFormatter\n MAX_GROUP_LEVEL = 2\n\n def init...
ruby
chosen
[ { "from": "human", "value": "Add missing specs for Yardstick::DocumentSet\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Yardstick::DocumentSet, '#measure' do\n subject { described_class.new([document1, document2]).measure(config) }\n\n let(:document1) { mock('document1') }...
ruby
chosen
[ { "from": "human", "value": "Add solution for problem 6\n" }, { "from": "gpt", "value": "=begin\n\nThe sum of the squares of the first ten natural numbers is,\n\n1^2 + 2^2 + ... + 10^2 = 385\n\nThe square of the sum of the first ten natural numbers is,\n\n(1 + 2 + ... + 10)^2 = 55^2 = 3025\n\nHe...
ruby
chosen
[ { "from": "system", "value": "Use test-unit gem ~> 3.1.3\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\n\nGem::Specification.new do |spec|\n spec.name = \"color-schema-validator\"\...
ruby
chosen
[ { "from": "system", "value": "Make sure devices are an array. Was causing issues in Vent.\n" }, { "from": "human", "value": "class ApnsChannel\n class << self\n\n \tdef default_options\n \t {\n \t description: \"Push Notifications\"\n \t }\n \tend\n\n def deliver(notification, opti...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary module from Notification Object\n" }, { "from": "human", "value": "module SaveQueue\n module Plugins\n module Notification\n module Object\n def self.included(base)\n base.send :include, AddObserverToQueue\n end\n\n...
ruby
chosen
[ { "from": "system", "value": "Allow library to coexist with Squeel.\n\nScope query construction gets in a pickle if Squeel is an included\ngem in a project:\n\nOrder.in_state(:cancelled)\n #=> ...WHERE \"order_transitions\".\"to_state\" IN (\"orders\".\"cancelled\")\n\n(Should be: `IN ('cancelled')`.)\n\nE...
ruby
chosen
[ { "from": "system", "value": "Remove context from spec, doesn't matter the context.\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe VotesController do\n describe '#create' do\n context 'on the welcome#index page' do\n before :each do\n @user = FactoryGirl.cr...
ruby
chosen
[ { "from": "system", "value": "Sort projects by begin date\n" }, { "from": "human", "value": "module Prep\n module Projects\n class Index < Jekyll::Prep::Script\n\n def prepare(page)\n order_by_most_recent(page.data['items'])\n\n page.data['items'].each { |item| set_subtitl...
ruby
chosen
[ { "from": "system", "value": "Plowshare: Move HEAD to new (git) repo\n\nCloses #7496.\n\nSigned-off-by: Charlie Sharpsteen <828d338a9b04221c9cbe286f50cd389f68de4ecf@sharpsteen.net>\n" }, { "from": "human", "value": "require 'formula'\n\nclass Plowshare < Formula\n head 'http://plowshare.googlec...
ruby
chosen
[ { "from": "system", "value": "Add spec for haml_file? method\n" }, { "from": "human", "value": "require 'spec_helper'\n\nmodule Pronto\n describe Haml do\n let(:haml) { Haml.new }\n\n describe '#run' do\n subject { haml.run(patches, nil) }\n\n context 'patches are nil' do\n ...
ruby
chosen
[ { "from": "human", "value": "Test that transactions are rolled back in nested routines\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\nunless ActiveRecord::Migration.table_exists?(:models)\n ActiveRecord::Migration.create_table(:models)\nend\n\nclass Model < ActiveRecord::Base; end\n\...
ruby
chosen
[ { "from": "system", "value": "Use mattr_accessor in TestsDatabase instead of setup method\n" }, { "from": "human", "value": "require 'logger'\n\n$:.unshift(File.dirname(__FILE__) + '/../../../activerecord/lib')\nrequire 'active_record'\nrequire 'active_record/fixtures'\n\nmodule ActiveModel\n m...
ruby
chosen
[ { "from": "system", "value": "Allow overriding of single page template by host app\n" }, { "from": "human", "value": "require_dependency \"storytime/application_controller\"\n\nmodule Storytime\n class PagesController < ApplicationController\n before_action :ensure_site, unless: ->{ params[:...
ruby
chosen
[ { "from": "system", "value": "Use the new 1.9 style gsub.\n" }, { "from": "human", "value": "require_dependency \"wafflemix/application_controller\"\n\nmodule Wafflemix\n class PagesController < ApplicationController\n\n def index\n @pages = Page.active.arrange(:order => :position)\n \...
ruby
chosen
[ { "from": "system", "value": "Return rates builder instead of rates\n" }, { "from": "human", "value": "Spree::Stock::Estimator.class_eval do\n\n private\n\n def calculate_shipping_rates(package, ui_filter)\n shipping_rates_builder(package).shipping_rates\n end\n\n def shipping_rates_build...
ruby
chosen
[ { "from": "system", "value": "Test struct methods ending in ?, !\n" }, { "from": "human", "value": "require File.expand_path('../../../spec_helper', __FILE__)\nrequire File.expand_path('../fixtures/classes', __FILE__)\n\ndescribe \"Struct#initialize\" do\n\n it \"is private\" do\n StructClas...
ruby
chosen
[ { "from": "system", "value": "Add empty line after access modifier\n\nRubocop was complaining about Layout/EmptyLinesAroundAccessModifier in\nthe tags controller.\n\nThis issue was introduced in commit e76735031. Unfortunately, it looks\nlike Pronto doesn't detect this issue because the access modifier was\...
ruby
chosen
[ { "from": "system", "value": "Save Stripe plan to user when signing up as a supporter\n" }, { "from": "human", "value": "class SupportersController < ApplicationController\n before_filter :authenticate_user!\n\n def new\n end\n\n def create\n # Create or retrieve the Stripe customer\n ...
ruby
chosen
[ { "from": "system", "value": "Update podspec for new release with doc link\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.platform = :ios, \"8.0\"\n s.name = \"RQVisual\"\n s.version = \"1.0.0\"\n s.summary = \"A tool for laying out views in cod...
ruby
chosen
[ { "from": "system", "value": "Support gemspec reading in GemfileJob\n\nThis file is getting a little out of hand. Needs some tests." }, { "from": "human", "value": "class GemfileJob < Struct.new(:id)\n def perform\n repo = Repository.find(id)\n puts \"Updating #{repo.to_s}\"\n url = r...
ruby
chosen
[ { "from": "system", "value": "Fix bug: notification subject line should note problems" }, { "from": "human", "value": "class Notifier < ApplicationMailer\n\n def self.report_event(event)\n admin_addresses.each do |email|\n send_msg(email, event).deliver_now\n end\n end\n\n def sen...
ruby
chosen
[ { "from": "system", "value": "Make user and media item accessible\n" }, { "from": "human", "value": "class Ownership < ActiveRecord::Base\n belongs_to :user\n belongs_to :media_item\n # attr_accessible :title, :body\nend\n" }, { "from": "gpt", "value": "class Ownership < ActiveRec...
ruby
chosen
[ { "from": "system", "value": "Fix a wrong copy-paste in mixins/type test.\n" }, { "from": "human", "value": "require \"feidee_utils/mixins/parent_and_path\"\nrequire 'minitest/autorun'\n\nclass FeideeUtils::Mixins::TypeTest < MiniTest::Test\n class TestClass\n include FeideeUtils::Mixins::Ty...
ruby
chosen
[ { "from": "system", "value": "Add a description to the Model generator and fix whitespace\n" }, { "from": "human", "value": "require 'rails/generators/couchrest_model'\n\nmodule CouchrestModel\n module Generators\n class ModelGenerator < NamedBase\n check_class_collision\n\n def cr...
ruby
chosen
[ { "from": "system", "value": "Add length validation to PhoneFormatValidator\n" }, { "from": "human", "value": "class PhoneFormatValidator < ActiveModel::EachValidator\n def validate_each(record, attribute, value)\n if not value =~ /^([0-9\\.+ -]+)$/i\n record.errors.add(attribute, \"sho...
ruby
chosen
[ { "from": "system", "value": "Improve Attachment initialize method monkeypatch\n" }, { "from": "human", "value": "module DragonflyRails\n module Dragonfly\n module ActiveModelExtensions\n module ClassMethods\n def dragonfly_for(*options)\n accessor = options.first\n ...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary require of Set.\n" }, { "from": "human", "value": "require 'set'\nrequire 'dumb_delegator/version'\n\nclass DumbDelegator < ::BasicObject\n (::BasicObject.instance_methods - [:equal?, :__id__, :__send__, :method_missing]).each do |method|\n un...
ruby
chosen
[ { "from": "system", "value": "Reorder setting of `@dirname` instance variable to make it available while running the `convert` method." }, { "from": "human", "value": "module JAPR\n class Converter\n extend JAPR::SubclassTracking\n\n def initialize(asset)\n @content = asset.content\n...
ruby
chosen
[ { "from": "system", "value": "Use ctime of directory for date rather than name\n" }, { "from": "human", "value": "require \"nas/capistrano/version\"\n\nmodule NAS\n\n module Capistrano\n\n def last_release\n @last_release ||= capture(:ls, releases_path, '| tail -1')\n ...
ruby
chosen
[ { "from": "system", "value": "Make the login failure more flexible\n" }, { "from": "human", "value": "module Offline\n class Github\n include HTTParty\n base_uri 'https://api.github.com'\n headers 'User-Agent' => \"Offline v#{Offline::VERSION} - https://github.com/vertis/offline\"\n\n ...
ruby
chosen
[ { "from": "system", "value": "Add title retrieval by IMDb ID.\nChange search method to find.\n" }, { "from": "human", "value": "module OMDB\n class Client\n\n include HTTParty\n base_uri OMDB::Default::API_ENDPOINT\n\n def title(title)\n get '/', { t: title }\n end\n\n def s...
ruby
chosen
[ { "from": "system", "value": "Fix incorrect require for ActiveSupport inflection core extensions\n\nIt's probably never mattered though since ActiveRecord(?)/Rails loads\nthese anyway.\n" }, { "from": "human", "value": "require 'active_support/inflector'\nrequire 'with_model/base'\n\nmodule With...
ruby
chosen
[ { "from": "system", "value": "Change the way of translating default_error_message by using :default I18n.translation options instead of throwing I18n::MissingTranslationData\n" }, { "from": "human", "value": "module Shoulda # :nodoc:\n module Matchers\n module ActiveRecord # :nodoc:\n m...
ruby
chosen
[ { "from": "human", "value": "Add rabbitmq queue check if all slaves are synchronised" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\n\nrequire 'rubygems' if RUBY_VERSION < '1.9.0'\nrequire 'sensu-plugin/check/cli'\nrequire 'socket'\nrequire 'carrot-top'\n\nclass CheckRabbitMQReplication < Se...
ruby
chosen
[ { "from": "system", "value": "Rename headers(), as this is a reserved word for when helper is included\n" }, { "from": "human", "value": "module WkankiHelper\n @@WANIKANI_API = \"1.2\";\n\n @@HEADERS= [\"type\", \"character\", \"meaning\", \"image\", \"onyomi\", \"kunyomi\", \"important_readin...
ruby
chosen
[ { "from": "system", "value": "Update counter cache now works. Was spitting out old published mixes number\n" }, { "from": "human", "value": "class MixCollection\n include Mongoid::Document\n include Mongoid::Timestamps\n include Mongoid::Slug\n\n paginates_per 12\n \n field :name, type: St...
ruby
chosen
[ { "from": "system", "value": "Load Settings from settings.yml if this file is present in the project\n\n- This gives old projects which are using `Settings` ability to use\n latest version of handy.\n- In new projects, we have already removed `settings.yml` from `config`\n folder.\n- So this can be workab...
ruby
chosen
[ { "from": "system", "value": "Move path param into options hash\n" }, { "from": "human", "value": "require \"multi_logger/version\"\n\nmodule MultiLogger\n class << self\n def add_logger(name, path=nil, options={})\n name = name.to_s\n rails_logger_class = get_rails_logger_class()\...
ruby
chosen
[ { "from": "system", "value": "Update RemoteModel to allow initialization with nil\n" }, { "from": "human", "value": "module RescueGroups\n module RemoteModel\n def self.included(base)\n base.class_eval do\n def initialize(attribute_hash)\n attribute_hash.each do |key, va...
ruby
chosen
[ { "from": "system", "value": "Initialize in case rails is included into specification\n" }, { "from": "human", "value": "module Translatable\nend\n\nrequire \"translatable/base\"\n\nif defined?(Rails)\n require 'translatable/engine'\n\n ActiveSupport.on_load(:active_record) do\n require 'tr...
ruby
chosen
[ { "from": "system", "value": "Call set_resource_attributes to define getters and setters on object." }, { "from": "human", "value": "require \"spec_helper\"\n\nclass Model\n include Mongoid::Document\n include Vidibus::Resource::Consumer::Mongoid\nend\n\ndescribe \"Vidibus::Resource::Consumer:...
ruby
chosen
[ { "from": "system", "value": "Use non-deprecated NonDigestAssets configuration method\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nNonDigestAssets.whitelist = [/\\.(?:svg|eot|woff|ttf)$/]\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nNonDige...
ruby
chosen
[ { "from": "system", "value": "Replace magic numbers with constants\n" }, { "from": "human", "value": "module FlashHelper\n # FLASH_LEVEL: [ CLASS_TYPE, ICON ]\n FLASH_MAPPINGS = {\n notice: %w(success check),\n info: %w(info info),\n success: %w(success check),\n error: %...
ruby
chosen
[ { "from": "system", "value": "Update on Image Conversion, Huge size added\n" }, { "from": "human", "value": "class ProductImage < ApplicationRecord\n has_attached_file :picture, \n styles: { \n thumb: [\"120x120>\", :webp], \n small: ...
ruby
chosen
[ { "from": "system", "value": "Add missing method on Spree::Konbini\n\nThis seems to be expected.\n" }, { "from": "human", "value": "module Spree\n class Konbini < Spree::Base\n STORES = %i(lawson family-mart sunkus circle-k ministop daily-yamazaki seven-eleven)\n\n belongs_to :payment_met...
ruby
chosen
[ { "from": "human", "value": "Update dataset_page_audit_id primary key to bigint\n" }, { "from": "gpt", "value": "class ChangeDatasetPageAuditIdToBigint < ActiveRecord::Migration[6.0]\n def up\n change_column :dataset_page_audits, :id, :bigint\n end\n\n def down\n change_column :dataset_...
ruby
chosen
[ { "from": "system", "value": "Update coconutBattery to version 3.3\n" }, { "from": "human", "value": "class Coconutbattery < Cask\n url 'http://www.coconut-flavour.com/downloads/coconutBattery_2.8.zip'\n homepage 'http://www.coconut-flavour.com/coconutbattery/'\n version '2.8'\n sha256 'fcfc...
ruby
chosen
[ { "from": "system", "value": "Make the params hash indifferent\n" }, { "from": "human", "value": "module Frankie\n class RequestScope\n attr_reader :request, :app, :response\n\n def self.add_helper_module m\n include m\n end\n\n def initialize app, req\n @app = app\n ...
ruby
chosen
[ { "from": "system", "value": "[style] Move include to top of file\n" }, { "from": "human", "value": "module Arel # :nodoc:\n module Visitors # :nodoc:\n # Different super-class under JRuby JDBC adapter.\n PostGISSuperclass = if defined?(::ArJdbc::PostgreSQL::BindSubstitution)\n ...
ruby
chosen
[ { "from": "system", "value": "Modify extraction target from . to *.\n" }, { "from": "human", "value": "hostname = `hostname`.strip\nhost_backup_restore_config[hostname].each do |path_config|\n config = amanda_config(hostname, path_config[:path])\n bash \"amrecover_#{config['name']}\" do\n cod...
ruby
chosen
[ { "from": "human", "value": "Verify Minewsweeper - inefficient solution\n" }, { "from": "gpt", "value": "require 'rspec/autorun'\n\nclass MinesweeperChecker\n def initialize board_data\n @board_data = board_data\n end\n\n attr_reader :rows\n\n def count_surrounding_mines(y, x)\n r=[-1,...
ruby
chosen
[ { "from": "system", "value": "Sort and remove duplicates on target sector_ids\n" }, { "from": "human", "value": "module Api\n module V1\n module NdcSdg\n class TargetSerializer < ActiveModel::Serializer\n attribute :id\n attribute :number\n attribute :title\n ...
ruby
chosen
[ { "from": "system", "value": "Fix redirect to work with sub-urls.\nIf anyone knows how to adjust the specs so this gets tested\nthroughout the application, please! do so ...\n" }, { "from": "human", "value": "class Admin::ProfilesController < Admin::BaseController\n helper Admin::UsersHelper\n ...
ruby
chosen
[ { "from": "system", "value": "Sort by created at on page feedback list\n" }, { "from": "human", "value": "class PageFeedbacksController < Comfy::Admin::Cms::BaseController\n def index\n @page_feedbacks = PageFeedback.includes(:page).page(params[:page])\n end\nend\n" }, { "from": "gp...
ruby
chosen
[ { "from": "human", "value": "Add countries helper for view\n" }, { "from": "gpt", "value": "module CountriesHelper\n def is_malaysia?\n @country && @country.iso_3 == \"MYS\"\n end\n\n def is_japan?\n @country && @country.iso_3 == \"JPN\"\n end\n\n def malaysia_documents\n [\n ...
ruby
chosen
[ { "from": "system", "value": "Add section to before each\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'spec_helper'\n\ndescribe 'editing incidents as a driver' do\n let(:driver) { create :user, :driver }\n before(:each) { when_current_user_is driver }\n let(:rep...
ruby
chosen
[ { "from": "system", "value": "Fix the test to actually compare times instead of string representations of time.\n\ngit-svn-id: 0d15740d2b2329e9094a4e8932733054e5d3e04c@491 8ba958d5-0c1a-0410-94a6-a65dfc1b28a6\n" }, { "from": "human", "value": "require 'java'\r\nrequire 'models/data_types'\r\nreq...
ruby
chosen