conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Remove deprecation warning about use of all\n"
},
{
"from": "human",
"value": "class EmailsController < ApplicationController\n\n def index\n # Only show the most recent 10 for the time being\n @emails = Email.order(\"created_at DESC\").limit(10).all\n end\n... | ruby | chosen |
[
{
"from": "system",
"value": "Allow to use iptables rule templates from other cookbooks.\n"
},
{
"from": "human",
"value": "#\n# Cookbook Name:: iptables\n# Definition:: iptables_rule\n#\n# Copyright 2008-2009, Opscode, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");... | ruby | chosen |
[
{
"from": "system",
"value": "Update chef client to 12.14.89\n"
},
{
"from": "human",
"value": "# Add the opscode APT source for chef\ndefault[:apt][:sources] = node[:apt][:sources] | [\"opscode\"]\n\n# Set the default server version\ndefault[:chef][:server][:version] = \"12.0.8-1\"\n\n# Set the... | ruby | chosen |
[
{
"from": "system",
"value": "Expand the requirement path for test credentials\n"
},
{
"from": "human",
"value": "require 'yaml'\n\nbegin\n credentials = YAML.load_file(File.dirname(__FILE__) + '/../test_credentials.yml')\n GeoCerts.login = credentials['login']\n GeoCerts.api_tok... | ruby | chosen |
[
{
"from": "system",
"value": "Test file should be have data\n"
},
{
"from": "human",
"value": "require 'test_helper'\n\nclass TestToriBackendFileSystem < Test::Unit::TestCase\n setup do\n path = Pathname(\"test/tmp/tori/store\")\n @filesystem = Tori::Backend::FileSystem.new(path)\n end\n... | ruby | chosen |
[
{
"from": "system",
"value": "Change podspec version back to 1.0.0 since we didn't change any source file\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name \t\t= \"JMEParallaxView\"\n s.version \t\t= \"1.0.2\"\n s.author \t\t= { \"Jo-Yuan Hsieh\" ... | ruby | chosen |
[
{
"from": "human",
"value": "[html] Add minimal HTML controller as parent of all HTML related controllers.\n"
},
{
"from": "gpt",
"value": "require 'app/controllers/app_controller'\n\nmodule Pod\n module TrunkApp\n # Parent controller for all HTML serving controllers.\n #\n class HTMLC... | ruby | chosen |
[
{
"from": "system",
"value": "Use publishable (as well as listable) scope for notes shown in tags pages.\n"
},
{
"from": "human",
"value": "class TagsController < ApplicationController\n\n add_breadcrumb I18n.t('tags.title'), :tags_path\n\n def index\n\n # Do these need to be different?\n\n... | ruby | chosen |
[
{
"from": "system",
"value": "Use model_name to get class name instead of type testing\n"
},
{
"from": "human",
"value": "module ContentViewHelper\n def full_title_for(content)\n \"#{t(content_type_number(content), number: content.number)}: #{content.name}\"\n end\n\n def short_title_for(c... | ruby | chosen |
[
{
"from": "system",
"value": "Add garlic:prepare_without_check for running in offline mode\n"
},
{
"from": "human",
"value": "$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__)))\nrequire \"garlic\"\n\ndef garlic(&block)\n @garlic ||= Garlic::Garlic.new(self)\n @garlic.configure(&block... | ruby | chosen |
[
{
"from": "system",
"value": "Fix openssl gem version check to support versons greater than 3\n"
},
{
"from": "human",
"value": "module JWT\n module Algos\n module Ps\n # RSASSA-PSS signing algorithms\n\n module_function\n\n SUPPORTED = %w[PS256 PS384 PS512].freeze\n\n de... | ruby | chosen |
[
{
"from": "system",
"value": "Raise better error message when requests fail\n\n* Include the body of the response in the error\n"
},
{
"from": "human",
"value": "require \"ostruct\"\n\nmodule Namely\n class Model < OpenStruct\n def initialize(resource_gateway, attributes)\n @resource_ga... | ruby | chosen |
[
{
"from": "system",
"value": "Add specs to assert mongodb is disabled and not running\n"
},
{
"from": "human",
"value": "describe 'mongodb installation' do\n describe command('mongo --version') do\n its(:exit_status) { should eq 0 }\n its(:stdout) { should match(/MongoDB shell/) }\n end\... | ruby | chosen |
[
{
"from": "system",
"value": "Add full Upstart::DBus usage example.\n"
},
{
"from": "human",
"value": "require 'dbus'\nrequire 'upstart/dbus/service'\n\nmodule Upstart\n # Provides access to the system DBus instance.\n class DBus\n def initialize\n @bus = ::DBus::SystemBus.instance\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Extend not only path but also url\n"
},
{
"from": "human",
"value": "require \"open-uri\"\n\nmodule Yomou\n module Helper\n\n def quarter_periods\n d = Date.new(2013, 5, 1)\n periods = []\n while d < Date.today\n periods << d\n d = d... | ruby | chosen |
[
{
"from": "system",
"value": "Fix Source has_many relationship with Attachment\n\nHave a deletion of a Source record cause a deletion of the corresponding\nAttachment record.\n"
},
{
"from": "human",
"value": "class Source < ActiveRecord::Base\n belongs_to :source_set\n has_many :attachments\n... | ruby | chosen |
[
{
"from": "human",
"value": "Add code wars (7) - how green is my valley\n"
},
{
"from": "gpt",
"value": "# http://www.codewars.com/kata/56e3cd1d93c3d940e50006a4/\n# --- iteration 1 ---\ndef make_valley(arr)\n arr = arr.sort.reverse\n left, right = [], []\n arr.each_slice(2).each do |el|\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Update new test to use test_helper\n"
},
{
"from": "human",
"value": "require 'test/unit'\nrequire File.dirname(__FILE__) + '/../lib/json-schema'\n\nclass RelativeDefinitionTest < Test::Unit::TestCase\n\n def test_definition_schema\n schema = File.join(File.dirn... | ruby | chosen |
[
{
"from": "system",
"value": "Change pod version to 1.1\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name = 'Framer'\n s.version = '1.0'\n s.summary = 'Comfortable syntax for working with frames'\n s.description = <<-DESC\nFramer is a good fr... | ruby | chosen |
[
{
"from": "system",
"value": "Update Elm Platform to 0.13\n"
},
{
"from": "human",
"value": "class ElmPlatform < Cask\n version '0.12.3'\n sha256 '155569928a868095b2b27e705f2904496918f28fcb59990ff4449ca4aace330f'\n\n url 'https://dl.dropboxusercontent.com/s/qfz9n90jszcxa5q/Elm-Platform-0.12.3... | ruby | chosen |
[
{
"from": "system",
"value": "Update Appboy::REST::ScheduleMessages to include schedule_id\n"
},
{
"from": "human",
"value": "module Appboy\n module REST\n class ScheduleMessages < Base\n attr_reader :app_group_id, :send_at, :messages, :segment_id, :local_timezone, :external_user_ids, :... | ruby | chosen |
[
{
"from": "human",
"value": "Add migration guide for new ID format.\n"
},
{
"from": "gpt",
"value": "# This script migrates the authpwn 0.20 token codes and user IDs to the new\n# 0.21 format.\n# It should be run in a rails console.\n\nUser.all.each do |user|\n user.exuid = nil\n user.set_defa... | ruby | chosen |
[
{
"from": "system",
"value": "Remove active model tracking for unpersisted attributes\n"
},
{
"from": "human",
"value": "module Locomotive\n module API\n module Forms\n\n class MembershipForm < BaseForm\n attrs :account_id, :role, :account_email\n\n attr_accessor :site\n\n... | ruby | chosen |
[
{
"from": "system",
"value": "Update RebuildViaHook to use :hook trigger\n"
},
{
"from": "human",
"value": "require 'inch_ci/action'\n\nmodule Action\n module Project\n class RebuildViaHook\n include InchCI::Action\n\n exposes :result\n\n def initialize(params)\n if par... | ruby | chosen |
[
{
"from": "system",
"value": "Add Font group in TextContour group\n"
},
{
"from": "human",
"value": "require 'xcodeproj'\n\n# Lato-BoldItalic.ttf\n\nprojectPath = 'TextContour.xcodeproj'\nproject = Xcodeproj::Project.open(projectPath)\ntarget = project.targets.first\n\nfontGroup = project.new_gr... | ruby | chosen |
[
{
"from": "system",
"value": "Create Record class with file columns as attributes\n"
},
{
"from": "human",
"value": "def process(document)\n\tresult = []\n\tfile = document\n\tcolumns = []\n\tFile.readlines(file).each do |line|\n\t\trecords = line.split(' ')\t\t\n\t\tyear = records[6]\n\t\tp yea... | ruby | chosen |
[
{
"from": "system",
"value": "Add support for UNION DISTINCT for Rails prior to 4.2\n"
},
{
"from": "human",
"value": "require 'arel/visitors/to_sql'\n\nmodule Arel\n module Nodes\n class PostgresArray < Node\n include AliasPredication\n attr_accessor :values\n\n def initializ... | ruby | chosen |
[
{
"from": "system",
"value": "Remove dependency on environment rake task\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nnamespace :coverband do\n Coverband.configure\n\n ###\n # NOTE: If your project has set many simplecov filters.\n # You might want to override them and... | ruby | chosen |
[
{
"from": "system",
"value": "Add error handling for timeouts, server errors.\n"
},
{
"from": "human",
"value": "module LighthouseCLI\n class Parser\n class << self\n include Helpers\n include Commands\n \n def parse_argv!\n (help; return) if ARGV.blank?\n \n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add parameter to execute method in SQLiteDataStore, allowing for the passing of parameters without embedding within the query string.\n"
},
{
"from": "human",
"value": "require 'sqlite3'\n\nmodule AIBot::Store\n class SQLiteDataStore\n attr_reader :store\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Make rademade_admin get along with md files\n\nangular-rails-templates [registers][1] in sprockets\nany template engine it can from the list:\nerb haml liquid md radius slim str textile wiki.\napitome comes with template engine for md files.\nIt must be poorly written, since sp... | ruby | chosen |
[
{
"from": "system",
"value": "Make migrations available for to application's rake db:migrate\n"
},
{
"from": "human",
"value": "module RailsApiAuth\n\n class Engine < ::Rails::Engine\n\n config.generators do |g|\n g.test_framework :rspec\n end\n\n end\n\nend\n"
},
{
"from": ... | ruby | chosen |
[
{
"from": "human",
"value": "Add impor task runner Rake file\n"
},
{
"from": "gpt",
"value": "namespace :hmrc_contacts do\n desc \"Import contact data from CSV file\"\n task import: :environment do\n raise ArgumentError.new(\"Please provide contact file path using environment variable DATA_... | ruby | chosen |
[
{
"from": "system",
"value": "Replace ugly regex with POSIX class\n\n`[[:space:]]` works like `\\s` in regexes, except it is encoding aware."
},
{
"from": "human",
"value": "# encoding: UTF-8\n\nmodule Capybara\n module Helpers\n class << self\n ##\n #\n # Normalizes whitespac... | ruby | chosen |
[
{
"from": "system",
"value": "Use the manifest to replace the most recent files\n"
},
{
"from": "human",
"value": "require 'fileutils'\n\ndesc 'Compile all the assets named in config.assets.precompile with and without appended digests'\ntask 'assets:precompile' do\n digest = /\\-[0-9a-f]{32}\\.... | ruby | chosen |
[
{
"from": "system",
"value": "Gemspec: Update rspec and rake dependencies, add Keith Bennett as author and set as maintainer.\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire... | ruby | chosen |
[
{
"from": "system",
"value": "Make sure $PORT is always overwritten\n"
},
{
"from": "human",
"value": "require 'yaml'\n\nclass Divide::Extractor\n def initialize(options=[])\n @procfile_content = File.read('./Procfile') rescue ''\n splitted_procfile = @procfile_content.split(/\\s/)\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Drop red herrings from test\n"
},
{
"from": "human",
"value": "require 'rails_helper'\n\ndescribe \"Recipe\" do\n specify \"I can search for a recipe by its ingredients\" do\n tofu = Ingredient.create(name: \"Tofu\")\n pb = Ingredient.create(name: \"Peanut Bu... | ruby | chosen |
[
{
"from": "system",
"value": "Fix residual mistake in stats percentages\n\nSometimes we had \"rounding errors\" where the percentages for the grades did\nnot add up to 100 but to 99 or 98. This patch fixes that.\n"
},
{
"from": "human",
"value": "module InchCI\n class GradeListCollection\n i... | ruby | chosen |
[
{
"from": "system",
"value": "Make content and relation types unlistable\n"
},
{
"from": "human",
"value": "module Pakyow::Console::DataTypeRegistry\n UNLISTABLE_TYPES = [:text, :file, :media, :html]\n\n def self.names\n datatypes.keys\n end\n\n def self.types\n datatypes.values\n end... | ruby | chosen |
[
{
"from": "system",
"value": "Rename variable t to name.\n"
},
{
"from": "human",
"value": "require \"git\"\nrequire \"optparse\"\nrequire \"ostruct\"\n\nmodule Nutrella\n #\n # Knows the command line options.\n #\n class Options\n def initialize(args)\n @args = args\n @options ... | ruby | chosen |
[
{
"from": "system",
"value": "Include only real test files in gemspec\n"
},
{
"from": "human",
"value": "require 'bundler'\n\nrequire File.expand_path(File.dirname(__FILE__) + '/lib/silo/version')\n\nGem::Specification.new do |s|\n s.name = \"silo\"\n s.version = Silo::VERSION\n s.... | ruby | chosen |
[
{
"from": "human",
"value": "Add codility training 8-1 dominator\n"
},
{
"from": "gpt",
"value": "def solution(arr)\n stack = []\n arr.each do |i|\n stack.unshift(i)\n stack.shift(2) if stack.size > 1 && stack[0] != stack[1]\n end\n\n candidate = stack.shift\n\n if candidate\n coun... | ruby | chosen |
[
{
"from": "system",
"value": "Use default location for configuration file\n"
},
{
"from": "human",
"value": "module SemiAuto\n class Runner\n TASKS = { up: 'up', down: 'down' }\n\n def initialize(options = {})\n @configuration = SemiAuto::Configuration.new(options)\n @task = opt... | ruby | chosen |
[
{
"from": "human",
"value": "Add rake task for faster testing of pdf report\n"
},
{
"from": "gpt",
"value": "namespace :test_pdf do\n desc 'Generate and open a PDF for the last finished response'\n task generate: :environment do\n filename = File.join(Rails.root, 'tmp', 'test.pdf')\n uui... | ruby | chosen |
[
{
"from": "system",
"value": "Add a few notes regarding identifier blues\n"
},
{
"from": "human",
"value": "module UWDC\n class DublinCore < Mets\n def nodes\n @xml.nodes.xpath(\"//dmdSec//dc\")\n end\n \n def titles\n nodes.inject({}) do |result, children|\n result... | ruby | chosen |
[
{
"from": "system",
"value": "Clean up the mess by itself\n\n\ngit-svn-id: 28f34f9aa52bc55a5ddd5be9e183c5cccadc6ee4@13036 71c3de6d-444a-0410-be80-ed276b4c234a\n"
},
{
"from": "human",
"value": "#!/usr/bin/ruby\n\n# width of the band\n$u=20\n$uu=$u*2\n\ndef make(step,color)\n system \"convert -s... | ruby | chosen |
[
{
"from": "system",
"value": "Test behaviour of private images when logged in\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe 'uploaded images are private by default', :type => :feature do\n before(:each) do\n include UploadHelper\n @user = create(:user)\n login_as... | ruby | chosen |
[
{
"from": "human",
"value": "Test the CharactersGallery ordering code\n"
},
{
"from": "gpt",
"value": "require \"spec_helper\"\n\nRSpec.describe CharactersGallery do\n it \"should reset section_order fields in other galleries after deletion\" do\n character = create(:character)\n gallery ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix view spec to work properly on Ruby 1.9.\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe \"shared/_atom_header.atom.builder\" do\n before do\n stub_default_blog\n end\n\n describe \"with no items\" do\n before do\n @xml = ::Buil... | ruby | chosen |
[
{
"from": "system",
"value": "Change default inventory limit to 6 [SCI-2301]\n"
},
{
"from": "human",
"value": "Rails.application.configure do\n # Maximum number of repositories per team allowed\n config.x.repositories_limit =\n if ENV['REPOSITORIES_LIMIT']\n ENV['REPOSITORIES_LIMIT'].... | ruby | chosen |
[
{
"from": "system",
"value": "Use the Mountain Lion version of MacVim for non-Mavericks machines.\n"
},
{
"from": "human",
"value": "class Macvim < Cask\n url 'https://github.com/b4winckler/macvim/releases/download/snapshot-72/MacVim-snapshot-72-Mavericks.tbz'\n homepage 'http://code.google.co... | ruby | chosen |
[
{
"from": "system",
"value": "Update podspec by specifying Kamagari's dependent version\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name = 'Otafuku'\n s.version = '0.8.0' \n s.license = 'MIT'\n s.summary = 'Otafuku provides utility classes to use WKWebView'\n s.homepage = 'h... | ruby | chosen |
[
{
"from": "system",
"value": "Update email info in gem spec.\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'arcane/version'\n\nGem::Specification.new do |gem|\n\n gem.nam... | ruby | chosen |
[
{
"from": "system",
"value": "Add file encoding declaration to gemspec\n"
},
{
"from": "human",
"value": "require 'English'\n\nGem::Specification.new do |s|\n s.name = 'rusty_blank'\n s.version = '0.0.1'\n s.summary = 'Rust String.blank?'\n s.description = 'String.blank? from ... | ruby | chosen |
[
{
"from": "system",
"value": "Update pod version to 1.2.0\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |spec|\n spec.name = \"UIImageColors\"\n spec.version = \"1.1.1\"\n spec.license = \"MIT\"\n spec.summary = \"iTunes style color fetcher for UIImage.\"\n spec.hom... | ruby | chosen |
[
{
"from": "human",
"value": "Add gemspec hoping to turn this baby into a Ruby gem.\n"
},
{
"from": "gpt",
"value": "Gem::Specification.new do |s|\n s.name = \"time_warp\"\n s.version = \"1.0.0\"\n s.date = \"2008-11-08\"\n s.summary = \"Warp time in your tests\"\n s.email = \"b... | ruby | chosen |
[
{
"from": "system",
"value": "Update gemspec version to 0.1.5 and add today's date\n"
},
{
"from": "human",
"value": "Gem::Specification.new do |s|\n s.name = 'crudecumber'\n s.version = '0.1.4'\n s.date = '2015-06-15'\n s.summary = 'Crudecumber 0.1.4'\n s.description ... | ruby | chosen |
[
{
"from": "system",
"value": "Add test for returned id\n"
},
{
"from": "human",
"value": "# encoding: UTF-8\n\nrequire 'spec_helper'\nrequire 'ephemeral/client'\n\ndescribe 'Ephemeral::Client' do\n \n it 'expects 3 arguments' do\n test_client = Ephemeral::Client.new\n expect{\n test... | ruby | chosen |
[
{
"from": "system",
"value": "[dm-more] Remove rubygems usage from libraries\n\n* No longer require dm-core inside the plugins. Expected usage is to\n require dm-core prior to requiring the plugin.\n* Updated pathname creation to using Pathname#/ where possible\n"
},
{
"from": "human",
"value"... | ruby | chosen |
[
{
"from": "system",
"value": "Remove mocking of config stuff\n"
},
{
"from": "human",
"value": "__LIB_DIR__ = File.expand_path(File.join(File.dirname(__FILE__), \"..\",\"lib\"))\n\n$LOAD_PATH.unshift __LIB_DIR__ unless\n $LOAD_PATH.include?(__LIB_DIR__) ||\n $LOAD_PATH.include?(File.expand_pat... | ruby | chosen |
[
{
"from": "system",
"value": "Remove spec helper before hook to stub all FFI functions\n"
},
{
"from": "human",
"value": "require 'bundler/setup'\nrequire 'gphoto2'\n\nDir[File.join(__dir__, 'support/**/*.rb')].each { |f| require f }\n\nRSpec.configure do |config|\n config.treat_symbols_as_meta... | ruby | chosen |
[
{
"from": "system",
"value": "Add FixturePathHelper and includes it\n"
},
{
"from": "human",
"value": "RSpec.configure do |config|\n config.expect_with :rspec do |expectations|\n expectations.include_chain_clauses_in_custom_matcher_descriptions = true\n end\n\n config.mock_with :rspec do |... | ruby | chosen |
[
{
"from": "human",
"value": "Test contact thank you page.\n"
},
{
"from": "gpt",
"value": "describe \"Contact thank you page\", type: :feature do\n before do\n visit \"/contact/thanks\"\n end\n\n it \"displays the correct thank you message\" do\n expect(page).to have_selector(\"p\", tex... | ruby | chosen |
[
{
"from": "system",
"value": "Verify CouchDB is running before starting the tests"
},
{
"from": "human",
"value": "require 'couchrest_model'\n\nCOUCHHOST = \"http://127.0.0.1:5984\"\nTESTDB = 'tenacity-test'\nTEST_SERVER = CouchRest.new\nTEST_SERVER.default_database = TESTDB\nCOUCH_DB = T... | ruby | chosen |
[
{
"from": "system",
"value": "Add invalid length spec for VarOpaque\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\n\ndescribe XDR::Read::VarOpaque, \"#read\" do\n subject{ XDR::Read::VarOpaque.new(6) }\n\n it \"decodes values correctly\" do\n expect(read(\"\\x00\\x00\\x00\\x00\... | ruby | chosen |
[
{
"from": "system",
"value": "Switch ridley to passenger 4\n"
},
{
"from": "human",
"value": "name \"foundation\"\ndescription \"Role applied to all OSMF servers\"\n\ndefault_attributes(\n :apache => {\n :mpm => \"prefork\",\n :timeout => 60,\n :keepalive => false\n },\n :apt => {\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix issue with the wrong souce_files in podspec\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name = 'NSURL+Parameter'\n s.version = '0.1'\n s.summary = 'NSURL initialization with parameter objects'\n s.description = <<-DESC\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add -OL option when programming\n\nThe -OL option releases the device from reset after programming"
},
{
"from": "human",
"value": "require 'ceedling'\nCeedling.load_project\n\ntask :default => %w[ test:all release ]\n\ndesc \"Convert the output binary to a hex file... | ruby | chosen |
[
{
"from": "system",
"value": "Change podspec to specific dependency version\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n\n# 1\ns.platform = :ios\ns.ios.deployment_target = '9.0'\ns.name = \"caf_ios\"\ns.summary = \"caf_ios is a common application framework written in Swift for inter... | ruby | chosen |
[
{
"from": "system",
"value": "Add id to Simple since it is require by :node query field\n"
},
{
"from": "human",
"value": "QueryType = GraphQL::ObjectType.define do\n name \"Query\"\n description \"The query root for this schema\"\n\n field :simple do\n type SimpleType\n description \"S... | ruby | chosen |
[
{
"from": "system",
"value": "Extend max concurrent request count.\n"
},
{
"from": "human",
"value": "require 'rubygems'\nrequire 'bundler/setup'\n\nrequire 'sinatra'\nrequire 'json'\nrequire 'google_drive'\nrequire 'rack/contrib/jsonp'\n\n# Need \"callback\" query string parameter\nuse Rack::JS... | ruby | chosen |
[
{
"from": "system",
"value": "Rename validation method for clarity\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nmodule Carto\n class OauthApp < ActiveRecord::Base\n belongs_to :user, inverse_of: :oauth_apps\n has_many :oauth_app_users, inverse_of: :oauth_app, dependent: :destro... | ruby | chosen |
[
{
"from": "system",
"value": "Save and access the headers\n"
},
{
"from": "human",
"value": "class EmailProcessor\n def initialize(email)\n @email = email\n end\n\n def process\n Email.create(\n to: @email.headers[\"X-Forwarded-To\"],\n from: @email.from[:email],\n subjec... | ruby | chosen |
[
{
"from": "human",
"value": "Move images under /system in the public folder so that deployments will not cause the images to disappear.\n"
},
{
"from": "gpt",
"value": "module Spree\n\n Image.class_eval do\n # Move images under /system so that they are automatically symlinked by capistrano (... | ruby | chosen |
[
{
"from": "human",
"value": "[ceph] Add basic ceph df check\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env ruby\n#\n# Simple ceph df check (using ceph commands)\n#\n# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>\n#\n# Author: Sebastien Badia <sebastien.badia@enovance.com>\n#\n# Lice... | ruby | chosen |
[
{
"from": "system",
"value": "Test --version command line switch\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ninclude Json2\n\ndescribe Option do\n\n describe '--without-header' do\n\n it 'sets the option' do\n ARGV.replace(['--without-header'])\n opt = Option.new\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Remove FakeFs and output silence utilities\n"
},
{
"from": "human",
"value": "# coding: utf-8\n\n$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\nrequire 'response_mate'\n#require 'fakefs/safe'\n#require 'fakefs/spec_helpers'\nrequire 'fakeweb'\n#require ... | ruby | chosen |
[
{
"from": "system",
"value": "Drop Ruby 1.8 compatibility guard\n"
},
{
"from": "human",
"value": "unless RUBY_VERSION =~ /^1\\.8/\n require 'coveralls'\n Coveralls.wear!\nend\n\nrequire 'puppet-lint'\n\nPuppetLint::Plugins.load_spec_helper\n"
},
{
"from": "gpt",
"value": "require ... | ruby | chosen |
[
{
"from": "system",
"value": "Enable focus: true support in RSpec config\n"
},
{
"from": "human",
"value": "Dir[File.expand_path('../../lib/**/*.rb', __FILE__)].each { |f| require f }\n\nEXEL.logger = nil\n\nmodule EXEL\n module Providers\n class DummyAsyncProvider\n def initialize(_con... | ruby | chosen |
[
{
"from": "system",
"value": "Load only needed parts of rails\n"
},
{
"from": "human",
"value": "$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))\n$LOAD_PATH.unshift(File.dirname(__FILE__))\nrequire 'rspec'\nrequire 'rails/all'\nrequire 'smart_titles'\n\n# Requires supporting f... | ruby | chosen |
[
{
"from": "system",
"value": "Update rspec options to personal preference.\n"
},
{
"from": "human",
"value": "# This file was generated by the `rspec --init` command. Conventionally, all\n# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.\n# Require this file using `req... | ruby | chosen |
[
{
"from": "system",
"value": "Load the site map plugin."
},
{
"from": "human",
"value": "require 'bundler/setup'\nBundler.require(:test)\n\nrequire 'minitest/spec'\nrequire 'minitest/autorun'\nrequire 'minitest/pride'\nrequire 'rr'\nrequire 'jekyll'\n\nDir[\"./_plugins/**/*.rb\"].each {|f| requi... | ruby | chosen |
[
{
"from": "system",
"value": "Use 1.8 syntax for hashes\n"
},
{
"from": "human",
"value": "require \"rspec\"\nrequire \"ar_protobuf_store\"\n\nrequire \"active_record\"\n\nActiveRecord::Base.establish_connection(adapter: \"sqlite3\", database: \":memory:\")\nActiveRecord::Schema.verbose = false\... | ruby | chosen |
[
{
"from": "system",
"value": "Put Webmock config in config.after(:all) block\n"
},
{
"from": "human",
"value": "# This file is copied to ~/spec when you run 'ruby script/generate rspec'\n# from the project root directory.\nENV[\"RAILS_ENV\"] ||= 'test'\nrequire File.expand_path(\"../../config/en... | ruby | chosen |
[
{
"from": "system",
"value": "Make JOTFORM_API_KEY env variable optional\n"
},
{
"from": "human",
"value": "$LOAD_PATH << File.expand_path(\"../lib\", __FILE__)\n\nrequire \"webmock/rspec\"\nrequire \"vcr\"\nrequire \"jotform\"\n\nif ENV[\"JOTFORM_API_KEY\"].nil?\n raise \"Missing JotForm API K... | ruby | chosen |
[
{
"from": "system",
"value": "Allow using :focus feature in RSpec\n"
},
{
"from": "human",
"value": "require 'bundler/setup'\nBundler.setup\n\nrequire \"aba\"\n\nRSpec.configure do |config|\n config.order = :random\nend\n"
},
{
"from": "gpt",
"value": "require 'bundler/setup'\nBundl... | ruby | chosen |
[
{
"from": "system",
"value": "Set rails env to \"test\"\n"
},
{
"from": "human",
"value": "$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\nrequire 'rails'\nrequire 'dotenv/beefy'\nrequire_relative './support/mock_filesystem_helpers'\n\nRSpec.configure do |config|\n config.include Mo... | ruby | chosen |
[
{
"from": "system",
"value": "Add a helper for generators' specs (to reset destination folder)\n"
},
{
"from": "human",
"value": "ENV[\"RAILS_ENV\"] = \"test\"\n\n$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\n\nrequire 'rails/all'\nrequire 'tok'\n\nrequire File.expand_path('../dumm... | ruby | chosen |
[
{
"from": "system",
"value": "Allow passing a specific AWS region to S3 settings\n\nThis solves the error showed below when executed `bundle exec rake\ndb2fog:backup RAILS_ENV=staging` on Katuma staging\n\n```\nExcon::Error::BadRequest: Expected(200) <=> Actual(400 Bad Request)\nexcon.error.response\n :bod... | ruby | chosen |
[
{
"from": "system",
"value": "Add SIGTERM handling for ResqueMailer\n"
},
{
"from": "human",
"value": "Resque.before_fork do\n defined?(ActiveRecord::Base) and ActiveRecord::Base.connection.disconnect!\nend\n\nResque.after_fork do\n defined?(ActiveRecord::Base) and ActiveRecord::Base.establish... | ruby | chosen |
[
{
"from": "system",
"value": "Remove middlewares that are not needed since go-horizon provides them\n"
},
{
"from": "human",
"value": "require File.expand_path('../boot', __FILE__)\n\nrequire 'rails/all'\n\nBundler.require(*Rails.groups)\n\nDotenv::Railtie.load\n\nmodule Horizon\n class Applica... | ruby | chosen |
[
{
"from": "system",
"value": "Fix delayed_job for Rails 4.2\n"
},
{
"from": "human",
"value": "require File.expand_path('../boot', __FILE__)\n\nrequire 'rails/all'\n\nBundler.require(:default, Rails.env)\n\nmodule SplitsIO\n class Application < Rails::Application\n config.autoload_paths += D... | ruby | chosen |
[
{
"from": "system",
"value": "Fix has_many spec so that the stub isn't overwritten when defining the test class.\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe Doubleback do\n describe 'targeting ActiveRecord 2' do\n\n before do\n Doubleback.major_version = 2\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Make default currency vary in user factory\n"
},
{
"from": "human",
"value": "# Read about factories at https://github.com/thoughtbot/factory_girl\n\nFactoryGirl.define do\n factory :user do\n sequence(:email) { |n| \"test#{n}@test.com\" }\n name \"Teddy ... | ruby | chosen |
[
{
"from": "system",
"value": "Add faker name and secure random generated uuidw\n"
},
{
"from": "human",
"value": "FactoryGirl.define do\n\tfactory :user do\n\t\tname \"MyString\"\n\t\tprovider \"MyString\"\n\t\tuid \"MyString\"\n\tend\nend\n"
},
{
"from": "gpt",
"value": "FactoryGirl... | ruby | chosen |
[
{
"from": "system",
"value": "Test use of scope yield\n"
},
{
"from": "human",
"value": "scope(env: 'dev', component: 'vpc') do\n stack('dev', 'eu-west-1', 'vpc') do\n inc { 'vpc.rb' }\n end\nend\n"
},
{
"from": "gpt",
"value": "scope(env: \"dev\", component: \"vpc\") do |s|\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Allow default book yaml filename of \"book.yml\"\n"
},
{
"from": "human",
"value": "require 'optparse'\n\nrequire 'gutenberg'\nrequire 'gutenberg/book'\nrequire 'gutenberg/generator'\n\nmodule Gutenberg\n # The commandline interface to Gutenberg.\n class CLI\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add to_s to respond_to_missing check\n"
},
{
"from": "human",
"value": "module Usable\n class Config\n def each(&block)\n @spec.to_h.each(&block)\n end\n\n def spec(key, value = nil)\n @spec ||= OpenStruct.new\n if value\n @spec[key.t... | ruby | chosen |
[
{
"from": "system",
"value": "Switch the gemspec test files to features rather than spec\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nGem::Specification.new do |gem|\n gem.name = \"figaro\"\n gem.version = \"0.2.0\"\n\n gem.authors = [\"Steve Richert\"]\n gem.email = ... | ruby | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.