conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Return nil when the resulting value is missing.\n"
},
{
"from": "human",
"value": "module SAAL\n class Connection\n DEFAULT_HOST = \"localhost\"\n DEFAULT_PORT = 4500\n \n def initialize(opts={})\n @port = opts[:port] || DEFAULT_PORT\n @host =... | ruby | chosen |
[
{
"from": "system",
"value": "Fix require order (thank @spaceghost for finding this)\n"
},
{
"from": "human",
"value": "module Decorators\n require 'decorators/paths'\n require 'decorators/railtie'\n\n class << self\n def load!(cache_classes)\n decorators.each do |decorator|\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Resolve Ruby warning in spec for Rackstash::Encoders::Logstash\n\nThis resolves the following warning:\n\n> spec/rackstash/encoders/logstash_spec.rb:18: warning: ambiguous first\n> argument; put parentheses or a space even after `/' operator\n"
},
{
"from": "human",
... | ruby | chosen |
[
{
"from": "system",
"value": "Document with spec requirement of per_page method\n"
},
{
"from": "human",
"value": "require_relative '../../spec_helper_active_record'\n\nmodule SearchObject\n module Plugin\n describe Paging do\n def search_class\n Class.new do\n include S... | ruby | chosen |
[
{
"from": "system",
"value": "Set the timezone to CST\n"
},
{
"from": "human",
"value": "require File.expand_path('../boot', __FILE__)\n\n# Pick the frameworks you want:\nrequire \"active_model/railtie\"\nrequire \"active_record/railtie\"\nrequire \"action_controller/railtie\"\nrequire \"action_... | ruby | chosen |
[
{
"from": "system",
"value": "Add libs to the load path\n\n"
},
{
"from": "human",
"value": "require_relative 'boot'\n\nrequire 'rails/all'\n\n# Require the gems listed in Gemfile, including any gems\n# you've limited to :test, :development, or :production.\nBundler.require(*Rails.groups)\n\nmod... | ruby | chosen |
[
{
"from": "system",
"value": "Use RbConfig instead of obsolete and deprecated Config (7, 17 May 2013)\n"
},
{
"from": "human",
"value": "require 'rbconfig'\n\nCONFIG = Config::MAKEFILE_CONFIG\n\n\ncase ARGV[0]\nwhen \"archdir\"\n puts Config::expand(CONFIG[\"archdir\"])\nwhen \"lib\"\n put... | ruby | chosen |
[
{
"from": "human",
"value": "Define intializer to set RakutenWebService configuration.\n"
},
{
"from": "gpt",
"value": "RakutenWebService.configuration do |c|\n c.application_id = ENV['RWS_APPLICATION_ID']\n c.affiliate_id = ENV['RWS_AFFILIATE_ID']\nend\n"
}
] | ruby | chosen |
[
{
"from": "system",
"value": "Remove require zenvia base from Sms class\n"
},
{
"from": "human",
"value": "require './zenvia/base'\n\nmodule Zenvia\n class Sms\n include Base\n\n attr_accessor :msg, :cel_phone\n\n def initialize(msg, cel_phone)\n @msg = msg\n @cel_phone... | ruby | chosen |
[
{
"from": "system",
"value": "Add edit page spec and sleep for race condition.\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\nfeature \"Event streaming\", js: true do\n let!(:author) { FactoryGirl.create :user }\n let!(:paper) { author.papers.create! short_title: 'foo bar', journa... | ruby | chosen |
[
{
"from": "system",
"value": "Change to fix perf spec\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nRSpec.describe FiniteMachine, perf: true do\n include RSpec::Benchmark::Matchers\n\n class Measurement\n attr_reader :steps, :loops\n\n def initialize\n @steps =... | ruby | chosen |
[
{
"from": "system",
"value": "Move VERSION to Sensu::Plugin, not Sensu::Plugins\n"
},
{
"from": "human",
"value": "require File.expand_path(File.dirname(__FILE__)) + '/lib/sensu/plugins'\n\nGem::Specification.new do |s|\n s.name = 'sensu-plugins'\n s.version = Sensu::Plugins::VE... | ruby | chosen |
[
{
"from": "human",
"value": "Add arithmetic operations - 0 failures\n"
},
{
"from": "gpt",
"value": "# Solution Below\n\n# RSpec Tests. They are included in this file because the local variables you are creating are not accessible across files. If we try to run these files as a separate file per... | ruby | chosen |
[
{
"from": "system",
"value": "Add json crud routes to wants controller\n"
},
{
"from": "human",
"value": "class WantsController < ApplicationController\n def index\n end\n\n def show\n end\n\n def new\n end\n\n def create\n end\n\n def edit\n end\n\n def update\n end\n\n def destroy... | ruby | chosen |
[
{
"from": "system",
"value": "Switch to new official project repo"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"matrioska/version\"\n\nGem::Specification.new do |s|\n s.name = \"matrioska\"\n s.version = Matrios... | ruby | chosen |
[
{
"from": "system",
"value": "Upgrade ruby rake dependency (security).\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'net-http2/version'\n\nGem::Specification.new do |spec|\n spec.... | ruby | chosen |
[
{
"from": "system",
"value": "Support both new and old mapping API\n"
},
{
"from": "human",
"value": "require 'devise/strategies/base'\n\nmodule Devise\n module Strategies\n class CasAuthenticatable < Base\n def valid?\n mapping.to.respond_to?(:authenticate_with_cas_ticket)\n ... | ruby | chosen |
[
{
"from": "human",
"value": "Add create districts migration file\n"
},
{
"from": "gpt",
"value": "class CreateDistricts < ActiveRecord::Migration\n def change\n create_table :districts do |t|\n t.string :name\n t.string :borough\n t.string :superintendent\n\n t.timestamps... | ruby | chosen |
[
{
"from": "system",
"value": "Fix homepage to use SSL in OmniOutliner Cask\n\nThe HTTP URL is already getting redirected to HTTPS. Using the HTTPS URL directly\nmakes it more secure and saves a HTTP round-trip.\n"
},
{
"from": "human",
"value": "cask :v1 => 'omnioutliner' do\n version '4.2.3'\n... | ruby | chosen |
[
{
"from": "system",
"value": "Add 2 examples for new method interval_class\n"
},
{
"from": "human",
"value": "require 'interval'\n\ndescribe Interval do\n \n it \"simple diatonic interval do-mi should be a 3rd\" do\n i = Interval.new('do', 'mi', 0)\n i.diatonic_interval.should == 3\n en... | ruby | chosen |
[
{
"from": "system",
"value": "Add test for new resource sig\n"
},
{
"from": "human",
"value": "require 'yutani'\n\ndescribe Yutani::Resource do\n before do \n Yutani::Hiera.hiera('hiera_config_file' => 'spec/hiera.yaml')\n\n @stack = Yutani.stack(:s1) {\n scope(:rnameA) {\n re... | ruby | chosen |
[
{
"from": "system",
"value": "Revise the sector_preview serializer output\n"
},
{
"from": "human",
"value": "class SectorPreviewSerializer < ActiveModel::Serializer\n cache key: \"main_api_sector_preview\", expires_in: 3.hours\n attributes :type, :id, :name\n def type\n 'sectors'\n end\ne... | ruby | chosen |
[
{
"from": "system",
"value": "Use the new dummy provider (which happens by default on chefspec)."
},
{
"from": "human",
"value": "#\n# Copyright 2015, Noah Kantrowitz\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with th... | ruby | chosen |
[
{
"from": "system",
"value": "Test how Source Locator deals with non-existent files\n"
},
{
"from": "human",
"value": "require \"test_helper\"\nrequire \"rubycritic/source_locator\"\n\ndescribe Rubycritic::SourceLocator do\n before do\n @original_dir = Dir.pwd\n Dir.chdir(\"test/samples/l... | ruby | chosen |
[
{
"from": "system",
"value": "Install pip module \"nose\" to simplify Tests\n"
},
{
"from": "human",
"value": "[\n \"build-essential\",\n \"git-core\",\n \"vim\",\n \"python\",\n \"python-pip\",\n].each do |p|\n package p\nend\n"
},
{
"from": "gpt",
"value": "[\n \"build-essen... | ruby | chosen |
[
{
"from": "system",
"value": "Add restrictions for non-logged in users\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_forgery with... | ruby | chosen |
[
{
"from": "system",
"value": "Add support for Extensions to define Transformers\n\nA Extension can register it's own Transformers without involving the user.\n\ne.g. The extension need to change the rendered output based on internal state.\n\n'''ruby\nclass MyExtension\n\n def execute(site)\n # do.stuff... | ruby | chosen |
[
{
"from": "system",
"value": "Use path instead of URL for the action on form.\n"
},
{
"from": "human",
"value": "module SimpleFormRansackHelper\n def simple_search_form_for(resource, params, *args)\n if args.last.is_a?(Hash)\n opts = args.pop\n else\n opts = {}\n end\n \n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add docs for better usability\n"
},
{
"from": "human",
"value": "module Lazy\n module Attribute\n module ClassMethods\n def lazy_attribute(attribute, options = {})\n default_options = { raise_error: false, key: [], create_if_not_found: false }\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Use change_file_mode and change_file_owner instead of calling\nrun_command directly\n"
},
{
"from": "human",
"value": "require 'lightchef'\n\nmodule Lightchef\n module Resources\n class Directory < Base\n define_option :action, default: :create\n defin... | ruby | chosen |
[
{
"from": "system",
"value": "Add option parameter to `cache_all`\n"
},
{
"from": "human",
"value": "require 'redis_cacheable'\n\n# Specialized for ActiveRecord\nmodule RedisCacheable\n module ActiveRecord\n extend ActiveSupport::Concern\n include ::RedisCacheable\n\n module ClassMetho... | ruby | chosen |
[
{
"from": "human",
"value": "Add a client adapter that handles request construction.\n"
},
{
"from": "gpt",
"value": "module Smartsheet\n module API\n class RequestClient\n def initialize(token, client)\n @token = token\n @client = client\n end\n\n def make_reque... | ruby | chosen |
[
{
"from": "system",
"value": "Fix \"no implicit conversion\" error\n\nI was getting a \"no implicit conversion of Integer into String\" error on\nthis line; adding this to_s fixed it\n"
},
{
"from": "human",
"value": "require 'uri'\n\nmodule Spectrum\n module Config\n class Z3988Literal\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix resolution of Kramdown class\n"
},
{
"from": "human",
"value": "# encoding: UTF-8\n\nmodule Spontaneous::Model::Box\n module Comment\n extend Spontaneous::Concern\n\n module ClassMethods\n def comment(comment_text)\n @comment ||= comment_text\... | ruby | chosen |
[
{
"from": "system",
"value": "Remove Rails 5 deprecation on reloading the settings_changes.\n"
},
{
"from": "human",
"value": "module Vmdb\n class Settings\n class DatabaseSource\n include Vmdb::Logging\n\n attr_reader :resource\n\n def initialize(resource)\n @resource ... | ruby | chosen |
[
{
"from": "system",
"value": "Add + method to Class\n"
},
{
"from": "human",
"value": "module Analyzer\n # Represents a class in the project\n class Class\n attr_reader :name, :methods\n attr_accessor :lines, :complexity, :dependencies\n\n include Comparable\n\n def ==(other)\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add introspection method for filtering violations by type\n"
},
{
"from": "human",
"value": "require 'standalone_validator/validation_result_builder'\nrequire 'hamster/list'\n\nclass StandaloneValidator\n class ValidationResult\n def self.build_for(object, &bloc... | ruby | chosen |
[
{
"from": "system",
"value": "Use precise-specific hhvm package on precise\n\neven though .... does this even work??\n"
},
{
"from": "human",
"value": "default[\"hhvm\"][\"package\"][\"name\"] = \"hhvm\"\ndefault[\"hhvm\"][\"package\"][\"version\"] = \"3.6.1\"\n\ndefault[\"hhvm\"][\"package\"][\... | ruby | chosen |
[
{
"from": "system",
"value": "JariBakken: Make sure we properly zip binary files on Windows.\n\nr11358\n"
},
{
"from": "human",
"value": "require 'zip/zip'\nrequire 'tempfile'\nrequire 'find'\n\nmodule Selenium\n module WebDriver\n module Zipper\n\n EXTENSIONS = %w[.zip .xpi]\n\n d... | ruby | chosen |
[
{
"from": "system",
"value": "Put initialize method at top of class\n\nBy convention, this is where people expect to see this.\n"
},
{
"from": "human",
"value": "# Copyright 2014 Greg Hurrell. All rights reserved.\n# Licensed under the terms of the BSD 2-clause license.\n\nrequire 'command-t/ext... | ruby | chosen |
[
{
"from": "system",
"value": "Fix DB issue for postgres\n"
},
{
"from": "human",
"value": "class CreateUsers < ActiveRecord::Migration\n def change\n create_table :users do |t|\n t.string :provider\n t.string :uid\n t.string :name\n\n t.timestamps\n end\n end\nend\n"
... | ruby | chosen |
[
{
"from": "system",
"value": "Remove deprecated `test_files` from gemspec\n"
},
{
"from": "human",
"value": "$:.unshift File.join(File.dirname(__FILE__), 'lib')\n\nrequire 'regexp_parser/version'\n\nGem::Specification.new do |gem|\n gem.name = 'regexp_parser'\n gem.version = ::R... | ruby | chosen |
[
{
"from": "system",
"value": "Add uniqueness index to Users table\n"
},
{
"from": "human",
"value": "class CreateUsers < ActiveRecord::Migration\n def change\n create_table :users do |t|\n t.string :username, null: false\n t.string :email, null: false\n t.string :hashed_passwo... | ruby | chosen |
[
{
"from": "system",
"value": "Extend acceptance tests for enforcing to disabled mode\n\nUnfortunatly some people really disable selinux.\n"
},
{
"from": "human",
"value": "require 'spec_helper_acceptance'\n\ndescribe 'selinux class disabled' do\n let(:pp) do\n <<-EOS\n class { 'selinux'... | ruby | chosen |
[
{
"from": "system",
"value": "Allow feature descriptions to be blank\n"
},
{
"from": "human",
"value": "class CreateFeatures < ActiveRecord::Migration\n def change\n create_table :features do |t|\n t.integer :page_id, :null => false, :on_delete => :cascade\n t.integer :... | ruby | chosen |
[
{
"from": "system",
"value": "Update dev server name to monsoon. OPS-1250.\n"
},
{
"from": "human",
"value": "# The hosts where are are deploying \nrole :app, \"flood.amee.com\"\nrole :db, \"flood.amee.com\", :primary => true\n\nset :application, \"platform-api-dev\"\nset :deploy_to, \"/var/www... | ruby | chosen |
[
{
"from": "system",
"value": "Update the websocket dependency to 1.1.2\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'pusher-client/version'\n\nGem::Specification.new do |... | ruby | chosen |
[
{
"from": "system",
"value": "Reorganize sign in page test\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe \"Authentication\" do\n\n subject { page }\n\n describe \"signin page\" do\n before { visit signin_path }\n let(:submit) { \"Sign in\" }\n\n it { should have... | ruby | chosen |
[
{
"from": "system",
"value": "Fix InactiveDraftWorker to RSpec 3\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe InactiveDraftWorker do\n\n before do\n Sidekiq::Testing.inline!\n end\n\n context \"when project is in draft\" do\n\n let!(:project) do\n build(:pro... | ruby | chosen |
[
{
"from": "system",
"value": "Update minimum ruby version in gemspec to 1.9.1\n"
},
{
"from": "human",
"value": "$:.unshift File.join(File.dirname(__FILE__), 'lib')\n\nrequire 'regexp_parser/version'\n\nGem::Specification.new do |gem|\n gem.name = 'regexp_parser'\n gem.version =... | ruby | chosen |
[
{
"from": "human",
"value": "Add test for installing Gem\n"
},
{
"from": "gpt",
"value": "require \"spec_helper\"\nrequire \"tmpdir\"\n\nRSpec.describe \"Installing the Gem\" do\n describe \"Using generator\" do\n specify do\n rails_dir = Dir.mktmpdir\n\n %x{rails new #{rails_dir}}... | ruby | chosen |
[
{
"from": "system",
"value": "Add a couple of missing association expectations\n"
},
{
"from": "human",
"value": "require \"spec_helper\"\n\nRSpec.describe CellVolume do\n it {\n is_expected.to have_many(:object_backups).conditions(is_backup: true)\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Change gitlab cookbook license to Apache 2.0\n"
},
{
"from": "human",
"value": "maintainer \"GitLab.com\"\nmaintainer_email \"support@gitlab.com\"\nlicense \"MIT\"\ndescription \"Install and configure GitLab from Omnibus\"\nlong_description \"Install and configure G... | ruby | chosen |
[
{
"from": "human",
"value": "Add feature spec for opt-in/opt-out\n"
},
{
"from": "gpt",
"value": "# frozen_string_literal: true\n\nrequire 'rails_helper'\n\ndescribe 'email links for Fall 2017 CMU experiment', type: :feature do\n let(:email_code) { 'abcdefgabcdefg' }\n let(:course) do\n cre... | ruby | chosen |
[
{
"from": "system",
"value": "Update Redis documentation (up to 3.2.2)\n"
},
{
"from": "human",
"value": "module Docs\n class Redis < UrlScraper\n self.type = 'redis'\n self.release = 'up to 3.2.1'\n self.base_url = 'http://redis.io/commands'\n self.links = {\n home: 'http://re... | ruby | chosen |
[
{
"from": "system",
"value": "Enable timeout, streaming api sends keepalives"
},
{
"from": "human",
"value": "class FlowdockConnection\n def initialize(irc_connection)\n @source = nil\n @on_message_block = nil\n @irc_connection = irc_connection\n @errors = []\n end\n\n def message... | ruby | chosen |
[
{
"from": "system",
"value": "Remove movement_type from usermovement controller\n"
},
{
"from": "human",
"value": "class UsermovementsController < ApplicationController\n\n\tdef index\n\t\t@movements = Usermovement.all\n\t\t@user = current_user\n\tend\n\n\tdef new\n\t\t@movement = Usermovement.n... | ruby | chosen |
[
{
"from": "system",
"value": "Call Appsignal.stop after DJ loop stops\n"
},
{
"from": "human",
"value": "if defined?(::Delayed::Plugin)\n Appsignal.logger.info('Loading Delayed Job integration')\n\n module Appsignal\n module Integrations\n class DelayedPlugin < ::Delayed::Plugin\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Drop results if empty head or tail, use head and tail product in the result\n"
},
{
"from": "human",
"value": "module Phoneword\n class Converter\n def initialize(args={})\n @dictionary = Dictionary.new\n @phone = Phone.new(number: args[:phone])\n e... | ruby | chosen |
[
{
"from": "system",
"value": "Add type and time to Transaction\n\nAs can be seen on Raveline API here https://developer.ravelin.com/\\#post-/v2/transaction\n"
},
{
"from": "human",
"value": "module Ravelin\n class Transaction < RavelinObject\n attr_accessor :transaction_id,\n :email,\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Return true in Limiter shebang methods\n"
},
{
"from": "human",
"value": "module Ultima\n module Core\n class Limiter\n def initialize(limit_rate)\n @limit_rate = limit_rate\n reset!\n end\n\n def reset!\n @acted_at = nil\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Use a mutex rather than Thread.exclusive.\n\nI'm getting errors from the rack middleware cuke on 1.8 w/ the Thread.exclusive."
},
{
"from": "human",
"value": "module VCR\n module Middleware\n class Rack\n include Common\n\n def call(env)\n Threa... | ruby | chosen |
[
{
"from": "system",
"value": "Remove minute designation from shutdown\n\nWithout the minute unit it works on both osx and linux. OSX only with\nit.\n"
},
{
"from": "human",
"value": "# This is run on a Kochiku worker when the auto scaling algorithm wants to\n# shrink the number of workers.\n#\n#... | ruby | chosen |
[
{
"from": "system",
"value": "Update download url, but did not change shasum\n\nSigned-off-by: Koichi Shiraishi <41a18128582fec5418c0a92661f7d4b13d21d912@gmail.com>\n"
},
{
"from": "human",
"value": "cask :v1 => 'kensington-trackball-works' do\n version '1.2.1'\n sha256 '285511269aea2e0517198b... | ruby | chosen |
[
{
"from": "system",
"value": "Adjust blank line to improve coding style in a spec file\n"
},
{
"from": "human",
"value": "describe :array_index, :shared => true do\n it \"returns the index of the first element == to object\" do\n x = mock('3')\n def x.==(obj) 3 == obj; end\n\n [2, x, 3... | ruby | chosen |
[
{
"from": "system",
"value": "Add parens around eq argument\n"
},
{
"from": "human",
"value": "require 'everything'\nrequire './lib/everything/add_pathname_to_everything_refinement'\n\nclass RefinedContext\n using Everything::AddPathnameToEverythingRefinement\n\n def pathname\n Everything.p... | ruby | chosen |
[
{
"from": "system",
"value": "Replace Helper name with LoginProtection\n"
},
{
"from": "human",
"value": "require 'test_helper'\nrequire 'action_controller'\n\nclass HelpersController < ActionController::Base\n include ShopifyApp::LoginProtection\n helper_method :shop_session\n\n def index\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix for broken Padrino helpers in tests\n"
},
{
"from": "human",
"value": "# This test Padrino stack file was taken from the padrino-core gem.\n#\nPADRINO_ROOT = File.dirname(__FILE__) unless defined? PADRINO_ROOT\n# Remove this comment if you want do some like this... | ruby | chosen |
[
{
"from": "system",
"value": "Remove SPEC constant.\nAdd dev dependencies.\nAdd test files.\n"
},
{
"from": "human",
"value": "require 'date'\nrequire 'catissue/version'\n\nCaTissue::SPEC = Gem::Specification.new do |s|\n s.name = \"caruby-tissue\"\n s.summary = \"Ruby facade fo... | ruby | chosen |
[
{
"from": "system",
"value": "Performance/SelectMap: Use filter_map instead of select.map.\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\n# Customized authority to include marshaling behaviors\n#\n# The name is not perfect, but we have some work to do as far as migrating the... | ruby | chosen |
[
{
"from": "human",
"value": "Add script for cloning all of my repos\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env ruby\nrequire 'net/http'\nrequire 'json'\n\ninclude Process\n\ndef get_all_repos_from_user(username, protocol = 'ssh')\n repos = get_response(username)\n\n get_urls(repos, protoc... | ruby | chosen |
[
{
"from": "system",
"value": "Fix config for css in asset pipeline\n"
},
{
"from": "human",
"value": "require File.expand_path('../boot', __FILE__)\n\n# Pick the frameworks you want:\n# require \"active_record/railtie\"\nrequire \"action_controller/railtie\"\nrequire \"action_mailer/railtie\"\nr... | ruby | chosen |
[
{
"from": "system",
"value": "Add some WAIT for tests using replication\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nrequire_relative 'helper'\n\n# ruby -w -Itest test/cluster_client_replicas_test.rb\nclass TestClusterClientReplicas < Minitest::Test\n include Helper::Clus... | ruby | chosen |
[
{
"from": "system",
"value": "Move API key out of accessible files\n"
},
{
"from": "human",
"value": "# Set up gems listed in the Gemfile.\n# See: http://gembundler.com/bundler_setup.html\n# http://stackoverflow.com/questions/7243486/why-do-you-need-require-bundler-setup\nENV['BUNDLE_GEMFIL... | ruby | chosen |
[
{
"from": "system",
"value": "Test for legislator search by lat / long\n"
},
{
"from": "human",
"value": "require 'sunlight/congress'\nrequire 'webmock/minitest'\n\nclass TestIntegrationCongress < MiniTest::Unit::TestCase\n def setup\n Sunlight::Congress.api_key = \"thisismykey\"\n end\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix migration for upstream_user collapse\n"
},
{
"from": "human",
"value": "class CollapseRepoUpstreamUserIntoName < ActiveRecord::Migration\n class Repo < ActiveRecord::Base\n end\n\n def up\n say_with_time(\"Collapse Repo upstream_user into name\") do\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Patch MySQL's odd foreign key behavior.\n"
},
{
"from": "human",
"value": "class AddIndexesForUserActivityQueries < ActiveRecord::Migration\n include Gitlab::Database::MigrationHelpers\n\n DOWNTIME = false\n\n disable_ddl_transaction!\n\n def up\n add_concurr... | ruby | chosen |
[
{
"from": "human",
"value": "Update admin_team_member_id primary key to bigint\n"
},
{
"from": "gpt",
"value": "class ChangeAdminTeamMemberIdToBigint < ActiveRecord::Migration[6.0]\n def up\n change_column :admin_team_members, :id, :bigint\n end\n\n def down\n change_column :admin_team_... | ruby | chosen |
[
{
"from": "system",
"value": "Add an s to fix things\n"
},
{
"from": "human",
"value": "class ErrorController < ApplicationController\n skip_before_filter :authenticate_admin!\n \n def not_found\n render(:status => 404)\n end\n\n def server_error\n render(:status => 500)\n end\n\n d... | ruby | chosen |
[
{
"from": "system",
"value": "Include Store when editing Item\n"
},
{
"from": "human",
"value": "class ItemsController < ApplicationController\n def index\n end\n\n def show\n end\n\n def new\n @list = List.find_by(id: params[:list_id])\n @item = @list.items.build\n @store = Store.... | ruby | chosen |
[
{
"from": "system",
"value": "Print errors to the console log rather than using an alert\n\nThey're only useful for a developer debugging, who will know to look there.\nThey don't need to be shown to the end user.\n"
},
{
"from": "human",
"value": "class RacesController < ApplicationController\n... | ruby | chosen |
[
{
"from": "system",
"value": "Revert \"Do not load full build log when we builds are finalized\"\n\nThis reverts commit 6f8d5260a91a8bbc3e9c148b00ae65c65c0ba8aa.\n\nIt breaks some specs. I will wait for Sven to tell me what I may be\nmissing.\n"
},
{
"from": "human",
"value": "require 'travis'\n... | ruby | chosen |
[
{
"from": "system",
"value": "Expire cache when tour starts or stops.\n"
},
{
"from": "human",
"value": "class ToursController < ApplicationController\n\n # allow start/stop from a get request\n def show\n if params[:start]\n create\n elsif params[:stop]\n destroy\n else\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Save the changes on account\n"
},
{
"from": "human",
"value": "class UsersController < ApplicationController\n load_and_authorize_resource\n before_action :has_email_slug, except: :setup_account\n\n def show\n @emails = Email.where(account_id: @current_user.cu... | ruby | chosen |
[
{
"from": "system",
"value": "Fix error message on signup\n"
},
{
"from": "human",
"value": "class UsersController < ApplicationController\n\n before_action :logged_in_user, only: [:show, :edit, :update]\n before_action :correct_user, only: [:show, :edit, :update]\n\n def new\n @user = U... | ruby | chosen |
[
{
"from": "system",
"value": "Implement split text into words method\n\nI just implemented the split text into words method of the accessibility\nmetric and it seems to work as expected.\n\nSigned-off-by: Konrad Reiche <4ff0213f56e2082fcd8c882d04c546881c579ce4@gmail.com>\n"
},
{
"from": "human",
... | ruby | chosen |
[
{
"from": "system",
"value": "Remove titanium reference from env template\n"
},
{
"from": "human",
"value": "# Bootstrap the Bowline environment, frameworks, and default configuration\nrequire File.join(File.dirname(__FILE__), 'boot')\n\nBowline::Initializer.run do |config|\n config.name ... | ruby | chosen |
[
{
"from": "human",
"value": "Add benchmark schedule feature specs\n"
},
{
"from": "gpt",
"value": "# frozen_string_literal: true\n\nrequire 'rails_helper'\n\nfeature 'Benchmark schedule' do\n given(:user) { create(:user) }\n before { sign_in(user) }\n\n feature 'listing schedules' do\n giv... | ruby | chosen |
[
{
"from": "human",
"value": "Add specs for content commands.\n"
},
{
"from": "gpt",
"value": "# encoding: utf-8\n\nrequire 'spec_helper'\n\ndescribe GithubCLI::Commands::Contents do\n let(:format) { 'table' }\n let(:user) { 'peter-murach' }\n let(:repo) { 'github_cli' }\n let(:path) { ... | ruby | chosen |
[
{
"from": "system",
"value": "Update the tests to check for close! call."
},
{
"from": "human",
"value": "require 'spec_helper'\nrequire 'nerve/reporter/zookeeper'\n\ndescribe Nerve::Reporter::Zookeeper do\n let(:subject) { {\n 'zk_hosts' => ['zkhost1', 'zkhost2'],\n 'zk_path' => 'zk_... | ruby | chosen |
[
{
"from": "system",
"value": "Fix S3 direct upload test\n"
},
{
"from": "human",
"value": "require \"service/shared_service_tests\"\nrequire \"httparty\"\nrequire \"uri\"\n\nif SERVICE_CONFIGURATIONS[:s3]\n class ActiveStorage::Service::S3ServiceTest < ActiveSupport::TestCase\n SERVICE = Act... | ruby | chosen |
[
{
"from": "system",
"value": "Fix line breaks in generated routes.rb\n"
},
{
"from": "human",
"value": "require 'rails/generators/rails/scaffold/scaffold_generator'\nrequire File.join(File.dirname(__FILE__), 'base')\nrequire File.join(File.dirname(__FILE__), 'scaffold_controller/scaffold_control... | ruby | chosen |
[
{
"from": "system",
"value": "Read session token from the environment if set.\n"
},
{
"from": "human",
"value": "# Be sure to restart your server when you modify this file.\n\n# Your secret key for verifying the integrity of signed cookies.\n# If you change this key, all old signed cookies will ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix default repository not resetting\n"
},
{
"from": "human",
"value": "Dir[File.dirname(__FILE__) + '/repositories/**/*.rb'].each { |f| require f }\n\nmodule Beans\n class Registry\n attr_accessor :default\n\n def register(type, repo)\n repositories[typ... | ruby | chosen |
[
{
"from": "system",
"value": "Add python-{openstack,keystoneclient} packages to boostrap node\n\nFixes #793\n"
},
{
"from": "human",
"value": "#\n# Cookbook Name:: bcpc\n# Recipe:: bootstrap\n#\n# Copyright 2014, Bloomberg Finance L.P.\n#\n# Licensed under the Apache License, Version 2.0 (the \"... | ruby | chosen |
[
{
"from": "system",
"value": "Feature: Allow reference number length to be customizable\n\nPreviously all reference numbers were forced to be 32 hex characters. We had\na need for the exact functionality that referehencible provides, but for an\nattribute where we only wanted 8 characters.\n\nNow we can do... | ruby | chosen |
[
{
"from": "system",
"value": "Enable Transaction handling for plugins\n"
},
{
"from": "human",
"value": "require 'pathname'\n\nmodule Rohbau\n class Runtime\n def self.register(name, plugin_class)\n attr_reader name\n plugins[name] = plugin_class\n end\n\n def self.plugins\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Allow symbols in request query\n"
},
{
"from": "human",
"value": "require 'net/https'\n\nmodule Scrobbler\n module REST\n \tclass Connection\n \t\tdef initialize(base_url, args = {})\n \t\t\t@base_url = base_url\n \t\t\t@username = args[:username]\n \t\t\t@pas... | ruby | chosen |
[
{
"from": "system",
"value": "Update route registration to reflect new vhost\n\nThe frontend part of the app is currently listening on 2 vhosts -\ncontacts-frontend and contacts-frontend-old. Before long the former\nwill be reclaimed for the new frontend app, so the routes need to be\npointed at the latter... | ruby | chosen |
[
{
"from": "system",
"value": "Create test tmp dir if not exist\n"
},
{
"from": "human",
"value": "require 'test_helper'\n\n# Integration tests running the examples from /examples directory\nclass ExamplesTest < Minitest::Test\n def setup\n examples_directory = File.expand_path('../../example... | ruby | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.