conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Make sure we continue with all switches after plugin install.\n\nAlso adjusted style on function calls.\n" }, { "from": "human", "value": "def install_plugins(plugins)\n not_installed = get_not_installed plugins\n if not_installed.any?\n puts \"The following re...
ruby
chosen
[ { "from": "system", "value": "Add cancel button to person edit forms\n" }, { "from": "human", "value": "module PeopleHelper\n def person_form_for(type_name)\n concat content_tag(:h1, \"Edit #{type_name} for #{@person.name}\")\n form_for @person, :html => { :multipart => true } do |form|\n...
ruby
chosen
[ { "from": "system", "value": "Add uniqueness validation to user on channel member\n" }, { "from": "human", "value": "class ChannelMember < ActiveRecord::Base\n belongs_to :channel\n belongs_to :user\n validates :user_id, :channel_id, presence: true\nend\n" }, { "from": "gpt", "val...
ruby
chosen
[ { "from": "system", "value": "Revert \"Add team to PersonEdition\"\n\nThis reverts commit 96043a66ff73d51b44f1cefcd9fee1d1ce4b5169.\n" }, { "from": "human", "value": "require \"edition\"\nrequire \"attachable_with_metadata\"\n\nclass PersonEdition < Edition\n include AttachableWithMetadata\n\n ...
ruby
chosen
[ { "from": "system", "value": "Update tests to new test data\n" }, { "from": "human", "value": "require 'spec_helper'\n\nRSpec.describe CSV2Avro do\n describe '#convert' do\n let(:options) { { schema: './spec/support/schema.avsc' } }\n\n before do\n ARGV.replace ['./spec/support/data....
ruby
chosen
[ { "from": "system", "value": "Add notes about improving the representation of tree structures\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Calyx::Grammar::Registry do\n let(:registry) do\n Calyx::Grammar::Registry.new\n end\n\n specify 'registry evaluates the start ...
ruby
chosen
[ { "from": "system", "value": "Implement edit learning object feature\n" }, { "from": "human", "value": "class LearningObjectsController < ApplicationController\n before_action :authenticate_user!\n\n def index\n @learning_objects = LearningObject.where(user: current_user)\n end\n\n def sh...
ruby
chosen
[ { "from": "system", "value": "Fix intermittent failing test through the use of regexp\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass DownloadRouterTest < ActiveSupport::TestCase\n\n def setup\n Rails.cache.clear\n end\n\n test '.request, called with search domain and an ...
ruby
chosen
[ { "from": "system", "value": "Add dependencies on Jekyll and jekyll-paginate.\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'ace-theme'\n s.version = '1.0.1'\n s.license = 'MIT'\n s.summary = 'Ace: A Jekyll theme.'\n s.author = 'Aliou Diallo'\n s.emai...
ruby
chosen
[ { "from": "system", "value": "Add superorder helper to DSL.\n" }, { "from": "human", "value": "require_relative \"./document\"\n\nmodule Metacrunch\n module Mab2\n class Builder\n\n attr_reader :document\n\n def self.build(&block)\n builder = new\n builder.instance_ev...
ruby
chosen
[ { "from": "system", "value": "Remove obsolete code - merging issue.\n" }, { "from": "human", "value": "module Prefetcher\n class HttpFetcher\n attr_reader :url, :memoizer\n\n def initialize(params = {})\n @url = params.fetch(:url)\n @memoizer = params.fetch(:memoizer, HttpMemoiz...
ruby
chosen
[ { "from": "system", "value": "Add keep original file option\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'fileutils'\nrequire 'zip/zip'\nrequire 'zip/zipfilesystem'\n\nARGV.each do |arg|\n files = File.directory?(arg) ? Dir.glob(arg + '/**') : [arg]\n files.each do |filename...
ruby
chosen
[ { "from": "system", "value": "Add pry to dev dependencies" }, { "from": "human", "value": "lib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'pieces/version'\n\nGem::Specification.new do |spec|\n spec.name = 'pieces'\n spec.ve...
ruby
chosen
[ { "from": "system", "value": "Use latest td command to reduce package size\n" }, { "from": "human", "value": "dir 'plugin_gems'\ndownload \"httpclient\", \"2.4.0\"\ndownload \"td-client\", \"0.8.68\"\ndownload \"td\", \"0.11.8\"\ndownload \"fluent-plugin-td\", \"0.10.26\"\ndownload \"thrift\", \...
ruby
chosen
[ { "from": "human", "value": "Add test case for HasOne populator\n" }, { "from": "gpt", "value": "require 'test_helper'\n\nclass HasOneTest < ActiveSupport::TestCase\n def setup\n @parent = User.new\n @model = Email.new\n\n @args = ActiveSupport::HashWithIndifferentAccess.new(\n mo...
ruby
chosen
[ { "from": "system", "value": "Return an empty hash if no pull request or issue\n" }, { "from": "human", "value": "class PayloadParser\n def initialize(payload, headers)\n @payload = payload\n @headers = headers\n end\n\n def action\n payload[\"action\"]\n end\n\n def event_type\n ...
ruby
chosen
[ { "from": "system", "value": "Comment for CSP unsafe-inline cause.\n" }, { "from": "human", "value": "::SecureHeaders::Configuration.configure do |config|\n config.hsts = {:max_age => 99, :include_subdomains => true}\n config.x_frame_options = 'DENY'\n config.x_conten...
ruby
chosen
[ { "from": "system", "value": "Access importer: guard against nil values upstream\n" }, { "from": "human", "value": "class AccessRow < Struct.new :row, :student_id, :assessments_array\n # Represents a row in a CSV export from Somerville's Aspen X2 student information system.\n\n def build\n ...
ruby
chosen
[ { "from": "system", "value": "Add uninstall and zap stanzas for Backblaze\n" }, { "from": "human", "value": "cask 'backblaze' do\n version :latest\n sha256 :no_check\n\n url 'https://secure.backblaze.com/mac/install_backblaze.dmg'\n name 'Backblaze'\n homepage 'https://www.backblaze.com/'\n...
ruby
chosen
[ { "from": "system", "value": "Drop no longer support mysql configuration options\n" }, { "from": "human", "value": "name \"foundation\"\ndescription \"Role applied to all OSMF servers\"\n\ndefault_attributes(\n :apt => {\n :sources => [\"passenger\"]\n },\n :elasticsearch => {\n :versio...
ruby
chosen
[ { "from": "system", "value": "Move instance method below class methods\n" }, { "from": "human", "value": "module Drift\n class StaticModel\n\n def initialize(args)\n args.each do |k, v|\n instance_variable_set(\"@#{k.to_s.underscore}\", v) unless v.nil?\n end\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Modify podspec to add screenshot\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'TextFormater'\n s.version = '1.0.0'\n s.summary = 'Convert String to NSAttributedString'\n\n s.description = <<-DESC\nConvert ...
ruby
chosen
[ { "from": "system", "value": "Add a basic support for environment\n" }, { "from": "human", "value": "require 'rubygems'\n\n# dependencies\nrequire 'bundler/setup'\nrequire \"cuba\"\nrequire 'data_mapper'\nrequire 'slim'\nrequire \"cuba/render\"\n\n# app\nrequire \"./app\"\n\n#Bar.create name: \"...
ruby
chosen
[ { "from": "system", "value": "Rename local variable to be more meaningful" }, { "from": "human", "value": "target_gemfile = Devtools.project.shared_gemfile_path\nsource_gemfile = Devtools.shared_gemfile_path\n\ntarget_config = Devtools.project.root\nsource_config = Devtools.default_config_path...
ruby
chosen
[ { "from": "system", "value": "Add comment about LB algorithms\n" }, { "from": "human", "value": "# Enum must be one of WeightedRoundRobin, LeastRequests, LeastResponseTime, WeightedTotalTraffic, RequestHash\n\ndefine :arr_farm_algorithm,\n :algorithm => :LeastRequests do\n\n farm_name = para...
ruby
chosen
[ { "from": "system", "value": "Set page part positions on engine generation.\n" }, { "from": "human", "value": "if defined?(::Refinery::User)\n ::Refinery::User.all.each do |user|\n if user.plugins.where(:name => 'refinerycms-<%= namespacing.underscore %>').blank?\n user.plugins.create(:...
ruby
chosen
[ { "from": "human", "value": "Add specs for base files\n" }, { "from": "gpt", "value": "\nrequire 'spec_helper'\n\nRSpec.describe BASE_FILES do\n let (:base_files) {BASE_FILES.map {|file| File.basename(file)} }\n \n it 'contains a main javascript file' do\n expect(base_files).to include('ma...
ruby
chosen
[ { "from": "human", "value": "Add utility to trace drone packets\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\n# -*- encoding: utf-8 -*-\nrequire 'arbdrone/nav_data.rb'\nrequire 'pcap'\n\ninclude ARbDrone::NavData\ninclude Pcap\n\n# TODO: Allow configuring a live network capture by specif...
ruby
chosen
[ { "from": "system", "value": "Fix bottle tag sort order for Linuxbrew\n" }, { "from": "human", "value": "require \"version\"\n\nmodule OS\n module Mac\n class Version < ::Version\n SYMBOLS = {\n :sierra => \"10.12\",\n :el_capitan => \"10.11\",\n :yosemite...
ruby
chosen
[ { "from": "system", "value": "Handle case where jobs is nil\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire_relative 'service'\n\nmodule JobBoard\n module Services\n class AllocateJobs < Service\n def initialize(jobs: [], count: 1, from: '', queue: '', site: ...
ruby
chosen
[ { "from": "system", "value": "Upgrade to the new db-migrate.py config flag\n" }, { "from": "human", "value": "require File.join(File.dirname(__FILE__), '..', 'dbmigrate')\n\nPuppet::Type.type(:dbmigrate).provide(:mysql, :parent => Puppet::Provider::DbMigrate) do\n desc \"Applies a database migr...
ruby
chosen
[ { "from": "system", "value": "Fix typo in index key" }, { "from": "human", "value": "module Saasable::Mongoid::ScopedDocument\n def self.included klass\n klass.extend ClassMethods\n klass.class_eval do\n # Fields\n field :saas_id, type: BSON::ObjectId, default: ->{ Saasable::Mon...
ruby
chosen
[ { "from": "system", "value": "Add version to development 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 'random_bell/version'\n\nGem::Specification.new do |spec|\n spec....
ruby
chosen
[ { "from": "human", "value": "Add redirect to coinbase if they submit payment form.\n" }, { "from": "gpt", "value": "module Spree\n CheckoutController.class_eval do\n\n before_filter :redirect_to_coinbase_if_needed, :only => [:update]\n\n private\n\n def redirect_to_coinbase_if_needed\n...
ruby
chosen
[ { "from": "human", "value": "Add new GPS 2.3 Code\n" }, { "from": "gpt", "value": "# Your Names\n# 1)\n# 2)\n\n# We spent [#] hours on this challenge.\n\n# Bakery Serving Size portion calculator.\n\ndef serving_size_calc(item_to_make, order_quantity)\n library = {\"cookie\" => 1, \"cake\" => 5...
ruby
chosen
[ { "from": "system", "value": "Add full name of DCMI\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/rss/dcterms/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"KITAITI Makoto\"]\n gem.email = [\"KitaitiMakot...
ruby
chosen
[ { "from": "system", "value": "Fix up the Twitter digest code\n" }, { "from": "human", "value": "service :twitter do |data, payload|\n repository = payload['repository']['name']\n url = URI.parse(\"http://twitter.com/statuses/update.xml\") \n statuses = Array.new\n\n if data['digest'] == fal...
ruby
chosen
[ { "from": "human", "value": "Add setup generator for config and styles files.\n" }, { "from": "gpt", "value": "module Tabster\n module Generators\n class InstallGenerator < Rails::Generators::Base\n source_root File.expand_path(\"../../templates\", __FILE__)\n\n desc \"Creates a Ta...
ruby
chosen
[ { "from": "system", "value": "Handle orphan commits in GithubSyncJob\n" }, { "from": "human", "value": "module Shipit\n class FirstParentCommitsIterator < OctokitIterator\n def each\n last_ancestor = nil\n super do |commit|\n unless last_ancestor\n yield last_ancest...
ruby
chosen
[ { "from": "system", "value": "Fix demo recipe to use resource attribute instead of resource_name\n" }, { "from": "human", "value": "#\n# Author:: Adam Edwards (<adamed@getchef.com>)\n#\n# Copyright:: 2014, Chef Software, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\")...
ruby
chosen
[ { "from": "system", "value": "Update gemspec metadata and lock to redis 3.x instead of 3.0.x .\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'ryespy/version'\n\nGem::Specification.n...
ruby
chosen
[ { "from": "system", "value": "Package version increased from 2.2.4.1 to 2.2.4.2\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'evt-schema'\n s.summary = \"Primitives for schema and data structure\"\n s.version = '2.2.4.1'\n s.descripti...
ruby
chosen
[ { "from": "system", "value": "Rewrite HTTPS URLs for images as well\n" }, { "from": "human", "value": "# encoding: utf-8\n\nclass LinkFilter < Filter\n\n HTTPS_WHITELIST = %w{\n youtube.com\n *.youtube.com\n vimeo.com\n soundcloud.com\n }\n\n def process(post)\n @post = post\n ...
ruby
chosen
[ { "from": "system", "value": "Drop bundler gem install from example, lags on rubygems.\n" }, { "from": "human", "value": "Citrus::Configuration.describe do |c|\n c.build_script = 'gem ins bundler && bundle install && bundle exec rspec'\nend\n" }, { "from": "gpt", "value": "Citrus::C...
ruby
chosen
[ { "from": "system", "value": "Fix Teacher registration step definition\n\nThere was an issue appearing only on the CI server because the anonymous user was not present when it was expected to be so. I've updated the step definitions to ensure the user is there." }, { "from": "human", "value": "...
ruby
chosen
[ { "from": "system", "value": "Remove extra configuration for mocking ENV[HOME] aruba handle it\n" }, { "from": "human", "value": "require 'codewars_cli/runner'\nrequire 'aruba/cucumber'\nrequire 'aruba/in_process'\n\nBefore do\n @real_path = ENV['HOME']\n @fake_home = File.join('/tmp','fake_ho...
ruby
chosen
[ { "from": "system", "value": "Add lap back to the Raw Time Row serializer\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nRawTimeRow = Struct.new(:raw_times, :effort, :event, :split, :errors) do\n include ActiveModel::Serializers::JSON\n\n RAW_TIME_ATTRIBUTES = [:id, :absol...
ruby
chosen
[ { "from": "system", "value": "Remove documentation bit from podspec\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'BlocksKit'\n s.version = '1.8.3'\n s.license = 'MIT'\n s.summary = 'The Objective-C block utiliti...
ruby
chosen
[ { "from": "system", "value": "Add api for joining and leaving groups\n" }, { "from": "human", "value": "module V1\n class UsergroupsController < ApiController\n def index\n render json: current_user.groups\n end\n end\nend\n" }, { "from": "gpt", "value": "module V1\n cl...
ruby
chosen
[ { "from": "system", "value": "Fix spec; status field isn't on the user any more.\n" }, { "from": "human", "value": "class Task::Comments::BaseComment < Mutations::Command\n required do\n model :task\n model :user\n string :message\n end\n\n def execute\n I18n.locale = task.circle....
ruby
chosen
[ { "from": "human", "value": "Add capture button and resize columns\n" }, { "from": "gpt", "value": "Deface::Override.new(:virtual_path => \"spree/admin/orders/index\",\n :name => \"add_capture_order_shortcut\",\n :insert_bottom => \"[data-h...
ruby
chosen
[ { "from": "system", "value": "Fix bug in EventReconcilePresenter that kept efforts from being matched.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass EventReconcilePresenter < EventWithEffortsPresenter\n def post_initialize(args)\n ArgsValidator.validate(params: ar...
ruby
chosen
[ { "from": "system", "value": "Add code to initialise rspec-fire.\n" }, { "from": "human", "value": "require \"bundler\"\nBundler.require\n\nrequire 'ostruct'\nrequire File.expand_path(\"../../lib/textrazor\" ,__FILE__)\n" }, { "from": "gpt", "value": "require \"bundler\"\nBundler.req...
ruby
chosen
[ { "from": "system", "value": "Move rspec-puppet-facts to spec helper\n\nThis change updates the module to use the rspec-puppet-facts as defined\nin the puppet-openstack_spec_helper.\n\nChange-Id: I8da03b20f05fa25aab70147d6f4445e4fdbc1101\n" }, { "from": "human", "value": "require 'puppetlabs_spe...
ruby
chosen
[ { "from": "system", "value": "Fix support requires in spec/helper.rb\n" }, { "from": "human", "value": "$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))\n$LOAD_PATH.unshift(File.dirname(__FILE__))\nrequire 'tempfile'\nrequire 'rspec'\nrequire 'fakefs/spec_helpers'\nrequire 'moc...
ruby
chosen
[ { "from": "system", "value": "Hide fakes3 output in tests\n" }, { "from": "human", "value": "require 'webmock/rspec'\nrequire './lib/optimus_prime'\n\nWebMock.disable_net_connect! allow_localhost: true\nENV['AWS_ACCESS_KEY_ID'] = SecureRandom.hex\nENV['AWS_SECRET_ACCESS_KEY'] = SecureRandom.hex\...
ruby
chosen
[ { "from": "system", "value": "Allow net connect in spec\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path(\"../\", __FILE__)\n$LOAD_PATH.unshift File.expand_path(\"../../lib\", __FILE__)\n\nrequire \"simplecov\"\nSimpleCov.start\n\nrequire \"syoboi_calendar\"\nrequire \"webm...
ruby
chosen
[ { "from": "system", "value": "Fix odd package names on ubuntu trusty\n" }, { "from": "human", "value": "version = value_for_platform_family(\n \"debian\" => node[\"percona\"][\"version\"],\n \"rhel\" => node[\"percona\"][\"version\"].tr(\".\", \"\")\n)\n\ncase node[\"platform_family\"]\nwhen \...
ruby
chosen
[ { "from": "system", "value": "Allow redis to be injected into intent listener" }, { "from": "human", "value": "module Spirit\n class IntentListener\n attr_reader :environment\n def initialize(environment, config={})\n @environment = environment\n end\n\n def listen\n redis...
ruby
chosen
[ { "from": "system", "value": "Remove redundant rescue_from calls from HelpController" }, { "from": "human", "value": "require \"slimmer/headers\"\n\nclass HelpController < ApplicationController\n before_filter :setup_slimmer_artefact\n before_filter :set_expiry\n\n rescue_from AbstractControl...
ruby
chosen
[ { "from": "system", "value": "Remove caching from home index action.\n" }, { "from": "human", "value": "class HomeController < ApplicationController\n\n layout 'relaunch'\n\n def index\n unless user_signed_in? || admin_user_signed_in?\n expires_in 1.hour, public: true\n end\n\n r...
ruby
chosen
[ { "from": "system", "value": "Package version is incremented from 0.5.0.1 to 0.5.0.2\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'data_aggregation-index'\n s.version = '0.5.0.1'\n s.summary = 'Event store data aggregation index librar...
ruby
chosen
[ { "from": "human", "value": "Add spec for mocked-up branches.\n" }, { "from": "gpt", "value": "require 'spec_helper'\nrequire 'compo'\nrequire 'branch_shared_examples'\n\n# Mock implementation of a Branch\nclass MockBranch\n include Compo::Branch\nend\n\ndescribe MockBranch do\n it_behaves_lik...
ruby
chosen
[ { "from": "system", "value": "Remove spork debug hooks for now. Doesn't work on Travis because we exclude ruby-debug.\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'spork'\nrequire 'spork/ext/ruby-debug'\n\nSpork.prefork do\n require 'bundler'\n Bundler.require :default, :deve...
ruby
chosen
[ { "from": "system", "value": "Load all files inside support dir in one line\n" }, { "from": "human", "value": "root = ::File.dirname(__FILE__)\nrequire ::File.join(root,'..', 'postman')\n\nrequire 'database_cleaner'\n\nPostman.configure do |config|\n config.databases = {\n 'default' => {\n ...
ruby
chosen
[ { "from": "system", "value": "Make the celluloid requirement conditional on the Sidekiq version.\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\n\n# Require necessary files for sidekiq to believe it's running in server mode\nrequire 'celluloid'\nreq...
ruby
chosen
[ { "from": "system", "value": "Customize spec helper to add some iidea specific helpers\n" }, { "from": "human", "value": "begin\n require File.expand_path(\"../../.bundle/environment\", __FILE__)\nrescue LoadError\n raise \"Gem environment is not prepared. Run `bundle install` before running ...
ruby
chosen
[ { "from": "system", "value": "Add required Ruby version to .gemspec file" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"simple_form/version\"\n\nGem::Specification.new do |s|\n s.name = \"simple_form\"\n s.version ...
ruby
chosen
[ { "from": "system", "value": "Update spec about Consul version on Linux.\n" }, { "from": "human", "value": "require \"spec_helper_#{ENV['SPEC_TARGET_BACKEND']}\"\n\ndescribe command('consul version') do\n its(:exit_status) { should eq 0 }\nend\n\ndescribe command('consul version'), :if => ['alp...
ruby
chosen
[ { "from": "system", "value": "Fix stupid typo in DATABASE_URL helper\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'bundler/setup'\n\nrequire 'rexml/document'\n\nrequire 'chie'\ninclude Chie\n\nRSpec.configure { |config|\n # some (optional) config here\n}\n\nCREDENTIALS = {\n ...
ruby
chosen
[ { "from": "system", "value": "Use modulesync to manage meta files\n" }, { "from": "human", "value": "require 'puppetlabs_spec_helper/module_spec_helper'\n\nRSpec.configure do |c|\n c.include PuppetlabsSpec::Files\n\n c.before :each do\n # Ensure that we don't accidentally cache facts and en...
ruby
chosen
[ { "from": "system", "value": "Set a very big stack number if we can't determine one.\n" }, { "from": "human", "value": "# Common spec-related code goes here\n\nSTACK_OVERFLOW_DEPTH = if RUBY_VERSION =~ /^(ruby |\\d+\\.\\d+\\.\\d+$)/\n def calculate_stack_overflow_depth(n)\n calculate_stack_o...
ruby
chosen
[ { "from": "system", "value": "Make test data random, to help uncover any surprising bugs\n" }, { "from": "human", "value": "ENV['RACK_ENV'] = 'test'\n\nrequire 'pathname'\nlib = Pathname.new(__FILE__).parent.parent.join('lib').to_s\n$LOAD_PATH << lib\nrequire 'capybara/rspec'\nrequire 'rack/test...
ruby
chosen
[ { "from": "system", "value": "Configure Webmock to allow HTTP requests to coveralls.io\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(\"../.....
ruby
chosen
[ { "from": "system", "value": "Reset Celluloid actors and logger settings before each spec.\n" }, { "from": "human", "value": "# Coverage\nrequire 'coveralls'\nCoveralls.wear! do\n add_filter 'spec'\nend\n\nrequire 'rspec/autorun'\nrequire 'msgr'\n\nDir[File.expand_path('../support/**/*.rb', __F...
ruby
chosen
[ { "from": "system", "value": "Fix test with mocking credentials\n" }, { "from": "human", "value": "require \"bundler/setup\"\nrequire \"kindle_manager\"\n\nRSpec.configure do |config|\n # Enable flags like --only-failures and --next-failure\n config.example_status_persistence_file_path = \".rs...
ruby
chosen
[ { "from": "system", "value": "Remove coverage filter for specs.\n\nDOH!\n" }, { "from": "human", "value": "# encoding: utf-8\nrequire 'thtx_serializer'\n\nif ENV['COVERAGE'] == 'true'\n require 'simplecov'\n require 'coveralls'\n\n SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[\n...
ruby
chosen
[ { "from": "system", "value": "[JLT-163581] Refactor uninstall recipes\n* Fixed bug in agents_package_uinstall recipe after last refactoring\n* Verified fix by running agents-package-uninstall-centos-6\n" }, { "from": "human", "value": "#\n# Cookbook Name:: dynatrace\n# Resource:: uninstall_packa...
ruby
chosen
[ { "from": "system", "value": "Clean logic for setting registerable edition state\n\n* Clarifies logic for setting registerable edition state\n" }, { "from": "human", "value": "class RegisterableEdition\n attr_accessor :edition\n\n def initialize(edition)\n @edition = edition\n end\n\n def...
ruby
chosen
[ { "from": "system", "value": "Modify school migration file to only pull from one Socrata API\n" }, { "from": "human", "value": "class CreateSchools < ActiveRecord::Migration\n def change\n create_table :schools do |t|\n \tt.string :program_code\n \tt.string :program_name\n \tt.strin...
ruby
chosen
[ { "from": "system", "value": "Update broken test from changing flow slug\n\nWe changed the coronavirus-find-support flow to find-coronavirus-support\n, however this test was added with then old path.\n" }, { "from": "human", "value": "require \"test_helper\"\nGovukTest.configure\n\nclass Session...
ruby
chosen
[ { "from": "system", "value": "Update libxml-ruby version to the latest\n\nI could not install or proceed with my catarse install due to this version failing on OSX." }, { "from": "human", "value": "#encoding: utf-8\n$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:...
ruby
chosen
[ { "from": "system", "value": "Use sign in url in main_app\n" }, { "from": "human", "value": "module Crowdblog\n class Controller < ActionController::Base\n layout 'crowdblog/crowdblog'\n before_filter :authorize!\n\n def authorize!\n redirect_to main_app.new_user_session_url unles...
ruby
chosen
[ { "from": "system", "value": "Handle resolution type better in DecisionsController.\n" }, { "from": "human", "value": "class DecisionsController < ApplicationController\n def show\n decision = co.decisions.find(params[:id])\n redirect_to proposal_path(decision.proposal)\n end\nend\n" }...
ruby
chosen
[ { "from": "human", "value": "Create some routes for questions\n" }, { "from": "gpt", "value": "get '/questions' do\n @questions = Question.all\n erb :'/questions/index'\nend\n\nget '/questions/new' do\n erb :'/questions/new'\n # <input type=\"hidden\" name=\"question[user_id]\" value=\"<%= c...
ruby
chosen
[ { "from": "system", "value": "Enable SSL to the remote console pods\n" }, { "from": "human", "value": "class MiqRemoteConsoleWorker < MiqWorker\n require_nested :Runner\n\n self.required_roles = ['remote_console']\n\n RACK_APPLICATION = RemoteConsole::RackServer\n STARTING_PORT = 5000\n\n...
ruby
chosen
[ { "from": "system", "value": "Update asset pre-compilation list to include more file types\n" }, { "from": "human", "value": "require 'open_conference_ware/dependencies'\n\nmodule OpenConferenceWare\n class Engine < ::Rails::Engine\n isolate_namespace OpenConferenceWare\n\n config.autoloa...
ruby
chosen
[ { "from": "system", "value": "Use flat_map instead of map followed by flatten\n\nNot only is this more idiomatic, [it's also better performance wise!][1]\n\n[1]: http://gistflow.com/posts/578-use-flat_map-instead-of-map-flatten\n" }, { "from": "human", "value": "require \"rubycritic/active_suppo...
ruby
chosen
[ { "from": "system", "value": "Fix 'NoMethodError merge for JSON::Ext::Generator::State'\n\nSee http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/3739dd637e038fa9\nAnd http://stackoverflow.com/questions/4934917/rails-json-conversion-error\n" }, { "from": "human", "value": "requ...
ruby
chosen
[ { "from": "system", "value": "Use Ruby 1.8-compatible syntax.\nAlso a minor refactor.\n" }, { "from": "human", "value": "require 'holidays'\n\nclass BusinessCalendar::HolidayDeterminer\n attr_reader :regions, :holiday_names, :additions, :removals, :additions_only\n\n def initialize(regions, ho...
ruby
chosen
[ { "from": "system", "value": "Use standard ruby method for defining tests\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass DictionaryTest < Test::Unit::TestCase\n include Spout::Tests\n\n # You may add additional tests here\n # test \"the truth\" do\n # assert true\n # en...
ruby
chosen
[ { "from": "system", "value": "Add thor to the dependencies (I forgot to do this earlier)\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'findrepos/version'\n\nGem::Specification.new ...
ruby
chosen
[ { "from": "system", "value": "Add small tests to cover a file reader being initialized with a file.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe RubyJawbone::FileReaders::Base do\n #\nend\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Ruby...
ruby
chosen
[ { "from": "system", "value": "Update for Node.js v4.8.2 and v6.10.2\n" }, { "from": "human", "value": "require 'spec_helper'\n\n# Node 4.x\nif property[:name] =~ /v4./\n describe command('node -v') do\n its(:stdout) { should contain('v4.8.1') }\n end\nend\n\n# Node 6.x\nif property[:name] =...
ruby
chosen
[ { "from": "system", "value": "Return empty result if no GIF found in \"API\"\n" }, { "from": "human", "value": "require 'net/http'\nrequire 'json'\nrequire 'pry'\n\nclass Gificiency\n\n def initialize\n @gifs = {}\n @categories = []\n @category_gifs = []\n\n @response = get_json\n ...
ruby
chosen
[ { "from": "human", "value": "Define the CLI using Thor\n" }, { "from": "gpt", "value": "require 'thor'\nrequire 'card'\nrequire 'yubioath'\nrequire 'yubioath/select'\n\nclass CLI < Thor\n CARD = Card.new(name: 'Yubico Yubikey NEO OTP+CCID')\n\n package_name 'yubioath'\n\n desc 'list', 'list c...
ruby
chosen
[ { "from": "system", "value": "Drop deployment target to 10.8\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"RPBorderlessSegmentedControl\"\n s.version = \"1.0.1\"\n s.summary = \"A replica of Xcode 5's toolbar segmented controls\"\n s.homep...
ruby
chosen
[ { "from": "human", "value": "Test ensure Chef can install\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\n# Make sure Chef installs\n\ndescribe command('curl -kL https://www.chef.io/chef/install.sh | bash') do\n its(:exit_status) { should eq 0 }\nend\n" } ]
ruby
chosen
[ { "from": "system", "value": "Make dummy app config require transam_sign (not transam_spatial)\n" }, { "from": "human", "value": "require File.expand_path('../boot', __FILE__)\n\n# Pick the frameworks you want:\nrequire \"active_record/railtie\"\nrequire \"action_controller/railtie\"\nrequire \"...
ruby
chosen
[ { "from": "system", "value": "Delete all content items before running requeue test\n\nThis test is brittle because if another test leaves a\ncontent item hanging arund, this test fails because it\nreads the first content item out of the database. This\nchange ensures we start with a clean slate.\n" }, {...
ruby
chosen