conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Raise errors in transactional callbacks\n" }, { "from": "human", "value": "require File.expand_path('../boot', __FILE__)\n\nrequire 'rails/all'\n\n# Require the gems listed in Gemfile, including any gems\n# you've limited to :test, :development, or :production.\nBun...
ruby
chosen
[ { "from": "system", "value": "Set default timezone, set AR to use local\n" }, { "from": "human", "value": "require File.expand_path('../boot', __FILE__)\n\nrequire 'csv'\nrequire 'rails/all'\n\n# Require the gems listed in Gemfile, including any gems\n# you've limited to :test, :development, or ...
ruby
chosen
[ { "from": "human", "value": "Add Photos module to support Photos API\n" }, { "from": "gpt", "value": "module Singleplatform\n class Client\n module Photos\n def photos_for(id, date = {}, options = {})\n url = generate_url(\"/location/#{id}/photos\", date.merge(options))\n ...
ruby
chosen
[ { "from": "system", "value": "Increase minimum Rake version to address security vulnerability\n\nWe got a Dependabot alert about CVE-2020-8130\n(https://github.com/advisories/GHSA-jppv-gw3r-w3q8). I have no idea if\nit affects us, but this is an easy fix.\n" }, { "from": "human", "value": "# cod...
ruby
chosen
[ { "from": "human", "value": "Add example of looking up customer by email address" }, { "from": "gpt", "value": "require 'chargify_api_ares'\n\nChargify.configure do |c|\n c.subdomain = ENV['CHARGIFY_SUBDOMAIN']\n c.api_key = ENV['CHARGIFY_API_KEY']\nend\n\n# Retrieve a customer\n\ncustomer =...
ruby
chosen
[ { "from": "system", "value": "Make minitest/spec more like rspec (context/describe)" }, { "from": "human", "value": "require \"bundler\"\n\nBundler.setup :default, :development\n\nrequire \"minitest/spec\"\nrequire \"minitest/mock\"\nrequire \"minitest/autorun\"\nrequire \"minitest-rg\"\n\nrequi...
ruby
chosen
[ { "from": "system", "value": "Fix test suite dependency on side effects\n\nAny spec run before base_spec.rb doesn't gain the benefits of\nbase_spec running `Chargify.configure` and therefore doesn't have\na site URI.\n" }, { "from": "human", "value": "$:.unshift File.expand_path('../lib', File.d...
ruby
chosen
[ { "from": "system", "value": "Handle noargs differently, be nice (silently ignore) ipv6, warn if no address found\n" }, { "from": "human", "value": "require 'ipaddress'\nmodule Puppet::Parser::Functions\n newfunction(:get_ipaddress, :type => :rvalue) do |args|\n if args[0].to_s.length > 0\n ...
ruby
chosen
[ { "from": "human", "value": "Test go with and without errors\n" }, { "from": "gpt", "value": "require 'spec_helper'\ninclude Bojangles\nrequire 'json'\ndescribe Bojangles do\n describe 'go!' do\n before :each do\n stub_request(:get, \"http://bustracker.pvta.com/InfoPoint/rest/stopdepart...
ruby
chosen
[ { "from": "system", "value": "Add a couple simple tests...\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe GitPlist do\n it \"has a version number\" do\n expect(GitPlist::VERSION).not_to be nil\n end\n\n it \"does something useful\" do\n expect(false).to eq(true)\...
ruby
chosen
[ { "from": "system", "value": "Check if current user exists in the database, if not, create new, add exception rescue'ing for loading YAML files.\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n$LOAD_PATH << './app/models/'\nrequire 'net/http'\nrequire 'uri'\nrequire 'active_record'\nrequ...
ruby
chosen
[ { "from": "system", "value": "Remove write statement from test\n" }, { "from": "human", "value": "# html 2.0 writer tests - document\n\n# History:\n# Stan Smith 2017-03-22 original script\n\nrequire 'minitest/autorun'\nrequire 'json'\nrequire 'adiwg-mdtranslator'\n\nclass TestHtmlDocument < Mi...
ruby
chosen
[ { "from": "system", "value": "Add a test for mark/cut, based on the find_boxes example.\n" }, { "from": "human", "value": "require \"test/unit\"\nrequire \"ambit\"\n\nclass TestAmbit < Test::Unit::TestCase\n\n def test_simple_default\n x = Ambit::choose([1, 2])\n Ambit::require x.even?\n ...
ruby
chosen
[ { "from": "system", "value": "Fix to get Travis running green on unit tests\n\nDue to https://github.com/mcanevet/rspec-puppet-facts/pull/53 some of our unti tests are failing\non Travis. This fix averts these errors for the meantime while still running the same test.\n" }, { "from": "human", "v...
ruby
chosen
[ { "from": "system", "value": "Fix missing `aggregate_id` in spec" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'sequent/test/event_handler_helpers'\n\ndescribe Sequent::Core::Workflow do\n include Sequent::Test::WorkflowHelpers\n\n class CreateNotification < Sequent::Core::Ba...
ruby
chosen
[ { "from": "system", "value": "Add spec to ensure that the middleware gets added to the right place\n" }, { "from": "human", "value": "describe Vagrant::Notify::Middleware do\n subject { described_class.new(@app, @env) }\n\n before do\n @app, @env = action_env(vagrant_env.vms.values.first.en...
ruby
chosen
[ { "from": "system", "value": "Update Java volume dir to 2013-004" }, { "from": "human", "value": "return unless node[\"platform\"] == \"mac_os_x\"\n\ndmg_package \"JavaForOSX\" do\n source \"http://support.apple.com/downloads/DL1572/en_US/\"\n volumes_dir \"Java for OS X 2013-003\"\n action :...
ruby
chosen
[ { "from": "system", "value": "Remove post install message 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 'nehm/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Remove the gemspec's test_files directive\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = %q{factory_girl_rails}\n s.version = '4.5.0'\n s.authors = [\"Joe Ferris\"]\n s.email = %q{jferris@thoughtbot.com}\n s.hom...
ruby
chosen
[ { "from": "system", "value": "Set available_locales to [:bg] and add config.site_url\n" }, { "from": "human", "value": "require File.expand_path('../boot', __FILE__)\n\nrequire \"active_model/railtie\"\nrequire \"active_record/railtie\"\nrequire \"action_controller/railtie\"\nrequire \"action_ma...
ruby
chosen
[ { "from": "system", "value": "Add rsvp to the precompile directive\n" }, { "from": "human", "value": "require File.expand_path('../boot', __FILE__)\n\nrequire 'rails/all'\n\n# Require the gems listed in Gemfile, including any gems\n# you've limited to :test, :development, or :production.\nBundle...
ruby
chosen
[ { "from": "system", "value": "Revert \"updated pod spec file\"\n\nThis reverts commit 9f5d5efd9f2c94027a40fbdbe891edd873a9853f.\n" }, { "from": "human", "value": "Pod::Spec.new do |spec|\n spec.name = \"Disqus\"\n spec.version = “0.0.3”\n spec.summary = \"iOS Disqus API\"\n ...
ruby
chosen
[ { "from": "system", "value": "Fix update account routing key\n" }, { "from": "human", "value": "class GramAccountUpdatedMessageHandler < GorgService::Consumer::MessageHandler::EventHandler\n # Respond to routing key: request.gapps.create\n\n def process\n proxy_msg=message.dup\n proxy_ms...
ruby
chosen
[ { "from": "system", "value": "Fix `url` stanza comment for Lockdown.\n" }, { "from": "human", "value": "cask 'lockdown' do\n version '1.0.0'\n sha256 '047f377e2a9495361084268c86cc80719e123bd8958d69fe51cd2be0d7ffd764'\n\n # bitbucket.org/objective-see/deploy was verified as official when first...
ruby
chosen
[ { "from": "system", "value": "Add dependency on core as use logging infrastructure as well\n" }, { "from": "human", "value": "#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the...
ruby
chosen
[ { "from": "system", "value": "Use latest working recipe version\n" }, { "from": "human", "value": "app = search(:aws_opsworks_app).first\n\napplication app[\"shortname\"] do\n path \"/srv/#{app['shortname']}\"\n packages [\"git\"]\n\n repository app[\"app_source\"][\"url\"]\n\n nodejs do\n ...
ruby
chosen
[ { "from": "system", "value": "Add libghc-zlib-dev to list of pre-installed packages\n" }, { "from": "human", "value": "#\n# Cookbook Name:: et_fog\n# Recipe:: default\n#\n# Copyright (C) 2013 EverTrue, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not us...
ruby
chosen
[ { "from": "system", "value": "Set up swap before setting up the services\n" }, { "from": "human", "value": "#\n# Cookbook Name:: appserver\n# Recipe:: default\n#\n\ninclude_recipe 'timezone-ii'\ninclude_recipe 'apt'\ninclude_recipe 'zsh'\ninclude_recipe 'git'\ninclude_recipe 'chef-solo-search'\n...
ruby
chosen
[ { "from": "system", "value": "Add some documentation to MessageGroup\n" }, { "from": "human", "value": "module Danger\n class MessageGroup\n def initialize(file: nil, line: nil)\n @file = file\n @line = line\n end\n\n def same_line?(other)\n other.file == file && other.l...
ruby
chosen
[ { "from": "human", "value": "Add forgotten Devise column remember_created_at.\nCloses GH-365." }, { "from": "gpt", "value": "class AddRememberCreatedAtToUsers < ActiveRecord::Migration\n def self.up\n add_column :users, :remember_created_at, :datetime\n end\n\n def self.down\n remove_co...
ruby
chosen
[ { "from": "system", "value": "Refactor to use `find_hole` base class method\n" }, { "from": "human", "value": "module RubyOS::Memory\n class FirstFitManager < Manager\n def assign_process_base_address(process)\n super\n # Find the first available address\n starting_address, _ ...
ruby
chosen
[ { "from": "system", "value": "Add `attained_level_title` to Dataset show method\n" }, { "from": "human", "value": "xml.instruct! :xml, :version => \"1.0\" \nxml.feed :xmlns => \"http://www.w3.org/2005/Atom\", \"xmlns:dc\" => \"http://purl.org/dc/elements/1.1/\" do\n xml.author do\n xml.name...
ruby
chosen
[ { "from": "system", "value": "Update Hexp to recommended syntax\n" }, { "from": "human", "value": "require 'tempfile'\n\nmodule Slippery\n module Processors\n # Turn embedded dot files into embedded SVGs\n class GraphvizDot\n def initialize(selector = '.language-dot')\n @selec...
ruby
chosen
[ { "from": "system", "value": "Delete too-large notification event headers\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nif (Rails.env.test? || Rails.env.development?) && Rails.logger.level == 0\n ActiveSupport::Notifications.subscribe(/racing_on_rails/) do |name, start, fi...
ruby
chosen
[ { "from": "human", "value": "MIGRATION: Fix venues latitude/longitude on MySQL.\n\nBefore, the schema used a default \"decimal\" column for these. Unfortunately,\nMySQL interprets this as 10 digits, decimal and NO digits, which is crazy.\n\nNow, the schema is 3 digits, decimal and 4 digits.\n" }, { ...
ruby
chosen
[ { "from": "system", "value": "Add passing specs for notification rules controller\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Users::NotificationRulesController do\n\nend\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Users::NotificationRu...
ruby
chosen
[ { "from": "human", "value": "Add a spec for GithubPullRequestFormatter\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\nmodule Pronto\n module Formatter\n describe GithubPullRequestFormatter do\n let(:formatter) { described_class.new }\n\n let(:repo) { Pronto::Git::Reposit...
ruby
chosen
[ { "from": "system", "value": "Add specs covering more of the logic on attribute definition.\n" }, { "from": "human", "value": "require 'spec_helper'\n\nRSpec.describe DMV::Form do\n subject(:form_class) { Class.new(described_class) }\n\n describe '.attribute' do\n it 'adds the attribute to ...
ruby
chosen
[ { "from": "system", "value": "Expand path to handle tilde" }, { "from": "human", "value": "require 'fileutils'\n\n$api_key = 'a35a2a72bd230ac0aa0f52715bbdc6aa'\n\nMaze.hooks.before do\n if Maze.config.os == 'macos'\n $logger.info 'Clearing '\n FileUtils.rm_rf('~/Library/Application Suppor...
ruby
chosen
[ { "from": "human", "value": "Add spec for API stores controller\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe 'Storefront API v2 Stores spec', type: :request do\n let!(:store) { create(:store) }\n\n describe 'stores#show' do\n context 'with code param' do\n before ...
ruby
chosen
[ { "from": "system", "value": "Add video route for testing\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n\n root 'hub#index'\n\n get '/projects/results' => 'projects#results'\n resources :users, except: [:index, :destroy, :new]\n\n resources :projects do\n resources ...
ruby
chosen
[ { "from": "system", "value": "Put up the “Pardon our dust...” sign :P " }, { "from": "human", "value": "Rails.application.routes.draw do\n\n resources :visits\n resource :trending\n resources :dependencies\n resources :logs\n\n # root 'errors#pardon'\n # get '/*any_route', to: 'errors#pard...
ruby
chosen
[ { "from": "system", "value": "Add collections controller and view.\n" }, { "from": "human", "value": "Spree::Core::Engine.routes.draw do\nend\n\nSpree::Core::Engine.routes.prepend do\n get '/collections', to: 'collections#index'\nend\n" }, { "from": "gpt", "value": "Spree::Core::Eng...
ruby
chosen
[ { "from": "system", "value": "Update google-api-client requirement from >= 0.23.9, < 0.37.0 to >= 0.23.9, < 0.38.0\n\nUpdates the requirements on [google-api-client](https://github.com/google/google-api-ruby-client) to permit the latest version.\n- [Release notes](https://github.com/google/google-api-ruby-c...
ruby
chosen
[ { "from": "human", "value": "Add uncaptured amount to payments table\n" }, { "from": "gpt", "value": "class AddUncapturedAmountToPayments < ActiveRecord::Migration\n def change\n add_column :spree_payments, :uncaptured_amount, :decimal, precision: 10, scale: 2, default: 0.0\n end\nend\n" ...
ruby
chosen
[ { "from": "system", "value": "Update the link to the download page." }, { "from": "human", "value": "module DocumentationHelper\n def render_plugin_doc(file)\n if File.directory?(file)\n if File.exists?(file + '/README')\n render :inline => markup(File.read(file + '/README'))\n ...
ruby
chosen
[ { "from": "system", "value": "Make sure we add order only when order has transitionned to state Complete\n" }, { "from": "human", "value": "Spree::Order.class_eval do\n has_one :source, class_name: 'Spree::Chimpy::OrderSource'\n\n register_update_hook :notify_mail_chimp\n\n around_save :handl...
ruby
chosen
[ { "from": "system", "value": "Use the un-proxied version of geoserver API\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'ostruct'\n\nrequire 'sinatra' unless defined?(Sinatra)\n\nconfigure do\n SiteConfig = OpenStruct.new(\n :title => 'UVA Library Geoportal',\n :descripti...
ruby
chosen
[ { "from": "system", "value": "Add as_json method for use in rails\n" }, { "from": "human", "value": "require \"httparty\"\nrequire \"icalendar\"\nrequire \"bank_holidays/version\"\n\nmodule BankHolidays\n DEFAULT_URL = \"https://www.gov.uk/bank-holidays/england-and-wales.ics\"\n def self.all(u...
ruby
chosen
[ { "from": "system", "value": "Set value field id to string in a document" }, { "from": "human", "value": "require 'json'\n\nmodule Cenit\n class Handler\n\n attr_accessor :payload, :parameters, :request_id, :model\n\n def initialize(message, model=nil)\n self.payload = ::JSON.p...
ruby
chosen
[ { "from": "system", "value": "Remove useless method. Resource will simply check for the method before calling instead of requring it.\n" }, { "from": "human", "value": "module DAV4Rack\n class Lock\n \n def initialize(args={})\n @args = args\n @store = nil\n @args[:created_...
ruby
chosen
[ { "from": "system", "value": "Fix ember-source to handle non-RCs\n" }, { "from": "human", "value": "module Ember\n extend self\n\n VERSION = File.read(File.expand_path('../../../VERSION', __FILE__)).strip\n\n # we might want to unify this with the ember version string,\n # but consistency?\n...
ruby
chosen
[ { "from": "human", "value": "Copy bin definition from fog" }, { "from": "gpt", "value": "class Local < Fog::Bin\n class << self\n def class_for(key)\n case key\n when :storage\n Fog::Storage::Local\n else\n raise ArgumentError, \"Unsupported #{self} service: #{ke...
ruby
chosen
[ { "from": "system", "value": "Remove brackets from load_calculators call\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'bundler/setup'\n\nrequire './lib/calculatorapp.rb'\nrequire './lib/calculatorloader.rb'\nrequire './lib/calculatorrouter.rb'\n\nCalculatorApp.configure do |app...
ruby
chosen
[ { "from": "system", "value": "Use Kernel.const_get instead of eval" }, { "from": "human", "value": "module IsApprovable\n def is_approvable(*opts)\n @reported_fields_on_approval = (opts.empty? ? [ :id, :created_at ] : opts )\n include InstanceMethods\n extend ClassMethods\n end\n\n m...
ruby
chosen
[ { "from": "system", "value": "Allow more memcached socket failure retries\n\nThe default consecutive socket_max_failures is 2. Since we don't have a failover\nmemcached to use when one is down, we need to try harder to allow this client to\nretry memcached before marking it failed.\n\nThe client options are...
ruby
chosen
[ { "from": "system", "value": "Reimplement aspect if methods are redefined\n\nNow it's possible to redefine a method without necessity of redefine the\naspect (thread-safe)\n" }, { "from": "human", "value": "require \"simple_aspect/version\"\n\nmodule SimpleAspect\n def self.extended(base)\n ...
ruby
chosen
[ { "from": "system", "value": "Use symbols in hash instead of string.\n" }, { "from": "human", "value": "module Tinify\n class Source\n class << self\n def from_file(path)\n from_buffer(File.open(path, \"rb\") { |file| file.read })\n end\n\n def from_buffer(string)\n ...
ruby
chosen
[ { "from": "system", "value": "Convert description in this way: .md -> .html -> escape it\n" }, { "from": "human", "value": "xml.instruct! :xml, :version => \"1.0\"\nxml.rss :version => \"2.0\", \"xmlns:itunes\" => \"http://www.itunes.com/dtds/Podcast-1.0.dtd\" do\n xml.channel do\n xml.title...
ruby
chosen
[ { "from": "system", "value": "Remove old fields from lib\n" }, { "from": "human", "value": "module PermitParams\n def permit_params\n params.require(:permit).permit(\n :owner_name, \n :owner_address, \n :addition, \n :house_area, \n :addition_area, \n :ac, \n :contractor,...
ruby
chosen
[ { "from": "system", "value": "Change default log level from debug to fatal\n" }, { "from": "human", "value": "require 'json'\n\nmodule Slatan\n ## Class to retain configure for slatan\n class Spirit\n # about Slack\n @slack_api_url = 'https://slack.com/api'\n @slack_token = 'xxxxx-xxx...
ruby
chosen
[ { "from": "human", "value": "Create rake task to generate slug for objects that use Sluggable concern\n\nWhy:\n\n* Once slug presence validation and usage is merged on to a code base, existing objects without it will become invalid and unusable\n\nHow:\n\n* Running `bundle exec slugs:gnerate` will look for ...
ruby
chosen
[ { "from": "system", "value": "Remove coerce_value helper as it's not shared\n" }, { "from": "human", "value": "module SysctlCookbook\n module SysctlHelpers\n module Param\n def set_sysctl_param(key, value)\n o = shell_out(\"sysctl #{'-e ' if new_resource.ignore_error}-w \\\"#{key...
ruby
chosen
[ { "from": "system", "value": "Remove ruby 2.3.x specific calls\n" }, { "from": "human", "value": "require 'nokogiri'\n\nclass Fetcher\n attr_reader :document\n\n def initialize(html_document)\n @document = Nokogiri::HTML(html_document)\n end\n\n def copyright\n text = fetch_by_tags || ...
ruby
chosen
[ { "from": "system", "value": "Fix formatting of packages-additional spec for Ruby 2.1\n" }, { "from": "human", "value": "describe 'config-driven-helper::packages-additional' do\n context 'additional packages are defined' do\n cached(:chef_run) do\n ChefSpec::SoloRunner.new do |node|\n ...
ruby
chosen
[ { "from": "system", "value": "Document in tests that verify/decrypt returns object responding to payload.\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass TokieClassLevelSecretTest < ActiveSupport::TestCase\n setup do\n @token = Tokie::Token.new('payload')\n end\n\n test \...
ruby
chosen
[ { "from": "human", "value": "Add xvfb cookbook (needed by capybara-webkit + the headless gem)\n" }, { "from": "gpt", "value": "#\n# Cookbook Name:: xvfb\n# Recipe:: default\n# Copyright 2011, Travis CI development team\n#\n# Permission is hereby granted, free of charge, to any person obtaining a...
ruby
chosen
[ { "from": "system", "value": "Use the result of the command, not its success status\n" }, { "from": "human", "value": "require 'fileutils'\nrequire 'open3'\n\nclass Repository\n def index_modified?\n ! system('git diff-index --cached --quiet HEAD --ignore-submodules --')\n end\n\n def prep...
ruby
chosen
[ { "from": "system", "value": "Fix compatibility with Sprockets 3\n" }, { "from": "human", "value": "module EvilBlocks\n # Change Slim options to support @data-role shortcut.\n def self.install_to_slim!\n # Add @data-role alias to Slim.\n #\n # Copy from role-rails by Sasha Koss.\n ...
ruby
chosen
[ { "from": "system", "value": "Migrate shared API Subject specs from Gumboot\n\nWe intend to override how ApiSubject is implemented in order to store a\ntoken for API authentication along with x509_cn as currently\nimplemented.\n\nTo support this we need to modify all associated specs locally as this\nchange...
ruby
chosen
[ { "from": "human", "value": "Fix creating children in after_* callbacks\n\nPreviously creating children in an after_* callback would cause the\nchild's ancestry column to contain just the parent id and not the entire\nancestry path.\n\nA workaround was to call self.reload in the after_* callback, but this\n...
ruby
chosen
[ { "from": "system", "value": "Remove status since faraday does not provide message and it does not\nseem to be in use\n" }, { "from": "human", "value": "module Postnord\n class Response\n def initialize(data)\n @data = data\n @code = data.status\n @status = data.msg\n end\n...
ruby
chosen
[ { "from": "system", "value": "Use MultiJson for generating JSON\n" }, { "from": "human", "value": "module RedisBrowser\n module WebHelpers\n def root_path\n \"#{env['SCRIPT_NAME']}/\"\n end\n\n def js_env\n jsEnv = {\n root_path: \"#{root_path}\"\n }\n\n \"js...
ruby
chosen
[ { "from": "system", "value": "Bump a minor 1.0.1 release to pass specs.\n" }, { "from": "human", "value": "module Rgversion\n VERSION = \"1.0.0\".freeze\n PREVIOUS_VERSION = \"0.2.2\".freeze\nend\n" }, { "from": "gpt", "value": "module Rgversion\n VERSION = \"1.0.1\".freeze\n PRE...
ruby
chosen
[ { "from": "system", "value": "Fix stubbing the wrong method in the case converter spec\n" }, { "from": "human", "value": "require File.expand_path('../../spec_helper', __FILE__)\n\nmodule ProjectSpecs\n describe CaseConverter do\n it 'converts a name to the plist format' do\n result = C...
ruby
chosen
[ { "from": "human", "value": "Add blather client stub class.\n" }, { "from": "gpt", "value": "# A simple stub for Blather::Client that can register and trigger\n# events.\n#\n# The event trigger methods return an array with the return values of the\n# callback invocations.\nclass BlatherClientStu...
ruby
chosen
[ { "from": "system", "value": "Fix gemspec to include README.md instead of README.rdoc\n" }, { "from": "human", "value": "# encoding: UTF-8\n\n$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"single_sign_on_client/version\"\n\n# Describe your gem and dec...
ruby
chosen
[ { "from": "system", "value": "Add ** when calling commit\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule RubyEventStore\n module ROM\n class UnitOfWork\n attr_reader :env\n\n def initialize(rom: ROM.env)\n @env = rom\n end\n\n def call(**...
ruby
chosen
[ { "from": "system", "value": "Switch NetDispatcher test to {TCP,UDP}Addr\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'socket'\nrequire_relative '../test_helper'\nrequire_relative '../../lib/kamerling/addr'\nrequire_relative '../../lib/kamerling/net_dispatcher'\n\n...
ruby
chosen
[ { "from": "system", "value": "Fix missing helper function keyed_hash()\n" }, { "from": "human", "value": "# SONATA - Gatekeeper\n#\n# Copyright 2015-2017 Portugal Telecom Inovacao/Altice Labs\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file exc...
ruby
chosen
[ { "from": "system", "value": "Check that query is alias of attribute method\n" }, { "from": "human", "value": "require 'time_for_a_boolean'\n\ndescribe TimeForABoolean do\n it 'defines the attribute method' do\n klass.time_for_a_boolean :attribute\n\n expect(klass.new).to respond_to :attr...
ruby
chosen
[ { "from": "system", "value": "Update Api Spec for supported_versions Method\n\nAdd the supported_verisons method to the Api spec.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Tomcat::Manager::Api do\n subject { Tomcat::Manager::Api }\n\n it \"can create a new instance\"...
ruby
chosen
[ { "from": "system", "value": "feat: Add message API and tests\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Chatwork::Message do\n it 'can list messages according to chatroom'\n it 'can retrieve message from chatroom'\n it 'can create message to chatroom'\nend\n" }, ...
ruby
chosen
[ { "from": "system", "value": "Fix return of mock API for existing monitor\n" }, { "from": "human", "value": "require 'sinatra/base'\n\nclass FakeCronitor < Sinatra::Base\n get '/v1/monitors/:id' do\n if ['abcd', 'Test Cronitor'].include? params['id']\n json_response 200, 'existing_monit...
ruby
chosen
[ { "from": "system", "value": "Reset i18n locale back to en in specs\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'Translations' do\n\n before :all do\n I18n.backend.store_translations :en, :test_number => \"Test number %{number}\"\n I18n.locale=:ca\n end\n\n it \...
ruby
chosen
[ { "from": "human", "value": "Add initial spec for redhat\n" }, { "from": "gpt", "value": "# -*- encoding: utf-8 -*-\n\n# Copyright 2013 Mirantis, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the Licen...
ruby
chosen
[ { "from": "human", "value": "Add a spec for the S3 error index.\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe FakeAWS::S3::ErrorIndex do\n\n context \".error_for_code\" do\n it \"returns something containing a description and status code for a known error\" do\n err...
ruby
chosen
[ { "from": "system", "value": "Add a remind to the reviewit developer.\n" }, { "from": "human", "value": "module Reviewit\n class Action\n def initialize(api)\n @api = api\n\n @options = parse_options\n end\n protected\n attr_reader :api\n\n def read_user_message\n re...
ruby
chosen
[ { "from": "system", "value": "Allow format to be passed to Totals.format\n" }, { "from": "human", "value": "module Totals\n module Formatter\n attr_reader :seconds\n\n def initialize(seconds)\n @seconds = seconds.to_i\n end\n end\n\n class DigitalFormatter\n include Formatter...
ruby
chosen
[ { "from": "system", "value": "Verify if model is not nil so it can be rendered\n" }, { "from": "human", "value": "module Travis::API::V3\n class Renderer::Subscription < ModelRenderer\n representation(:standard, :id, :valid_to, :plan, :coupon, :status, :source, :owner, :billing_info, :credit...
ruby
chosen
[ { "from": "system", "value": "Change default key assignment for status.like to F\n" }, { "from": "human", "value": "require 'twterm/key_mapper/abstract_key_mapper'\n\nclass Twterm::KeyMapper::StatusKeyMapper < Twterm::KeyMapper::AbstractKeyMapper\n DEFAULT_MAPPINGS = {\n compose: '^N',\n ...
ruby
chosen
[ { "from": "system", "value": "Allow Tag creation on partial match\n" }, { "from": "human", "value": "class Tag < ApplicationRecord\n extend FriendlyId\n\n has_many :articles_tags, dependent: :destroy\n has_many :articles, through: :articles_tags, counter_cache: :articles_count\n\n validates ...
ruby
chosen
[ { "from": "system", "value": "Refactor Commands::New a bit and remove scaffold post once copied.\n" }, { "from": "human", "value": "require 'erb'\n\nmodule Jekyll\n module Commands\n class New < Command\n \n def self.process(args)\n path = File.expand_path(args.join(\" \"), Di...
ruby
chosen
[ { "from": "system", "value": "Update for latest versions of Node.js\n" }, { "from": "human", "value": "require 'spec_helper'\n\n# Node 12.x\nif property[:name] =~ /v0.12./\n describe command('node -v') do\n its(:stdout) { should contain('v0.12.15') }\n end\nend\n\n# Node 4.x\nif property[:n...
ruby
chosen
[ { "from": "system", "value": "Replace User model with Deed" }, { "from": "human", "value": "module PageObjects\n class DeedForm < Base\n def trash_bags=(number)\n this.fill_in(User.human_attribute_name(:trash_bags), with: number)\n end\n\n def miles_walked=(number)\n this.fil...
ruby
chosen
[ { "from": "system", "value": "Remove puppet_module_install in favor of copy_module_to\n" }, { "from": "human", "value": "require 'beaker-rspec/spec_helper'\nrequire 'beaker-rspec/helpers/serverspec'\n\nUNSUPPORTED_PLATFORMS = []\n\nunless ENV['RS_PROVISION'] == 'no' or ENV['BEAKER_provision'] ==...
ruby
chosen
[ { "from": "human", "value": "Add some spec for mixed soup parsing\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Wptemplates do\n \n it \"parses link, text, template\" do\n parsed = subject.parse(\"[[foo]] bar {{baz}}\")\n expect(parsed.length).to eq(3)\n expect(pa...
ruby
chosen
[ { "from": "system", "value": "Add correct dependencies in gemspec\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)\nrequire 'ooxml_parser/version'\nGem::Specification.new do |s|\n s.name = 'ooxml_parser'\n s.version = OoxmlParser::Version::S...
ruby
chosen
[ { "from": "system", "value": "Clarify do not support lower version of fluentd than v0.10.45\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Update failure message with actual directory location\n" }, { "from": "human", "value": "require 'spec_helper'\n\nRSpec.describe 'sprout-vim' do\n it 'installs MacVim, adds the .vim directory, and installs tmux' do\n brew_installed = system('which brew')\n\n ...
ruby
chosen