conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Allow for setting options and reuse of the mock app.\n" }, { "from": "human", "value": "require 'rubygems'\n\n$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))\n$LOAD_PATH.unshift(File.dirname(__FILE__))\n\nrequire 'rspec'\nrequire 'rack/test'\nrequ...
ruby
chosen
[ { "from": "system", "value": "Use before(:suite) rather than before(:all) for initialization in spec\n" }, { "from": "human", "value": "# coding: utf-8\n\nRSpec.configure do |config|\n unless ENV['TRANSPEC_TEST']\n # Yes, I'm writing specs in should syntax intentionally!\n config.expect_w...
ruby
chosen
[ { "from": "system", "value": "Fix so Rails.root works in specs\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'active_record'\nrequire 'rscribd'\n\nROOT = File.join(File.dirname(__FILE__), '..')\nRAILS_ROOT = ROOT\n\n$LOAD_PATH << File.join(ROOT, 'lib')\n$LOAD_PATH << File....
ruby
chosen
[ { "from": "system", "value": "Change to use new api\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nif ENV['COVERAGE'] || ENV['TRAVIS']\n require 'simplecov'\n require 'coveralls'\n\n SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[\n SimpleCov::Formatter::HT...
ruby
chosen
[ { "from": "system", "value": "Add :focus filtering for rspec examples\n" }, { "from": "human", "value": "$:.unshift File.expand_path(\"../lib\", __FILE__)\n\nrequire 'bootstrapper'\n" }, { "from": "gpt", "value": "$:.unshift File.expand_path(\"../lib\", __FILE__)\n\nrequire 'bootstra...
ruby
chosen
[ { "from": "system", "value": "Make sure Elmas is in it's default state before every spec\n" }, { "from": "human", "value": "require 'simplecov'\nrequire 'simplecov-rcov'\nSimpleCov.formatter = SimpleCov::Formatter::RcovFormatter\nSimpleCov.start do\n add_group 'Elmas', 'lib/elmas'\n add_group ...
ruby
chosen
[ { "from": "system", "value": "Clean up the sqlite file after test run\n" }, { "from": "human", "value": "require \"active_record\"\n\nActiveRecord::Base.establish_connection(\n :adapter => \"sqlite3\",\n :database => \"file::memory:?cache=shared\"\n)\n\nActiveRecord::Schema.verbose = false\nAc...
ruby
chosen
[ { "from": "system", "value": "Remove require on old file.\n" }, { "from": "human", "value": "#\n# Copyright:: Copyright (c) 2014 Chef Software Inc.\n# License:: Apache License, Version 2.0\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except...
ruby
chosen
[ { "from": "system", "value": "Convert to spec-style tests for contexts\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass TestTransloadit < MiniTest::Unit::TestCase\n def test_initializer_works\n key = 'a'\n secret = 'b'\n t = Transloadit.new(:key => key, :secret...
ruby
chosen
[ { "from": "system", "value": "Use File.expand_path instead of the shell to determine locations\n" }, { "from": "human", "value": "require File.expand_path('shhh/commands/base', File.dirname(__FILE__))\nrequire File.expand_path('shhh/commands/import', File.dirname(__FILE__))\nrequire File.expand_...
ruby
chosen
[ { "from": "system", "value": "Bump version for pretty colors\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\n$:.push File.expand_path(\"../\", __FILE__)\nrequire 'twitter'\nrequire 'yaml'\nrequire 'optparse'\nrequire 'oauth'\n\n%w[config exceptions argparse actions].each do |filename|\...
ruby
chosen
[ { "from": "system", "value": "Add guard code around lead time\n" }, { "from": "human", "value": "# <ItemDetail>\n# <Description xml:lang=\"en\">AGENDA MAGAZINE RACK A4 CHARCOAL 25990</Description>\n# <UnitOfMeasure>EA</UnitOfMeasure>\n# <UnitPrice> <Money currency=\...
ruby
chosen
[ { "from": "system", "value": "Add failing test for deserializing poorly formatted, non-delayed job based yaml loading.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe YAML do\n it \"should autoload classes that are unknown at runtime\" do\n lambda {\n YAML.load(\"--...
ruby
chosen
[ { "from": "human", "value": "Prepare an integration test stub for testing `YubiOATH`\n" }, { "from": "gpt", "value": "require 'yubioath'\n\nRSpec.describe(YubiOATH, :aggregate_failures, order: :defined) do\n let(:aid) { [0xA0, 0x00, 0x00, 0x05, 0x27, 0x21, 0x01, 0x01] }\n let(:select) { [0x00,...
ruby
chosen
[ { "from": "system", "value": "Add the render and renderer methods, remove the Renderable module\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Dimples\n class Template\n include Frontable\n include Renderable\n\n attr_accessor :path\n attr_accessor :conte...
ruby
chosen
[ { "from": "system", "value": "Allow use with Rails 3.2.\n\nSeems to work fine, so I relaxed the gemspec constraint.\n" }, { "from": "human", "value": "# encoding: UTF-8\n\n$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"colorbox-rails/version\"\n\n# De...
ruby
chosen
[ { "from": "system", "value": "Fix kwargs usage for Ruby 2.7\n" }, { "from": "human", "value": "class Gon\n module SpecHelper\n module Rails\n extend ActiveSupport::Concern\n\n module ClassMethods\n module GonSession\n def process(*)\n # preload threadloca...
ruby
chosen
[ { "from": "system", "value": "Make sure that `Routes` object is updated on `routes.rb` change in Sprockets 2, 3, 4\n" }, { "from": "human", "value": "class JsRoutesSprocketsExtension\n def initialize(filename, &block)\n @filename = filename\n @source = block.call\n end\n\n def render(...
ruby
chosen
[ { "from": "human", "value": "Add cask for MacPAR deLuxe\n\nMacPAR deLuxe is a utility program that runs on the Apple Macintosh. It is useful to you if you download (or upload) binary files from internet newsgroups (a.k.a. “Usenet”).\nOften, binary content comes in the form of sets of many files that togethe...
ruby
chosen
[ { "from": "system", "value": "Add extra context for Sentry exceptions\n" }, { "from": "human", "value": "require 'json'\nrequire 'rack/ssl'\nrequire 'sinatra/base'\nrequire 'metriks'\n\nrequire 'travis/build'\n\nmodule Travis\n module Build\n class App < Sinatra::Base\n before do\n ...
ruby
chosen
[ { "from": "system", "value": "Add github homepage to gemspec\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'dears3/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Fix tests to work with Rails 6\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + '/test_helper'\n\ndescribe AutoSessionTimeoutHelper do\n\n class ActionView::Base\n def timeout_path\n '/timeout'\n end\n \n def active_path\n '...
ruby
chosen
[ { "from": "system", "value": "Update maintainer and add fedora as a supported platform" }, { "from": "human", "value": "name 'yum-fedora'\nmaintainer 'Chef'\nmaintainer_email 'Sean OMeara <someara@chef.io>'\nlicense 'Apache 2.0'\ndescription 'Installs/Configures yum-fedora'\nversion '0.3.0'\n\nd...
ruby
chosen
[ { "from": "system", "value": "Fix Apache 2 dep to allow for latest version\n\nThis is pulled in from\nhttps://github.com/chef-cookbooks/subversion/pull/18\n\nAlso removed the single attribute and expanded the supported platforms\n" }, { "from": "human", "value": "name 'subversion'\nmaintainer 'C...
ruby
chosen
[ { "from": "human", "value": "Add tests for using Upstart as the service\n" }, { "from": "gpt", "value": "# coding: UTF-8\n\nrequire 'spec_helper'\n\ncontext 'when node[:zookeeper][:service_style] is set to upstart on Ubuntu' do\n describe file '/etc/init/zookeeper' do\n it { is_expected.to b...
ruby
chosen
[ { "from": "human", "value": "Add Framer Studio version 1.0.140\n\nInvent, design and experiment with interaction http://framerjs.com\n" }, { "from": "gpt", "value": "class FramerStudio < Cask\n version '1.0.140'\n sha256 '27148a31f0745cf4e8680a97b3c7063eb10d0dd3aa8cddbc844240e8aa749d2a'\n\n u...
ruby
chosen
[ { "from": "system", "value": "Fix error in new comment when creating validation error. Added project to create action\n" }, { "from": "human", "value": "class CommentsController < ApplicationController\n\n def new\n @comment = Comment.new\n @track = Track.find(params[:track_id])\n @pro...
ruby
chosen
[ { "from": "system", "value": "Add class generator for user invitation rows\n" }, { "from": "human", "value": "module UserInvitationsHelper\n def nearby_expiration_class(date)\n distance = (Time.zone.now - date).abs\n\n if distance <= 1.day.to_f\n \"text-danger\"\n elsif distance <...
ruby
chosen
[ { "from": "system", "value": "Make chef/ohai a development dep\n\nFauxhai 3 can't be included in chefspec at the moment due to the Chef 12\ndep. Doing so would require us to remove Chef 11 support from\nChefspec. Chef 11 is still supported so that's not an acceptable option.\nSince Ohai / Chef are only nee...
ruby
chosen
[ { "from": "human", "value": "Add Little Snitch.app Nightly Build v3.4\n" }, { "from": "gpt", "value": "class LittleSnitchNightly < Cask\n version '3.4-nightly-(4208)'\n sha256 'e3b91297945dcaaf7707f8f81301635012d56ea5342d817e21239d9b3f0945e7'\n\n url \"http://www.obdev.at/downloads/littlesnit...
ruby
chosen
[ { "from": "system", "value": "Fix repos name in gemspec\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'rabbitmq/sender/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "human", "value": "Add code sample explaining singleton class.\n" }, { "from": "gpt", "value": "class User\n attr_accessor :name\n\n def initialize(name)\n @name = name\n end\n\n def admin?\n @name == 'Admin'\n end\n\nend\n\n# imagine admin is logged in..\nuser1 = User.new('...
ruby
chosen
[ { "from": "system", "value": "Use chef file_cache for temp download.\n" }, { "from": "human", "value": "#\n# Cookbook Name:: mysql-zrm\n# Recipe:: solo-install\n#\n# Copyright (C) 2014 Nephila Graphic\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use thi...
ruby
chosen
[ { "from": "system", "value": "Convert the SP controller for edition workflow.\n" }, { "from": "human", "value": "class Admin::SupportingPagesController < Admin::BaseController\n include PublicDocumentRoutesHelper\n include Admin::AttachmentActionParamHandler\n\n before_filter :find_edition\n ...
ruby
chosen
[ { "from": "system", "value": "Replace find_all + each with grep\n" }, { "from": "human", "value": "require 'set'\n\nclass ComparableSet < Set\n def add new\n # smileys only\n return super new unless new.respond_to? :>\n\n objs = find_all { |o| o.class == new.class }\n objs.each do |...
ruby
chosen
[ { "from": "system", "value": "Remove unneeded line in rake test\n" }, { "from": "human", "value": "require 'rake/testtask'\n\nRake::TestTask.new do |t|\n t.libs.push \"test\"\n t.test_files = FileList['**/*_test.rb']\n t.verbose = true\nend\n" }, { "from": "gpt", "value": "require...
ruby
chosen
[ { "from": "system", "value": "Correct ndk r9 arcb selection\n" }, { "from": "human", "value": "\nndk_loc = node[:settings][:ndk_loc]\n\nscript \"setup-android-ndk\" do\n timeout 14400\n interpreter \"bash\"\n user node[:settings][:user]\n cwd \"/tmp\"\n code \"\n if [ `uname -m` == 'x86_...
ruby
chosen
[ { "from": "system", "value": "Add pry as dev dependency\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'weekly_commits/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Use .to_s on locale when testing match with cooky.\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n # Aspects\n protect_from_forgery\n\n # Authentication\n before_filter :authenticate_user!\n\n # Set the user locale\n b...
ruby
chosen
[ { "from": "system", "value": "Add blank line to force build on heroku\n" }, { "from": "human", "value": "require 'sinatra/base'\n\nclass Application < Sinatra::Base\n\n configure do\n set :public_folder, 'public'\n set :views, 'app/views'\n end\n\n get '/' do\n unsplash = Unsplash::U...
ruby
chosen
[ { "from": "system", "value": "Remove 'now' call from flash in rescue_from\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n protect_from_forgery with: :exception\n\n rescue_from CanCan::AccessDenied do |exception|\n # 'now' is required because else th...
ruby
chosen
[ { "from": "system", "value": "Use numbers for numeric attributes\n" }, { "from": "human", "value": "\ndefault[:tilecache][:tile_parent] = \"parent.tile.openstreetmap.org\"\ndefault[:tilecache][:tile_siblings] = []\n\n# Per IP bucket refill rate\ndefault[:tilecache][:ip_bucket_refill] = \"4096\"\...
ruby
chosen
[ { "from": "system", "value": "Remove the use of URI.encode in a test\n\nIt's apparently deprecated, and doesn't look to be required anyway.\n" }, { "from": "human", "value": "require \"test_helper\"\n\ndescribe EmailHelper do\n it \"should return true if we are browsing a taxon that is live\" d...
ruby
chosen
[ { "from": "system", "value": "Change shipping carrier switch to string\n" }, { "from": "human", "value": "class Shipment < ActiveRecord::Base\n belongs_to :order\n\n enum shipping_carrier: %i(fedex usps ups)\n\n def tracking_url\n case shipping_carrier.to_sym\n when :ups\n \"https:...
ruby
chosen
[ { "from": "system", "value": "Cut down on some warnings on OSX.\n" }, { "from": "human", "value": "\nrequire 'mkmf'\nrequire 'rbconfig'\n\nRbConfig::CONFIG['CC'] = 'g++'\nRbConfig::CONFIG['CPP'] = 'g++ -E'\n\n# hack to get C++ standard library properly linked into shared\n# object\n# $libs = app...
ruby
chosen
[ { "from": "system", "value": "Add missing require in gemspec.\n" }, { "from": "human", "value": "@version = YAML.load_file(\"VERSION\")\n@info = YAML.load_file(\"INFO\")\n@manifest = `git ls-files`.split.sort.reject{ |out| out =~ /^\\./ || out =~ /^doc/ }\n@spec = Gem::Specification.new...
ruby
chosen
[ { "from": "system", "value": "Store the test hash as its _id\n" }, { "from": "human", "value": "require 'abnormal/version'\n\nclass Abnormal\n def self.db; @@db; end\n def self.db=(db)\n @@db = db\n end\n\n def self.ab_test(identity, test_name, alternatives, conversions)\n conversions ...
ruby
chosen
[ { "from": "system", "value": "Fix the number of argument error of DRbObject respond_to method\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n# DRb::DRbObject -- fix bug in ruby -- 23.09.2005 -- hwyss@ywesee.com\n\nrequire 'drb'\n\nmodule DRb\n\tclass DRbObject\n\t\tdef respond_to?(msg_i...
ruby
chosen
[ { "from": "system", "value": "Remove extra space in method call\n" }, { "from": "human", "value": "# encoding: UTF-8\r\n\r\nrequire 'spec_helper'\r\n\r\nrequire_relative '../lib/coordinate'\r\n\r\ndescribe Coordinate do\r\n subject(:coordinate) { Coordinate.new(1, 0) }\r\n\r\n describe '#==' ...
ruby
chosen
[ { "from": "system", "value": "Use rspec around to filter out CRUD spec tests\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'CRUD' do\n\n CRUD_TESTS.each do |file|\n\n spec = Mongo::CRUD::Spec.new(file)\n\n if spec.server_version_satisfied?(AUTHORIZED_CLIENT)\n\n ...
ruby
chosen
[ { "from": "system", "value": "Allow sprockets 3.0 beta up to 4.x\n" }, { "from": "human", "value": "$:.unshift File.expand_path(\"../lib\", __FILE__)\nrequire \"sprockets/rails/version\"\n\nGem::Specification.new do |s|\n s.name = \"sprockets-rails\"\n s.version = Sprockets::Rails::VERSION\n\n...
ruby
chosen
[ { "from": "system", "value": "Use new asset path in generators\n\nIf the user wants to edit the assets, they can still use the generators\nto vendor a copy of the assets.\n" }, { "from": "human", "value": "require 'rails/generators'\n\nmodule Whoops\n class AssetsGenerator < Rails::Generators::...
ruby
chosen
[ { "from": "system", "value": "Fix older versions of Rails on Ruby 3\n" }, { "from": "human", "value": "module Octoshark\n module ConnectionHandler\n def establish_connection(*args, **kwargs)\n Octoshark::ConnectionPoolsManager.reset_connection_managers!\n super(*args, **kwargs)\n ...
ruby
chosen
[ { "from": "system", "value": "Use Postmark::MessageHelper in Postmark::SharedMessageExtensions to avoid duplication of code.\n" }, { "from": "human", "value": "module Postmark\n module SharedMessageExtensions\n\n def self.included(klass)\n klass.instance_eval do\n attr_accessor :...
ruby
chosen
[ { "from": "system", "value": "Duplicate state in machine planner\n" }, { "from": "human", "value": "module Protocore\n module Planners\n class MachinePlanner\n\n def initialize(work_dir)\n @work_dir = work_dir\n end\n\n def call(config, state)\n state.tap do |sta...
ruby
chosen
[ { "from": "system", "value": "Fix instantiation of Beantool within test (no tests yet, argh)\n" }, { "from": "human", "value": "require 'minitest/autorun'\nrequire File.join(File.dirname(__FILE__), '..', 'lib', 'beantool')\n\nclass BeantoolTest < MiniTest::Test\n def setup\n @beantool = Bean...
ruby
chosen
[ { "from": "human", "value": "Add utf8 text demo, based on ageldama's script\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\n\n# Original script was contributed by ageldama (Yun, Jonghyouk)\n\nrequire 'encoding/character/utf-8'\nrequire 'rubygame'\n\n# Initialize Rubygame\nRubygame.init\nsc...
ruby
chosen
[ { "from": "system", "value": "Update dependency on activerecord and railties to support Rails 4.0.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"generator_spec/version\"\n\nGem::Specification.new do |s|\n s.name =...
ruby
chosen
[ { "from": "system", "value": "Update general service stub code from API\n" }, { "from": "human", "value": "require_relative \"service_stubs/heroku_api_stub\"\n\ndef stub_service(uri, stub, &block)\n uri = URI(uri)\n uri.user, uri.password = nil, nil\n stub = block ? Sinatra.new(stub, &block) ...
ruby
chosen
[ { "from": "system", "value": "Adjust required_ruby_version to be >= 2.3\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path(\"../lib\", __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire \"envied/version\"\n\nGem::Specification.new do |spec|\n spe...
ruby
chosen
[ { "from": "system", "value": "Add '--verbose' flag to CLI, which also prints the AST in the REPL.\n" }, { "from": "human", "value": "module Calvin\n class CLI\n def initialize(argv)\n # ignore argv, for now\n repl\n end\n\n def repl\n require 'readline'\n\n puts \"C...
ruby
chosen
[ { "from": "system", "value": "Handle case where no output files are passed in. Thanks Justin\n" }, { "from": "human", "value": "namespace :brakeman do\n\n desc \"Run Brakeman\"\n task :run, :output_files do |t, args|\n require 'brakeman'\n\n files = args[:output_files].split(' ')\n Br...
ruby
chosen
[ { "from": "system", "value": "Fix checking of int size\n\nWith 64bit mingw the code didn't work (failed on WORD type detection)" }, { "from": "human", "value": "require 'mkmf'\n\ndir_config('rdiscount')\n\nHAVE_RANDOM = have_func('random')\nHAVE_SRANDOM = have_func('srandom')\nHAVE_RAND = have_f...
ruby
chosen
[ { "from": "system", "value": "Robot: Validate presence of team_id to be true.\n" }, { "from": "human", "value": "# lib/frecon/models/robot.rb\n#\n# Copyright (C) 2014 Christopher Cooper, Sam Craig, Tiger Huang, Vincent Mai, Sam Mercier, and Kristofer Rye\n#\n# This file is part of FReCon, an API...
ruby
chosen
[ { "from": "system", "value": "Fix variable names in Add command\n" }, { "from": "human", "value": "java_import org.geogit.api.porcelain.AddOp\njava_import org.geogit.api.plumbing.merge.Conflict\njava_import org.geogit.api.plumbing.merge.ConflictsReadOp\n\nmodule GeoGit\n module Command\n cla...
ruby
chosen
[ { "from": "system", "value": "Fix a bug that NoMemoryError by 20th move\n\n20手目くらいでNoMemoryError(failed to allocate memory)が発生していたので、\nMarshal.dumpを止めてShogi::Game.new.move(kifu)に修正\n" }, { "from": "human", "value": "module Shogi\n class Game\n attr_accessor :default_format\n attr_reader :...
ruby
chosen
[ { "from": "system", "value": "Switch Yard to runtime dep\n" }, { "from": "human", "value": "require \"#{File.dirname(__FILE__)}/lib/rubycom/version.rb\"\n\nGem::Specification.new do |spec|\n spec.name = 'rubycom'\n spec.version = Rubycom::VERSION\n spec.authors = ['Danny ...
ruby
chosen
[ { "from": "system", "value": "Put favorite create and destroy on same line as send_status\n" }, { "from": "human", "value": "class FavoritesController < ApplicationController\n def create\n if fav_valid?\n create_favorite\n send_status(:created)\n else\n send_status(:bad_re...
ruby
chosen
[ { "from": "system", "value": "Fix Response Controller To Send Back Success Upon Destroy\n" }, { "from": "human", "value": "class ResponsesController < ApplicationController\n\n before_action :set_response, only: [:edit, :update, :destroy, :up_vote, :mark_as_best]\n\n def create\n question =...
ruby
chosen
[ { "from": "system", "value": "Include locale parameter when redirecting to MYC\n" }, { "from": "human", "value": "# frozen_string_literal: true\nmodule MultiYearChartsHelper\n # Public: The full URL to the Multi-Year Charts application for an instance of\n # MultiYearCharts.\n #\n # Returns ...
ruby
chosen
[ { "from": "human", "value": "Create Eclipse JDT language server formula\n" }, { "from": "gpt", "value": "class JdtLanguageServer < Formula\n desc \"A Java language specific implementation of the Language Server Protocol\"\n homepage \"https://github.com/eclipse/eclipse.jdt.ls\"\n\n url \"http...
ruby
chosen
[ { "from": "system", "value": "Update gem version to 0.1.5.\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"machinist\"\n s.version = \"0.1.4\"\n s.author = \"Pete Yandell\"\n s.email = \"pete@nothat.com\"\n s.homepage = \"http://gi...
ruby
chosen
[ { "from": "system", "value": "Use around_update to hold reference to previous person\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass PersonObserver < ActiveRecord::Observer\n def after_destroy(person)\n Result.where(person_id: person.id).update_all(\n person_id...
ruby
chosen
[ { "from": "system", "value": "Validate expected services are running\n" }, { "from": "human", "value": "# Encoding: utf-8\r\nrequire_relative 'spec_windowshelper'\r\n\r\ndescribe package('Microsoft SQL Server 2016 (64-bit)') do\r\n it { should be_installed }\r\nend\r\n\r\n# RTM version\r\ndescr...
ruby
chosen
[ { "from": "system", "value": "Use kill for terminting httpry\n" }, { "from": "human", "value": "# encoding: UTF-8\n#\n# Copyright (c) 2016 Tomas Korcak <korczis@gmail.com>. All rights reserved.\n# This source code is licensed under the MIT-style license found in the\n# LICENSE file in the root d...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.14.0.0 to 0.15.0.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'evt-messaging'\n s.version = '0.14.0.0'\n s.summary = 'Messaging primitives for Eventide'\n s.descripti...
ruby
chosen
[ { "from": "human", "value": "Add specs for auth server on vagrant\n" }, { "from": "gpt", "value": "require 'spec_helper'\nrequire 'rails_app_helper'\n\nRSpec.describe 'Kerberos Authentication Server' do\n include Krb5Auth\n describe 'abc' do\n it 'passes krb authentication' do\n expect...
ruby
chosen
[ { "from": "system", "value": "Revert \"Fix handing of unusual characters\"\n\nThis reverts commit 405d6f65b7573a182f0bf1f36e3ee9ca9b507561.\n" }, { "from": "human", "value": "class Encoder\n def self.encode(string)\n if string.respond_to?(:encode!)\n string.encode!('UTF-8', :invalid => ...
ruby
chosen
[ { "from": "system", "value": "Remove directory option to 'deploy' (assume current directory)\n" }, { "from": "human", "value": "module Conjure\n class Command < Thor\n desc \"deploy\", \"Deploys the app\"\n def deploy(source_path = Dir.pwd)\n github_url = git_origin_url source_path\n...
ruby
chosen
[ { "from": "system", "value": "Include the compiled native gem.\n" }, { "from": "human", "value": "require \"consistent_hash/version\"\n\nmodule ConsistentHash\n # Your code goes here...\nend\n" }, { "from": "gpt", "value": "require \"consistent_hash/version\"\nrequire 'consistent_ha...
ruby
chosen
[ { "from": "system", "value": "Add a unit test for `solo clean`\n" }, { "from": "human", "value": "require 'test_helper'\nrequire 'support/validation_helper'\n\nrequire 'chef/knife/solo_clean'\n\nclass SoloCleanTest < TestCase\n include ValidationHelper::ValidationTests\n\n def command(*args)\n...
ruby
chosen
[ { "from": "human", "value": "test/cli: Add tests for `kbsecret generators`\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nrequire \"helpers\"\n\n# Tests for KBSecret::CLI::Command::Generators\nclass KBSecretCommandGeneratorsTest < Minitest::Test\n include Helpers\n include H...
ruby
chosen
[ { "from": "system", "value": "Replace last occurrence of Shrine::Storage::Memory\n\nThis was supposed to be part of the previous commit.\n" }, { "from": "human", "value": "require \"test_helper\"\nrequire \"shrine/plugins/dynamic_storage\"\n\ndescribe Shrine::Plugins::DynamicStorage do\n before...
ruby
chosen
[ { "from": "system", "value": "Disable shared node installs across deployments for now.\n" }, { "from": "human", "value": "require \"capistrano_nrel_ext/recipes/shared_children\"\n\nCapistrano::Configuration.instance(true).load do\n #\n # Varabiles\n #\n set :npm_apps, []\n\n set(:npm_shared...
ruby
chosen
[ { "from": "system", "value": "Set an arbitrary limit of how many items of an array to render\n" }, { "from": "human", "value": "module DataFormatter\n class ArrayCollection < Collection\n\n def open\n @open ||= Tag.new(css_class: \"bracket\", content: \"[\")\n end\n\n def close\n ...
ruby
chosen
[ { "from": "system", "value": "Use autoload to load modules on-demand.\n" }, { "from": "human", "value": "##\n# Namespace for Macmillan code...\n#\nmodule Macmillan\n ##\n # Utils module for use in Macmillan applications\n #\n module Utils\n autoload :VERSION, 'macmillan/utils/vers...
ruby
chosen
[ { "from": "system", "value": "Add the information of locked by and locked at to lock file.\n" }, { "from": "human", "value": "require 'mina/bundler'\n\nnamespace :lock do\n desc 'Lock deployment'\n task deployment: :environment do\n queue %[echo '-----> Locking deployment (manually)']\n ...
ruby
chosen
[ { "from": "system", "value": "Remove the .rb in the fileutils include.\n" }, { "from": "human", "value": "require \"digest/md5\"\nrequire \"fileutils.rb\"\n\nmodule Ruco\n class FileStore\n def initialize(folder, options)\n @folder = folder\n @options = options\n end\n\n def ...
ruby
chosen
[ { "from": "system", "value": "Fix style: Style/MutableConstant: Freeze mutable objects assigned to constants.\n" }, { "from": "human", "value": "# Define the version number of Sisimai\nmodule Sisimai\n VERSION = '4.20.2'\nend\n" }, { "from": "gpt", "value": "# Define the version num...
ruby
chosen
[ { "from": "system", "value": "Make any overlayed images centered\n" }, { "from": "human", "value": "module Teaas\n class Overlayer\n def self.overlay(original_img, overlay_img, options={})\n if options[:whitelisted_animation]\n overlay_animated_on_animated(original_img, overlay_i...
ruby
chosen
[ { "from": "system", "value": "Fix spelling on Gem summary\n\nSigned-off-by: Seapagan <4ab1b2fdb7784a8f9b55e81e3261617f44fd0585@gmail.com>\n" }, { "from": "human", "value": "# coding: utf-8\n# rubocop:disable LineLength\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $...
ruby
chosen
[ { "from": "system", "value": "Add Douglas.the_stamper reader and writer\n" }, { "from": "human", "value": "require 'request_store'\nrequire 'douglas/version'\n\nmodule Douglas\n # Your code goes here...\nend\n" }, { "from": "gpt", "value": "require 'request_store'\nrequire 'douglas/...
ruby
chosen
[ { "from": "system", "value": "Update methoddefinitions to support new DSL\n" }, { "from": "human", "value": "require 'active_record'\nrequire 'workflow'\n\nmodule Foreman\n include ::Workflow\n\n module ClassMethods\n # Set the default state of this workflow\n def default_state(state)\n ...
ruby
chosen
[ { "from": "system", "value": "Use payload rather than data to fetch job id.\n" }, { "from": "human", "value": "module Travis\n module Tasks\n module Middleware\n class Logging\n def call(worker, message, queue, &block)\n uuid, _, _, payload, params = *message['args']\n ...
ruby
chosen
[ { "from": "system", "value": "Fix to default files, to pickup like README.markdown.\n" }, { "from": "human", "value": "require 'date'\n\nrequire 'jeweler/bumping'\nrequire 'jeweler/versioning'\nrequire 'jeweler/singleton'\nrequire 'jeweler/gemspec'\nrequire 'jeweler/errors'\n\nrequire 'jeweler/t...
ruby
chosen
[ { "from": "system", "value": "Add the query object to the requires\n" }, { "from": "human", "value": "require 'montage/version'\nrequire 'montage/client'\n\nmodule Montage\nend\n" }, { "from": "gpt", "value": "require 'montage/version'\nrequire 'montage/client'\nrequire 'montage/quer...
ruby
chosen
[ { "from": "system", "value": "Use requirer instead of continuing to add require statements.\n" }, { "from": "human", "value": "require 'net/http'\nrequire 'json'\n\nrequire \"searchr/version\"\nrequire 'searchr/query'\nrequire 'searchr/solr_query'\nrequire 'searchr/result'\nrequire 'searchr/solr...
ruby
chosen
[ { "from": "system", "value": "rpearce: Update gemspec for trusty. Update authors\n" }, { "from": "human", "value": "require 'rake'\n\nhash = `git rev-parse --short HEAD`.chomp\nv_part= ENV['BUILD_NUMBER'] || \"0.#{hash.hex}\"\nversion = \"0.0.#{v_part}\"\n\nGem::Specification.new do |s|\n s.nam...
ruby
chosen
[ { "from": "system", "value": "Add osuadmin account on all OSUOSL machines\n" }, { "from": "human", "value": "name \"osuosl\"\ndescription \"Role applied to all servers at OSUOSL\"\n\ndefault_attributes(\n :networking => {\n :nameservers => [ \"8.8.8.8\", \"8.8.4.4\" ],\n :roles => {\n ...
ruby
chosen
[ { "from": "system", "value": "Set homepage to github repo\n" }, { "from": "human", "value": "$:.push File.expand_path('../lib', __FILE__)\nrequire 'isbm_adaptor/version'\n\nGem::Specification.new do |s|\n s.name = 'isbm_adaptor'\n s.version = IsbmAdaptor::VERSION\n s.authors = ...
ruby
chosen