conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Add signatures for text insert methods\n"
},
{
"from": "human",
"value": "module PadUtils\n\n # Convert a string into a proper Ruby name.\n # For example, 'app_name' will be converted to 'AppName' \n def self.convert_to_ruby_name(value)\n if value.scan(/\\_|\\... | ruby | chosen |
[
{
"from": "system",
"value": "Test helper shouldn't deliver the notification\n"
},
{
"from": "human",
"value": "# Test helper for EM::WPN\n#\n# To use this, start by simply requiring this file after EM::WPN has already\n# been loaded\n#\n# require \"em-wpn\"\n# require \"em-wpn/test_help... | ruby | chosen |
[
{
"from": "system",
"value": "Add .pre for next release\n"
},
{
"from": "human",
"value": "module EY\n VERSION = '3.2.0'\n ENGINEYARD_SERVERSIDE_VERSION = ENV['ENGINEYARD_SERVERSIDE_VERSION'] || '2.6.3'\nend\n"
},
{
"from": "gpt",
"value": "module EY\n VERSION = '3.2.1.pre'\n ENG... | ruby | chosen |
[
{
"from": "system",
"value": "Remove auth method config option\n"
},
{
"from": "human",
"value": "module ResquePoll\n class Engine < ::Rails::Engine\n isolate_namespace ResquePoll\n\n config.authentication_method = nil\n end\nend\n"
},
{
"from": "gpt",
"value": "module Resque... | ruby | chosen |
[
{
"from": "system",
"value": "Test still runs but commented out? win!\n"
},
{
"from": "human",
"value": "require 'test_helper'\n \nclass NotableDetailedTemplateTest < ActiveSupport::TestCase\t\n\t\n\tdef setup\n\t\t@file_name = \"/tmp/notable_detailed.pdf\"\n\t\t@template_manager = Risu::Base::T... | ruby | chosen |
[
{
"from": "system",
"value": "Add run_step to run a single step at once\n"
},
{
"from": "human",
"value": "require 'observer'\n\nmodule Stairway\n class Stairs\n include Observable\n\n attr_accessor :name\n\n def initialize(name)\n @name = name\n end\n\n def steps\n @st... | ruby | chosen |
[
{
"from": "system",
"value": "Use a loop instead of the previous version which only handled exactly two files\n"
},
{
"from": "human",
"value": "# Get array of all command line arguments\nputs ARGF.argv.inspect\n\n# Get all lines of all files\nARGF.each { | line |\n puts line\n}\n\n# Get all li... | ruby | chosen |
[
{
"from": "human",
"value": "Add code wars (7) - make acronym\n"
},
{
"from": "gpt",
"value": "# http://www.codewars.com/kata/557efeb04effce569d000022/\n# --- iteration 1 ---\ndef make_acronym(phrase)\n return \"Not a string\" unless phrase.is_a?(String)\n return \"Not letters\" unless phrase.... | ruby | chosen |
[
{
"from": "human",
"value": "Set email prefs to true for exising records (prior default behavior)\n"
},
{
"from": "gpt",
"value": "class DefaultEmailPrefsToTrue < ActiveRecord::Migration\n def self.up\n User.where('email_delivery IS NULL or email_acceptance IS NULL OR email_rejection IS NULL... | ruby | chosen |
[
{
"from": "human",
"value": "Update request_id primary key to bigint\n"
},
{
"from": "gpt",
"value": "class ChangeRequestIdToBigint < ActiveRecord::Migration[6.0]\n def up\n change_column :requests, :id, :bigint\n end\n\n def down\n change_column :requests, :id, :integer\n end\nend\n"
... | ruby | chosen |
[
{
"from": "human",
"value": "Add a helper module that can be used in our apps' controllers\n"
},
{
"from": "gpt",
"value": "require 'gds_api/publisher'\nrequire 'gds_api/imminence'\nrequire 'gds_api/panopticon'\n\nmodule GdsApi\n module Helpers\n def publisher_api\n @api ||= GdsApi::Pub... | ruby | chosen |
[
{
"from": "system",
"value": "Make podspec iOS 7 only.\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name \t= 'SVWebViewController'\n s.version \t= '1.0'\n s.summary \t= 'A simple inline browser for your iOS app.'\n s.homepage \t \t= 'http://samvermette.com/1... | ruby | chosen |
[
{
"from": "system",
"value": "Change syntax for raise rubocop offences\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nmodule LocaleKit\n VERSION = '0.0.3'.freeze\nend\n"
},
{
"from": "gpt",
"value": "# frozen_string_literal: true\n\nmodule LocaleKit\n VERSION =... | ruby | chosen |
[
{
"from": "system",
"value": "Add more valid data types\n"
},
{
"from": "human",
"value": "\ndef valid_datatype(datatype)\n return ['int', 'double', 'float', 'string', 'String', 'bool', 'boolean', 'char'].include? datatype.chomp\nend\n\ndef valid_name?(name)\n return !(name.include? '*')\nend\... | ruby | chosen |
[
{
"from": "system",
"value": "Convert Provider top level docs to yard\n"
},
{
"from": "human",
"value": "require 'wright/config'\nrequire 'wright/util/recursive_autoloader'\n\nmodule Wright\n # Public: Provider class.\n class Provider\n # Public: Wright standard provider directory.\n PRO... | ruby | chosen |
[
{
"from": "human",
"value": "Create new CF secret generator that uses new lib\n\nThis will allow us to pass in the existing secrets so that only ones\nthat are missing will be generated.\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env ruby\n\nrequire 'optparse'\nrequire 'yaml'\nrequire File.expa... | ruby | chosen |
[
{
"from": "system",
"value": "Split Railtie logic for Rails 2, 3, and 4+\n"
},
{
"from": "human",
"value": "require 'wicked_pdf/pdf_helper'\nrequire 'wicked_pdf/wicked_pdf_helper'\n\nif defined?(Rails)\n\n if Rails::VERSION::MAJOR == 4\n\n class WickedRailtie < Rails::Railtie\n initiali... | ruby | chosen |
[
{
"from": "system",
"value": "Fix synonym set for the icons"
},
{
"from": "human",
"value": "module Purpur\n module Helpers\n\n def icon_tag(name, options = {})\n size = Purpur::ICON_SIZES[options.delete(:size)]\n styleclass = ['icon', options.delete(:class)].join(' ')\n\n con... | ruby | chosen |
[
{
"from": "system",
"value": "Extend tests for service that stops environment\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe Ci::StopEnvironmentService, services: true do\n let(:project) { create(:project) }\n let(:user) { create(:user) }\n\n let(:service) { described_cl... | ruby | chosen |
[
{
"from": "human",
"value": "Add iterative reverse linked list\n"
},
{
"from": "gpt",
"value": "require_relative \"./testable\"\n\nclass ReverseLinkedList\n include Testable\n\n # Definition for singly-linked list.\n # @param {ListNode} head\n # @return {ListNode}\n class ListNode\n attr... | ruby | chosen |
[
{
"from": "system",
"value": "Add some comments to BracketConstructor.\n"
},
{
"from": "human",
"value": "# Mixin that adds a [] operator constructor to a class\nmodule ModalSupport::BracketConstructor\n \n def self.included(base)\n base.extend ClassMethods\n end\n \n module ClassMethods... | ruby | chosen |
[
{
"from": "system",
"value": "Fix attribute for livefeed loop example\n\nWas changed in dff29e6808ce9cbdbee94a5fdc8970610b4a7cdd\n"
},
{
"from": "human",
"value": "Bundler.require\n\nrequire \"twingly/livefeed\"\n\n# Set environment variable TWINGLY_SEARCH_KEY\nclient = Twingly::LiveFeed::Client... | ruby | chosen |
[
{
"from": "human",
"value": "Add chef-spec for restore_ruby recipe\n"
},
{
"from": "gpt",
"value": "require_relative '../spec_helper'\n\ndescribe 'backup_restore::restore_ruby' do\n let(:chef_run) do\n runner = ChefSpec::Runner.new(\n cookbook_path: %w(site-cookbooks cookbooks),\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix issue with es6 extension with JSHint\n"
},
{
"from": "human",
"value": "# encoding: utf-8\nmodule Phare\n class Check\n class JSHint < Check\n attr_reader :config, :path\n\n def initialize(directory, options = {})\n @config = File.expand_pat... | ruby | chosen |
[
{
"from": "system",
"value": "Add sinatra as development dependency for testing purposes\n\nUsed for test suite"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = \"hurley\"\nlib_file = File.expand_path(\"../lib/#{lib}.rb\", __FILE__)\nFile.read(lib_file) =~ /\\bVERSION\\s*=\\s*[\"'](.+?)[\... | ruby | chosen |
[
{
"from": "system",
"value": "Support multiple directories in GOPATH\n"
},
{
"from": "human",
"value": "module Quartz::Validations\n\n def self.check_for_go\n go_exists = ENV['PATH'].split(File::PATH_SEPARATOR).any? do |directory|\n File.exist?(File.join(directory, 'go'))\n end\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Support underline, strike and background\n"
},
{
"from": "human",
"value": "require 'quill/builder/base'\nrequire 'json'\n\nmodule Quill::Builder\n class HTML < Base\n def initialize(text)\n @text = text\n end\n\n def convert\n json = JSON.parse(... | ruby | chosen |
[
{
"from": "system",
"value": "Fix content type header middleware\n"
},
{
"from": "human",
"value": "require 'faraday_middleware'\n\nclass TentClient\n module Middleware\n class ContentTypeHeader < Faraday::Middleware\n CONTENT_TYPE_HEADER = 'Content-Type'.freeze\n MEDIA_TYPE = %w(a... | ruby | chosen |
[
{
"from": "system",
"value": "Upgrade 'on' gem to 1.0.0\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/neo/dci/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Peter Suschlik\", \"Jakob Holderbaum\", \"Jonas Thiel\"]... | ruby | chosen |
[
{
"from": "system",
"value": "Load users in batches in email tasks\n"
},
{
"from": "human",
"value": "desc 'Send daily emails'\ntask send_emails: :environment do\n next unless PullRequest.in_date_range?\n\n User.all.each do |user|\n Notification.new(user).send_email # rescue nil\n end\nend... | ruby | chosen |
[
{
"from": "system",
"value": "Add usage comments for tasks\n"
},
{
"from": "human",
"value": "namespace :import do\n task :all_photos, [:path] => :environment do |t, args|\n require \"album_set_processor\"\n\n AlbumSetProcessor.new(args.path).syncronize_photos\n end\n\n task :photos, [:... | ruby | chosen |
[
{
"from": "system",
"value": "Disable JS tests until we sort out buster.\n"
},
{
"from": "human",
"value": "namespace :travis do\n task :status do\n require 'json'\n require 'faraday'\n\n data = JSON.parse(Faraday.get(\"https://api.travis-ci.org/repositories/holderdeord/hdo-site.json\"... | ruby | chosen |
[
{
"from": "system",
"value": "Add OrderHelpers for FIX error in show the payments for missing order_just_completed? method\n"
},
{
"from": "human",
"value": "module Spree::Conekta\n class PaymentsController < Spree::StoreController\n ssl_required\n skip_before_filter :verify_authenticity_... | ruby | chosen |
[
{
"from": "system",
"value": "Add add_identifier and remove_identifier methods to IsAnEntityWithIdentifiers concern\n"
},
{
"from": "human",
"value": "module IsAnEntityWithIdentifiers\n extend ActiveSupport::Concern\n\n included do\n attr_accessor :identified_by, :not_identified_by\n\n s... | ruby | chosen |
[
{
"from": "system",
"value": "Work with mingw compiled versions of Windows.\n"
},
{
"from": "human",
"value": "class Spork::RunStrategy\n attr_reader :test_framework\n @@run_strategies = []\n\n def initialize(test_framework)\n @test_framework = test_framework\n end\n\n def preload\n r... | ruby | chosen |
[
{
"from": "system",
"value": "Add homepage to gemspec [ci skip]\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'minitest_to_rspec/version'\n\nGem::Specification.new do |spec|\n spec... | ruby | chosen |
[
{
"from": "system",
"value": "Move ClassBuilder class methods from include to ClassMethods module\n"
},
{
"from": "human",
"value": "require 'active_support/concern'\nrequire 'active_support/core_ext/string'\nrequire 'active_support/core_ext/module'\n\nmodule Weka\n module ClassBuilder\n ext... | ruby | chosen |
[
{
"from": "system",
"value": "Fix repoman page check, it should never have passed\n"
},
{
"from": "human",
"value": "require_relative 'minitest_helper'\n\nclass TestWeb < Minitest::Test\n\tinclude Rack::Test::Methods\n\n\tdef app\n\t\tRubyTinderbox\n\tend\n\n\tdef test_heading\n\t\tget '/repoman... | ruby | chosen |
[
{
"from": "system",
"value": "Use `before_action` for compatibility with Rails 5.\n"
},
{
"from": "human",
"value": "module DockerManager\n class ApplicationController < ActionController::Base\n\n helper DockerManager::ApplicationHelper\n\n include CurrentUser\n\n before_filter :ensure... | ruby | chosen |
[
{
"from": "system",
"value": "Add math lib to calculator\n"
},
{
"from": "human",
"value": "module Filter\n class CalculatorBot\n def update(p)\n t = p['text']\n re = /^\\:= /\n return nil unless t =~ re\n exp = t.gsub(re,'')\n return unless validate(exp)\n begi... | ruby | chosen |
[
{
"from": "human",
"value": "Add acceptance test for motd\n"
},
{
"from": "gpt",
"value": "require 'spec_helper_acceptance'\n\ndescribe 'motd and motd::entry should work' do\n it 'should configure and work with no errors' do\n pp = <<-EOS\n include('motd')\n motd::header ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix test cases by introducing facts to rspec\n"
},
{
"from": "human",
"value": "# Copyright 2013 Brainsware\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may... | ruby | chosen |
[
{
"from": "system",
"value": "Use let instead of instance variable\n"
},
{
"from": "human",
"value": "require 'test_helper'\n\ndescribe Kiitos::Admin::AdministratorsController do\n before do\n @routes = Kiitos::Engine.routes\n end\n\n describe 'POST :create' do\n it 'turns a user into ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix incomplete ndk upgrade in d7f558ad\n"
},
{
"from": "human",
"value": "\nndk_loc = node[:settings][:ndk_loc]\nuser = node[:settings][:user]\n\nexecute \"add-android-ndk-path\" do\n user user\n command \"echo \\\"export PATH=\\\\$PATH:#{ndk_loc} #PATH-NDK\\\" >>... | ruby | chosen |
[
{
"from": "system",
"value": "Add Municipality::to_form_array method name_only option\n"
},
{
"from": "human",
"value": "require 'csv'\n\nmodule Arbetsformedlingen\n class MunicipalityCode\n CODE_MAP = CSV.read(\n File.expand_path('../../../../data/municipality-codes.csv', __FILE__)\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Adjust description for rubygems and ruby toolbox\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"micro-optparse/version\"\n\nGem::Specification.new do |s|\n s.name = \"micro-optparse\"\n... | ruby | chosen |
[
{
"from": "system",
"value": "Add license to gemspec and update other fields for new company name.\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n\n$:.unshift(File.dirname(__FILE__) + '/lib')\nrequire 'mixlib/config/version'\n\n\nGem::Specification.new do |s|\n s.name = \"mixlib-... | ruby | chosen |
[
{
"from": "system",
"value": "Add name attribute to security header\n"
},
{
"from": "human",
"value": "module Headlines\n module SecurityHeaders\n class SecurityHeader\n attr_reader :params\n\n def initialize(header)\n @header = header[1]\n @params = { value: @header,... | ruby | chosen |
[
{
"from": "human",
"value": "Add serialization and deserialization for cohorts\n\nMake all matchers inherit from base matcher. Implement serializer for Cohort. Implement basic serializer\nfor base matcher class. Implement specific serializer for user agent matcher class. Spec out new functionality\n"
},
... | ruby | chosen |
[
{
"from": "system",
"value": "Check if entity is rateable before try to rate it\n"
},
{
"from": "human",
"value": "module OneMoreRating\n class RatingsController < ApplicationController\n def create\n @rateable = Object.const_get(params[:rateable_type]).find(params[:rateable_id])\n ... | ruby | chosen |
[
{
"from": "human",
"value": "Add specs to test events Hash normalizer\n"
},
{
"from": "gpt",
"value": "require 'graphite_client'\nrequire File.expand_path(File.dirname(__FILE__) + '/spec_helper')\n\nrequire 'json'\n\ndescribe \"GraphiteClient::EventReporter::EventValue\" do\n before do\n @ev... | ruby | chosen |
[
{
"from": "system",
"value": "Update example use in webhook spec\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ninclude Support::ResourceExamples\n\ndescribe Fulcrum::Webhook do\n include_context 'with client'\n include_context 'with resource'\n\n let(:resource) { client.webhooks... | ruby | chosen |
[
{
"from": "system",
"value": "Test with some doc generation tomdoc\n"
},
{
"from": "human",
"value": "require 'envato/connection'\nrequire 'envato/configurable'\nrequire 'envato/client/stats'\n\nmodule Envato\n class Client\n\n include Envato::Connection\n include Envato::Configurable\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Allow rendering an Arbre fragment in view component tests\n"
},
{
"from": "human",
"value": "module ViewComponentExampleGroup\n extend ActiveSupport::Concern\n include RSpec::Rails::RailsExampleGroup\n include ActionView::TestCase::Behavior\n include Capybara::R... | ruby | chosen |
[
{
"from": "human",
"value": "Add a gemspec, this is v1.0\n"
},
{
"from": "gpt",
"value": "# -*- encoding: utf-8 -*-\n\nGem::Specification.new do |s|\n s.name = \"divvy\"\n s.version = \"1.0\"\n s.platform = Gem::Platform::RUBY\n s.authors = %w[@rtomayko]\n s.email = ... | ruby | chosen |
[
{
"from": "human",
"value": "Test that we can view servers."
},
{
"from": "gpt",
"value": "Shindo.tests('Fog::Compute[:serverlove] | server requests', ['serverlove']) do\n \n tests('success') do\n\n tests(\"#list_servers\").succeeds do\n Fog::Compute[:serverlove].servers\n end\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Remove spec for class attribute\n"
},
{
"from": "human",
"value": "require \"spec_helper\"\n\ndescribe AttrCleaner::Model do\n let(:model) do\n JamJar.model do\n column :title, :string\n column :body, :text\n end\n end\n\n let(:instance) { model.n... | ruby | chosen |
[
{
"from": "system",
"value": "Add test case to test method_missing\n"
},
{
"from": "human",
"value": "require 'spec_helper'\nrequire 'futuroscope/future'\nrequire 'timeout'\n\nmodule Futuroscope\n describe Future do\n it \"will return an instant value\" do\n future = Future.new{ :edball... | ruby | chosen |
[
{
"from": "system",
"value": "Add a comment around EventsRule\n"
},
{
"from": "human",
"value": "require_relative '../resource'\n\nmodule Convection\n module Model\n class Template\n class Resource\n ##\n # AWS::Events::Rule\n ##\n class EventsRule < Resource... | ruby | chosen |
[
{
"from": "system",
"value": "Put optional argument at end of `expect_component`\n"
},
{
"from": "human",
"value": "require 'slimmer/test_helpers/shared_templates'\n\nmodule GovukComponent\n include Slimmer::TestHelpers::SharedTemplates\n\n def expect_component(name, key = name, value)\n wi... | ruby | chosen |
[
{
"from": "system",
"value": "Revert \"Remove student searchbar caching from educator import job\"\n"
},
{
"from": "human",
"value": "class EducatorsImporter < Struct.new :school_scope, :client, :log, :progress_bar\n\n def remote_file_name\n 'educators_export.txt'\n end\n\n def data_transf... | ruby | chosen |
[
{
"from": "system",
"value": "Fix deprecation warning in query\n\nThe upgrade has triggered this warning:\n`DEPRECATION WARNING: NOT conditions will no longer behave as NOR\nin Rails 6.1. To continue using NOR conditions, NOT each conditions\nmanually`\n"
},
{
"from": "human",
"value": "module Q... | ruby | chosen |
[
{
"from": "system",
"value": "Set status to Provisioned if everything's up or Unknown otherwise\n"
},
{
"from": "human",
"value": "module KubernetesDeploy\n class Cloudsql < KubernetesResource\n TIMEOUT = 30.seconds\n\n def initialize(name, namespace, file)\n @name, @namespace, @file... | ruby | chosen |
[
{
"from": "system",
"value": "Add yard docs for uniqueness validator\n"
},
{
"from": "human",
"value": "require 'active_model/validator'\n\nmodule ROM\n module Model\n module Validator\n class UniquenessValidator < ActiveModel::EachValidator\n attr_reader :klass, :message\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Correct readme filename in gemspec\n"
},
{
"from": "human",
"value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"dough/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |s|\n s... | ruby | chosen |
[
{
"from": "system",
"value": "Correct example that did not do what it claimed. Rework explanation.\n"
},
{
"from": "human",
"value": "class Hash\n # Allows for reverse merging two hashes where the keys in the calling hash take precedence over those\n # in the <tt>other_hash</tt>. This is parti... | ruby | chosen |
[
{
"from": "system",
"value": "Revert \"raises TypeError if to_s returns empty string\"\n\nThis reverts commit e7057cafe7597b9ffc47e5dfeb7b1a0aaec18517.\n"
},
{
"from": "human",
"value": "class Module\n def const_defined?(name, search_parents=true)\n name = normalize_const_name(name)\n ret... | ruby | chosen |
[
{
"from": "system",
"value": "Add root path for all templates\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nrequire 'forwardable'\nrequire 'pathname'\nrequire 'tty-command'\nrequire 'tty-which'\nrequire 'tty-file'\n\nmodule TTY\n class Cmd\n extend Forwardable\n\n GEMSPEC_PATH =... | ruby | chosen |
[
{
"from": "system",
"value": "Add dependencies on RSpec, ActiveSupport, and ActiveRecord.\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'database_transform/version'\n\nGem::Specific... | ruby | chosen |
[
{
"from": "system",
"value": "Upgrade Intellij Idea EAP to 141.1192.2\n\nSigned-off-by: Koichi Shiraishi <41a18128582fec5418c0a92661f7d4b13d21d912@gmail.com>\n"
},
{
"from": "human",
"value": "cask :v1 => 'intellij-idea-eap' do\n version '141.588.1'\n sha256 '4748d0785eb9e7df24fe43524ee196db69... | ruby | chosen |
[
{
"from": "system",
"value": "Fix deprecated use of Appium::Driver.new()\n"
},
{
"from": "human",
"value": "# coding: utf-8\nrequire \"rubygems\"\nrequire \"appium_lib\"\nrequire_relative 'application_drivers/application_drivers'\n\nTITLE = '百首読み上げ'\nJOKA = '序歌'\nWHATS_NEXT_STR = '次はどうする?'\nDIA... | ruby | chosen |
[
{
"from": "system",
"value": "Add missing \"content_type :json\" for pure JSON output"
},
{
"from": "human",
"value": "require 'sinatra/base'\nrequire 'multi_json'\n\nmodule Sinatra\n module Jsonp\n def jsonp(*args)\n if args.size > 0\n data = MultiJson.dump args[0], :pretty => s... | ruby | chosen |
[
{
"from": "system",
"value": "Fix transit components reference in db migration.\n"
},
{
"from": "human",
"value": "class CreateInfrastructureVoltageTypes < ActiveRecord::Migration[5.2]\n def change\n create_table :infrastructure_voltage_types do |t|\n t.string :name\n t.boolean :ac... | ruby | chosen |
[
{
"from": "system",
"value": "Use yield instead of block.call\n"
},
{
"from": "human",
"value": "require 'twitter'\nrequire 'retryable'\nrequire 'set'\n\nmodule T\n module Collectable\n MAX_NUM_RESULTS = 200\n MAX_PAGE = 51\n\n def collect_with_max_id(collection = [], max_id = nil, &bl... | ruby | chosen |
[
{
"from": "system",
"value": "Use global AqBanking.config var to reference conf\n"
},
{
"from": "human",
"value": "require \"aqbanking/version\"\nrequire \"aqbanking/account\"\n\nmodule AqBanking\n def config=(path)\n @config = path\n end\n\n def config\n @config ||= '.'\n end\n\n def... | ruby | chosen |
[
{
"from": "system",
"value": "Use `scenario` instead of `it` in feature specs\n"
},
{
"from": "human",
"value": "require \"rails_helper\"\n\nfeature \"Polls\" do\n\n context \"Public index\" do\n it \"Budget polls should not be listed\" do\n poll = create(:poll)\n budget_poll = cre... | ruby | chosen |
[
{
"from": "human",
"value": "Add common request failure behaviour.\n"
},
{
"from": "gpt",
"value": "# encoding: utf-8\n\nshared_examples_for 'request failure' do\n\n context \"resource not found\" do\n let(:body) { \"\" }\n let(:status) { [404, \"Not Found\"] }\n\n it \"should fail t... | ruby | chosen |
[
{
"from": "system",
"value": "Add debug option to tests\n"
},
{
"from": "human",
"value": "require \"test_helper\"\n\nclass Mathematical::FixturesTest < Test::Unit::TestCase\n\n Dir['test/mathematical/fixtures/before/*.text'].each do |before|\n name = before.split('/').last\n\n define_met... | ruby | chosen |
[
{
"from": "system",
"value": "Support 'street2' field for PayflowExpress UK\n"
},
{
"from": "human",
"value": "module ActiveMerchant #:nodoc:\n module Billing #:nodoc:\n class PayflowExpressResponse < Response\n def email\n @params['e_mail']\n end\n \n def full_nam... | ruby | chosen |
[
{
"from": "system",
"value": "Add json parse error handling\n"
},
{
"from": "human",
"value": "module Algorithmia\n\n class AlgorithmiaException\n def initialize(error)\n @error = symbolize_keys(error[\"error\"])\n parse_error\n end\n\n def parse_error\n case @error[:mes... | ruby | chosen |
[
{
"from": "system",
"value": "Remove index method from comments controller\n"
},
{
"from": "human",
"value": "class CommentsController < ApplicationController\n before_action :set_submission\n before_action :set_comment, only: [:show, :edit, :update, :destroy]\n\n def index\n @comments = C... | ruby | chosen |
[
{
"from": "human",
"value": "Create a podspec file for Cocoapods support.\n"
},
{
"from": "gpt",
"value": "Pod::Spec.new do |s|\n s.name = 'SanFranciscoFontFeatures'\n s.version = '1.0.0'\n s.platform = :ios, \"8.2\"\n s.license = 'MIT'\n s.summary = 'SanFranciscoFontFeatures provide... | ruby | chosen |
[
{
"from": "system",
"value": "Put in nil check before gsubbing the about text\n"
},
{
"from": "human",
"value": "class Configuration < DataMapper::Base\n property :title, :string\n property :tag_line, :string, :length => 255\n property :about, :text\n property :about_formatter, :string\n \n... | ruby | chosen |
[
{
"from": "system",
"value": "Correct the description for reject_unauthorized_connection\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nmodule ActionCable\n module Connection\n module Authorization\n class UnauthorizedError < StandardError; end\n\n # Closes the... | ruby | chosen |
[
{
"from": "system",
"value": "Change CSS to JS in spec\n\nLooks like it was a holdover from the jekyll/jekyll-sass-converter spec."
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe(Jekyll::Converters::CoffeeScript) do\n let(:configuration) { Jekyll::Configuration::DEFAULTS }\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add comment to explain why we cant feed the whole email file contents to an XML parser\n"
},
{
"from": "human",
"value": "module LetterOpenerWeb\n class Letter\n cattr_accessor :letters_location do\n Rails.root.join(\"tmp\", \"letter_opener\")\n end\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Change to reflect how the gem works now\n"
},
{
"from": "human",
"value": "require 'spatula'\n\ndesc 'Create database'\ntask :crebas do\n Spatula::create '.kitchen.yml'\nend\n\ndesc 'Start local MySQL server'\ntask :start_mysql do\n if Spatula::any_dbs? '.kitchen.... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor the object path class.\n"
},
{
"from": "human",
"value": "class Udongo::ObjectPath\n def self.find(object)\n unless object.is_a?(Array)\n return \"#{object.class.name.underscore}_path\".gsub('_decorator', '')\n end\n\n object.map do |item|\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add cmake as a build dependency for Soprano\n"
},
{
"from": "human",
"value": "require 'brewkit'\n\nclass Soprano <Formula\n @url='http://surfnet.dl.sourceforge.net/project/soprano/Soprano/2.3.1/soprano-2.3.1.tar.bz2'\n @homepage='http://soprano.sourceforge.net/'\... | ruby | chosen |
[
{
"from": "system",
"value": "Remove has_paper_trail from LPIRecord class\n"
},
{
"from": "human",
"value": "class LandAndPropertyInformationRecord < ActiveRecord::Base\n has_paper_trail\n attr_accessible :cadastre_id, :end_date, :last_update, :lga_name,\n :lot_number, :modified_date, :plan... | ruby | chosen |
[
{
"from": "system",
"value": "Remove unneed docs for association writers\n\nMSP-12217\n\nReplaced by use of yard-activerecord.\n"
},
{
"from": "human",
"value": "# Join model that maps a {Metasploit::Cache::Module::Instance model} to a supported {Metasploit::Cache::Module::Architecture architect... | ruby | chosen |
[
{
"from": "system",
"value": "Hide empty FeedbackFormResponse records, show more\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\nclass FeedbackFormResponsesController < ApplicationController\n def new\n @subject = request.referrer || params['referrer']\n @feedback_form_r... | ruby | chosen |
[
{
"from": "system",
"value": "Update status code handling for compatibility with Rack 2.1\n\nThis commit in [Rack 2.1](https://github.com/rack/rack/commit/e6bdee4c16310e078093c0282f2f5449fdd130cd) has it validating status code symbols instead of defaulting to a 500 error on any unknown status."
},
{
... | ruby | chosen |
[
{
"from": "human",
"value": "Drop source_event_id. Rationalize Competition to Event associations. Pull duplicate overall competition code into Overall.\n"
},
{
"from": "gpt",
"value": "class DropEventsSourceEventId < ActiveRecord::Migration\n def self.up\n execute \"alter table events drop f... | ruby | chosen |
[
{
"from": "system",
"value": "Remove dependency on class ApplicationRecord from app folder\n"
},
{
"from": "human",
"value": "class StiConfigurationScript < ActiveRecord::Migration[5.0]\n class ConfigurationScript < ApplicationRecord\n self.inheritance_column = :_type_disabled\n end\n\n de... | ruby | chosen |
[
{
"from": "human",
"value": "Update user_id primary and foreign keys to bigint\n"
},
{
"from": "gpt",
"value": "class ChangeUserIdToBigint < ActiveRecord::Migration[6.0]\n def up\n change_column :users, :id, :bigint\n\n change_column :admin_exports, :user_id, :bigint\n change_column :a... | ruby | chosen |
[
{
"from": "system",
"value": "Include deleted questions and options for instrument version\n"
},
{
"from": "human",
"value": "class InstrumentVersion\n attr_accessor :instrument, :version\n\n def method_missing(method, *args, &block)\n if Instrument.method_defined?(method) \n if @versi... | ruby | chosen |
[
{
"from": "system",
"value": "Add delayed_job start on boot script\n"
},
{
"from": "human",
"value": "if Rails.env.test? || Rails.env.development?\n Delayed::Worker.delay_jobs = false\nelse\n Delayed::Worker.delay_jobs = true\nend\nDelayed::Worker.destroy_failed_jobs = false\nDelayed::Worker.s... | ruby | chosen |
[
{
"from": "system",
"value": "Use a better date format for humans\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nmodule TimeHelper\n def time_ago_in_words(time)\n content_tag(:time, datetime: time.to_s(:db), title: time) do\n t('time_ago_in_words', time: distance_of... | ruby | chosen |
[
{
"from": "system",
"value": "Allow special_routes to be substitutable.\n"
},
{
"from": "human",
"value": "module SubstitutionHelper\n class << self\n def clear!(\n new_item_document_type:,\n new_item_content_id:,\n base_path:,\n locale:,\n state:,\n downstream:... | ruby | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.