conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Set default values for BankAccount\n" }, { "from": "human", "value": "module Exact\n class BankAccount < Base\n include ActiveModel::Model\n include Virtus.model\n\n EXACT_SERVICE = 'crm'\n EXACT_GUID = 'ID'\n\n attribute :Account, S...
ruby
chosen
[ { "from": "system", "value": "Change Guillotine to return a response to make it easier to test." }, { "from": "human", "value": "require \"guillotine/engine\"\n\nmodule Guillotine\n def self.execute opts, command_string\n command_array = command_string.downcase.gsub(/[^a-z\\s]/, '').split ' ...
ruby
chosen
[ { "from": "system", "value": "Write integration tests for terminal silhouettes\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass TerminalSilhouetteFlowsTest < ActionDispatch::IntegrationTest\n # projects/terminal-silhouettes\n \n # REDIRECTS\n\n # various terminal silhouette ...
ruby
chosen
[ { "from": "human", "value": "NSL-2006: Add test for unpub citation.\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n# Copyright 2015 Australian National Botanic Gardens\n#\n# This file is part of the NSL Editor.\n#\n# Licensed under the Apache License, Version 2.0 (the \"Li...
ruby
chosen
[ { "from": "system", "value": "Add 'gem 'aws-sdk' as a gem 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 'fastlane/plugin/upload_folder_to_s3/version'\n\nGem::Specificat...
ruby
chosen
[ { "from": "system", "value": "Deploy the branch for now.\n" }, { "from": "human", "value": "# Setup our multi-stage environments.\nrequire \"capistrano/ext/multistage\"\n\nrequire \"capistrano_nrel_ext/recipes/defaults\"\nrequire \"capistrano_nrel_ext/recipes/gem_bundler\"\nrequire \"capistrano_...
ruby
chosen
[ { "from": "system", "value": "Fix nameless root routing error\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n get 'sessions/create'\n\n get 'sessions/destroy'\n\n # get 'users/create'\n\n # get 'users/update'\n\n # get 'users/destroy'\n\n # The priority is based upon ...
ruby
chosen
[ { "from": "system", "value": "Fix homepage to use SSL in Terraform Cask\n\nThe HTTP URL is already getting redirected to HTTPS. Using the HTTPS URL directly\nmakes it more secure and saves a HTTP round-trip.\n" }, { "from": "human", "value": "cask :v1 => 'terraform' do\n version '0.5.3'\n sha2...
ruby
chosen
[ { "from": "system", "value": "Kill mutant by simplifying the method\n\nThat whole anonymous module is completely unnecessary\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule RailsEventStore\n module AsyncHandler\n def self.with_defaults\n Module.new do\n ...
ruby
chosen
[ { "from": "system", "value": "Make it easy to get label color\n" }, { "from": "human", "value": "require 'psd/layer_info'\n\nclass PSD\n class SheetColor < LayerInfo\n def self.should_parse?(key)\n key == 'lclr'\n end\n\n def parse\n @data = [\n @file.read_short,\n ...
ruby
chosen
[ { "from": "system", "value": "Update failing user request specs\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe 'users API', type: :request do\n before(:each) do\n @user = create(:user)\n end\n\n describe 'GET /api/user' do\n it 'has auth: false for anonymous...
ruby
chosen
[ { "from": "system", "value": "Fix how we fetch the ID of the order from the hook\n" }, { "from": "human", "value": "module Spree\n module Retail\n module Shopify\n module Hooks\n class OrdersController < HooksController\n def create\n shopify_order = ShopifyAP...
ruby
chosen
[ { "from": "system", "value": "Unpublish policy area rake task now handles multiple ones\n\nWe have to unpublish all policy areas and to make that task easier\nand less error prone, the rake task was update to take a JSON file\nwith policy_area_paths:\n\n[{policy_area_path: ..., taxon_path: ....}]\n" }, ...
ruby
chosen
[ { "from": "system", "value": "Add fakeredis if Redis is enabled, force RACK_ENV=test, load the environment (initializers and lib)" }, { "from": "human", "value": "# encoding: UTF-8\n\nrequire 'bundler'\n\nBundler.setup\nBundler.require\n\nrequire 'minitest/pride'\nrequire 'minitest/autorun'\nreq...
ruby
chosen
[ { "from": "system", "value": "Rewrite Command::ShutdownVm. This was using old style of models.\n" }, { "from": "human", "value": "\nclass Wakame::Command::ShutdownVm\n include Wakame::Command\n\n command_name 'shutdown_vm'\n\n def run(rule)\n registered_agents = rule.agent_monitor.register...
ruby
chosen
[ { "from": "system", "value": "Add security group rule methods to security group model.\n" }, { "from": "human", "value": "require 'fog/core/model'\n\nmodule Fog\n module Compute\n class HP\n\n class SecurityGroup < Fog::Model\n\n identity :id\n\n attribute :name\n ...
ruby
chosen
[ { "from": "human", "value": "Update agreement_transaction_audit_id primary key to bigint\n" }, { "from": "gpt", "value": "class ChangeAgreementTransactionAuditIdToBigint < ActiveRecord::Migration[6.0]\n def up\n change_column :agreement_transaction_audits, :id, :bigint\n end\n\n def down\n...
ruby
chosen
[ { "from": "system", "value": "Remove xhr and xml_http_request due to rails 5 deprecation warning\n" }, { "from": "human", "value": "module Rails\n module Controller\n module Testing\n module Integration\n %w(\n get post patch put head delete xml_http_request\n x...
ruby
chosen
[ { "from": "human", "value": "Add state_id index to visualizations\n" }, { "from": "gpt", "value": "Sequel.migration do\n up do\n alter_table :visualizations do\n add_index :state_id\n end\n end\n\n down do\n alter_table :visualizations do\n drop_index :state_id\n end\n ...
ruby
chosen
[ { "from": "system", "value": "Refactor -- do not expose when not used.\n" }, { "from": "human", "value": "module RubyEventStore\n class ExpectedVersion\n POSITION_DEFAULT = -1.freeze\n NOT_RESOLVED = Object.new.freeze\n\n def self.any\n new(:any)\n end\n\n def self.none\n ...
ruby
chosen
[ { "from": "system", "value": "Change the Order of Application by Complete attribute.\n" }, { "from": "human", "value": "class Application < ActiveRecord::Base\n attr_accessible :complete, :number, :user_id\n\n validates_presence_of :number, :user_id\n validates_uniqueness_of :number\n\n belo...
ruby
chosen
[ { "from": "system", "value": "Update example use in classification set spec\n" }, { "from": "human", "value": "require 'spec_helper'\n\ninclude Support::ResourceExamples\n\ndescribe Fulcrum::ClassificationSet do\n include_context 'with client'\n include_context 'with resource'\n\n let(:resour...
ruby
chosen
[ { "from": "system", "value": "Remove probably uneeded ams declaration.\n" }, { "from": "human", "value": "module StandardTasks\n class EthicsTask < Task\n include MetadataTask\n\n title \"Add Ethics Statement\"\n role \"author\"\n\n def active_model_serializer\n TaskSerializer\...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.2.2.0 to 0.2.3.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'metrics-stream-divergence'\n s.version = '0.2.2.0'\n s.summary = 'Measurement of divergence in time of the...
ruby
chosen
[ { "from": "system", "value": "Reduce verbosity of WEBrick logs during tests\n" }, { "from": "human", "value": "require 'webrick/https'\n\n# This context runs an OpenSSL::SSL:SSLServer that is accessible to tests. The\n# `ssl_server_port` and `ssl_server_address` will need to be specified before...
ruby
chosen
[ { "from": "system", "value": "Update React Native documentation (0.28)\n" }, { "from": "human", "value": "module Docs\n class ReactNative < React\n self.name = 'React Native'\n self.slug = 'react_native'\n self.type = 'react'\n self.release = '0.27'\n self.base_url = 'https://fac...
ruby
chosen
[ { "from": "system", "value": "Update Akonadi to version 1.3.1.\n" }, { "from": "human", "value": "require 'formula'\n\nclass Akonadi <Formula\n url 'http://download.akonadi-project.org/akonadi-1.3.0.tar.bz2'\n homepage 'http://pim.kde.org/akonadi/'\n md5 '45fe59bd301268149cb0313d54a98520'\n\n...
ruby
chosen
[ { "from": "system", "value": "Use the right string types\n" }, { "from": "human", "value": "class Diamond < Formula\n homepage 'https://github.com/RubyNative/Diamond'\n\n # There are no release tags yet\n head 'https://github.com/RubyNative/Diamond.git'\n\n def install\n system 'xcrun', \...
ruby
chosen
[ { "from": "system", "value": "Remove Rack::Lock not only if coap.only\n" }, { "from": "human", "value": "require 'david/resource_discovery_proxy'\nrequire 'david/show_exceptions'\n\nmodule David\n module Railties\n class Middleware < Rails::Railtie\n UNWANTED = [\n ActionDispatch...
ruby
chosen
[ { "from": "system", "value": "Fix switchtower deployment generator to use lib/tasks instead of config/tasks\n\n\ngit-svn-id: 1de83279c7ce3921210267b158a3abf93ac92a20@2207 5ecf4fe2-1ee6-0310-87b1-e25e094e27de\n" }, { "from": "human", "value": "class DeploymentGenerator < Rails::Generator::NamedBa...
ruby
chosen
[ { "from": "system", "value": "Set 'type' param for Messages\n" }, { "from": "human", "value": "class MForwd::Item::Merge::Summary < MForwd::Item::Merge::Base\n # @param stash [Hash] MForwd::Item#id => Hash of Array of MForwd::Item\n def merge_items id, stash\n params = {}\n\n kinds = sta...
ruby
chosen
[ { "from": "system", "value": "Add all necessary scopes and methods\n" }, { "from": "human", "value": "module Schnitzelpress\n module Model\n class Post\n include DataMapper::Resource\n\n property :id, Serial\n property :published_at, DateTime, :key => true\n p...
ruby
chosen
[ { "from": "system", "value": "Fix deprecation warning when using Rails 6 in zeitwerk mode\n\nThe engine initialization was causing this error to be logged:\nDEPRECATION WARNING: Initialization autoloaded the constants\nActionText::ContentHelper and ActionText::TagHelper.\n\nsee this rails issue for mroe inf...
ruby
chosen
[ { "from": "system", "value": "Make the queue a class_attribute.\n" }, { "from": "human", "value": "require 'thread'\nrequire 'hubble'\n\nmodule Travis\n class Hub\n class ErrorReporter\n attr_reader :queue, :thread\n\n def initialize\n @queue = Queue.new\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Remove unused configuration option. It is not present in Rails 3.1 and so causes the integration tests to fail.\n" }, { "from": "human", "value": "Serenity30::Application.configure do\n # Settings specified here will take precedence over those in config/application...
ruby
chosen
[ { "from": "system", "value": "Change how ColorModes classes are built\n" }, { "from": "human", "value": "module Chroma\n module ColorModes\n class << self\n private\n\n def build(*attrs)\n Class.new do\n attr_accessor *(attrs + [:a])\n\n class_eval <<-EOS\n...
ruby
chosen
[ { "from": "system", "value": "Fix repo URL after renaming\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"firebase_token_generator\"\n s.version = \"1.0.0\"\n s.date = \"2013-01-24\"\n s.summary = \"Generate Firebase Authentication ...
ruby
chosen
[ { "from": "system", "value": "Fix test framework option to disable view specs.\n" }, { "from": "human", "value": "require File.expand_path('../boot', __FILE__)\n\n<% if include_all_railties? -%>\nrequire 'rails/all'\n<% else -%>\n<%= comment_if :skip_active_record %>require 'active_record/railti...
ruby
chosen
[ { "from": "system", "value": "Use eval instead of define method\n" }, { "from": "human", "value": "module Danica\n class Operator::Functional < Operator\n variables :value\n default_value :is_grouped?, true\n\n def self.build(operator:, tex:, gnu:)\n Class.new(self) do\n de...
ruby
chosen
[ { "from": "system", "value": "Remove helper method that was pushed down to the plugin\n\ngit-svn-id: 3b1ff1236863b4d63a22e4dae568675c2e247730@581036 13f79535-47bb-0310-9956-ffa450edef68\n" }, { "from": "human", "value": "# Copyright:: Copyright (c) 2007 Apache Software Foundation\n# License:: ...
ruby
chosen
[ { "from": "system", "value": "Allow nested folders in path\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n match \"xss/:path\" => \"xss#load\"\nend\n" }, { "from": "gpt", "value": "Rails.application.routes.draw do\n match \"xss/:path\" => \"xss#load\", :constr...
ruby
chosen
[ { "from": "system", "value": "Configure available route actions with `except`\n\nSince the only action we're not covering is :edit.\n" }, { "from": "human", "value": "Ninetails::Engine.routes.draw do\n with_options defaults: { format: :json } do\n root 'pages#index'\n\n resources :project...
ruby
chosen
[ { "from": "system", "value": "Modify ID constraint on route for artefact to support slashes\n" }, { "from": "human", "value": "Panopticon::Application.routes.draw do\n resources :artefacts\n resources :tags, :defaults => {:format => 'json'}\n\n resources :curated_lists, only: :index\n\n matc...
ruby
chosen
[ { "from": "system", "value": "Add collections controller and view.\n" }, { "from": "human", "value": "Spree::Core::Engine.routes.draw do\n # Add your extension routes here\nend\n" }, { "from": "gpt", "value": "Spree::Core::Engine.routes.draw do\nend\n\nSpree::Core::Engine.routes.pre...
ruby
chosen
[ { "from": "system", "value": "Integrate flawed responses into the error message\n" }, { "from": "human", "value": "module Firmenwissen\n module Response\n class Base\n attr_reader :suggestions\n\n def initialize(http_response)\n @http_response = http_response\n @sugge...
ruby
chosen
[ { "from": "system", "value": "Fix bug: nil result on Freegeoip bad response.\n\nIn certain conditions a lookup returned [nil] instead of [], which\ncaused a Result object to be initialized with no data.\n" }, { "from": "human", "value": "require 'geocoder/lookups/base'\nrequire 'geocoder/results...
ruby
chosen
[ { "from": "human", "value": "Add xml parsing for file upload resposne.\n" }, { "from": "gpt", "value": "# encoding: utf-8\n\nrequire 'faraday'\n\nmodule Github\n class Response::Xmlize < Response\n dependency 'nokogiri'\n\n define_parser do |body|\n ::Nokogiri::XML body\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Make sure we export our env before interacting with the service\n" }, { "from": "human", "value": "Capistrano::Configuration.instance(:must_exist).load do\n\n after 'deploy', 'foreman:export'\n after 'deploy', 'foreman:restart'\n\n namespace :foreman do\n\n de...
ruby
chosen
[ { "from": "system", "value": "Update 'Bitcoin Core.app' to v0.9.2\n" }, { "from": "human", "value": "class BitcoinCore < Cask\n url 'https://bitcoin.org/bin/0.9.1/bitcoin-0.9.1-macosx-setup.dmg'\n homepage 'https://bitcoin.org/'\n version '0.9.1'\n sha256 '0390fbf5bf1ef876d95f277319983342c47...
ruby
chosen
[ { "from": "system", "value": "Upgrade Google Music.app to v1.0.3\n" }, { "from": "human", "value": "class GoogleMusic < Cask\n url 'https://github.com/kbhomes/google-music-mac/releases/download/v1.0.2/Google.Music.zip'\n homepage 'http://kbhomes.github.io/google-music-mac/'\n version '1.0.2'\...
ruby
chosen
[ { "from": "system", "value": "Add zap and uninstall to netease cask\n" }, { "from": "human", "value": "cask :v1 => 'neteasemusic' do\n version :latest\n sha256 :no_check\n\n url 'http://music.163.com/api/osx/download/latest'\n name '网易云音乐'\n name 'NetEase cloud music'\n homepage 'http://mu...
ruby
chosen
[ { "from": "system", "value": "Fix inject bug by reordering move!\n\nI always forget that inject gets the value for the memo object from the retval\nof the block...\n" }, { "from": "human", "value": "require 'sdl'\n\nclass Physeng\n class Simulation\n require 'physeng/simulation/particle'\n\n...
ruby
chosen
[ { "from": "system", "value": "Fix error on Akismet admin screen\n" }, { "from": "human", "value": "# name: discourse-signatures\n# about: A plugin to get that nostalgia signatures in Discourse Foruns\n# version: 1.0.0\n# author: Rafael Silva <xfalcox@gmail.com>\n# url: https://github.com/xfalcox...
ruby
chosen
[ { "from": "system", "value": "Create core and sql subspecs\n" }, { "from": "human", "value": "#\n# Be sure to run `pod lib lint GoldDigger.podspec' to ensure this is a\n# valid spec before submitting.\n#\n# Any lines starting with a # are optional, but their use is encouraged\n# To learn more ab...
ruby
chosen
[ { "from": "system", "value": "Reorder middleware so the OAuth middleware receives a Hash instead of a String\n" }, { "from": "human", "value": "require 'faraday_middleware'\nrequire 'faraday/request/multipart_with_file'\nrequire 'faraday/response/raise_http_4xx'\nrequire 'faraday/response/raise_...
ruby
chosen
[ { "from": "system", "value": "Add a guard for blocking readline specs on Windows\n" }, { "from": "human", "value": "require File.expand_path('../spec_helper', __FILE__)\n\nprocess_is_foreground do\n with_feature :readline do\n describe \"Readline.readline\" do\n before :each do\n ...
ruby
chosen
[ { "from": "system", "value": "Replace map with pluck in PayloadBuilder::AccessLimitation\n\nIt's more performant if there are a large number of users.\n" }, { "from": "human", "value": "module PublishingApiPresenters\n module PayloadBuilder\n class AccessLimitation\n def self.for(item)\...
ruby
chosen
[ { "from": "system", "value": "Update adjustments without an order reference to have one\n" }, { "from": "human", "value": "class FixAdjustmentOrderPresence < ActiveRecord::Migration\n def change\n say 'Fixing adjustments without direct order reference'\n Spree::Adjustment.where(order: nil...
ruby
chosen
[ { "from": "system", "value": "Add PRONTO_* prefix to PULL_REQUEST_ID in github_pr_review formatter\n" }, { "from": "human", "value": "module Pronto\n module Formatter\n describe GithubPullRequestReviewFormatter do\n let(:formatter) { described_class.new }\n\n let(:repo) { Git::Repo...
ruby
chosen
[ { "from": "system", "value": "Revert \"build: Go 1.14 for the Debian etc builds\"\n\nThis reverts commit d400e5142287e647786c18eb6cc8a6a3f55183d3.\n" }, { "from": "human", "value": "# We will grab the Go compiler from the latest Go image.\nFROM golang:1.14 as go\n\n# Otherwise we base on the sna...
ruby
chosen
[ { "from": "system", "value": "Allow checking of unknown formulae\n" }, { "from": "human", "value": "require 'formula'\nrequire 'caveats'\n\nmodule Homebrew extend self\n def caveats\n raise FormulaUnspecifiedError if ARGV.named.empty?\n \n ARGV.formulae.each do |f|\n puts_caveats ...
ruby
chosen
[ { "from": "system", "value": "Refactor emailing of admin about user signups behind protected method\n" }, { "from": "human", "value": "class RegistrationsController < Devise::RegistrationsController\n def create\n if params[:user]\n session[:pending_organisation_id] = params[:user][:pen...
ruby
chosen
[ { "from": "system", "value": "Bugfix: Check positivity on hit record's intersection parameter\n" }, { "from": "human", "value": "# Use this integrator for debugging purposes. For example, you can simply\n# return a white spectrum if the ray hits something, and black otherwise. Any\n# other visua...
ruby
chosen
[ { "from": "system", "value": "Call map! instead of map.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule UsesThis\n module Api\n # A class that generates all interview API endpoints.\n class InterviewsGenerator < BaseGenerator\n def generate\n intervi...
ruby
chosen
[ { "from": "system", "value": "Remove puts for 'AFTER STOP' debugging\n" }, { "from": "human", "value": "require 'timeout'\n\nmodule Combi\n\n class ServiceError < StandardError\n end\n\n def self.wait_for(defer, options = {}, &block)\n options[:timeout] ||= 2\n waiter_thread = Thread.cu...
ruby
chosen
[ { "from": "system", "value": "Fix for rake -T not working\n" }, { "from": "human", "value": "require_relative 'couch_migrate_railtie.rb' if defined?(Rails)\nDir[\"#{File.dirname(__FILE__)}/couch_migrate/**/*.rb\"].each {|f| require f}\n" }, { "from": "gpt", "value": "require_relative...
ruby
chosen
[ { "from": "system", "value": "Build workaround for touch xml\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"Simple-KML\"\n s.version = \"0.1.0\"\n s.summary = \"Simple KML is a simple & lightweight parsing library for KML written in Objective-C for the ...
ruby
chosen
[ { "from": "system", "value": "Handle there not being a callback\n" }, { "from": "human", "value": "module Kontrast\n class Spec\n attr_accessor :name, :_before_screenshot, :_after_screenshot\n\n def initialize(name)\n @name = name\n end\n\n def before_sc...
ruby
chosen
[ { "from": "system", "value": "Fix issue looking up unique constraint with PG 9.5.5 (And up?)\n" }, { "from": "human", "value": "require 'upsert/merge_function/postgresql'\n\nclass Upsert\n class MergeFunction\n # @private\n class PG_Connection < MergeFunction\n ERROR_CLASS = PG::Erro...
ruby
chosen
[ { "from": "human", "value": "Add base support for DocumentLibrary lists.\n" }, { "from": "gpt", "value": "=begin\n This file is part of ViewpointSPWS; the Ruby library for Microsoft Sharepoint Web Services.\n\n Copyright © 2011 Dan Wanek <dan.wanek@gmail.com>\n\n Licensed under the Apache Lic...
ruby
chosen
[ { "from": "system", "value": "Change lesser and greater to left and right\n\nGreater is not strictly correct, since the item could be equal to the pivot\n" }, { "from": "human", "value": "class Array\n def quicksort\n return self if self.size <= 1\n pivot = self.shift\n lesser, greater...
ruby
chosen
[ { "from": "system", "value": "Add proper tests for govuk::app\n" }, { "from": "human", "value": "require_relative '../../../../spec_helper'\n\ndescribe 'govuk::app', :type => :define do\n let(:title) { 'planner' }\n let(:params) {{\n \"port\" => 8080,\n }}\n it { should contain_file('/var...
ruby
chosen
[ { "from": "system", "value": "Use Lua binaries & libraries\n" }, { "from": "human", "value": "require \"rufus/lua/win/version\"\n\nmodule Rufus\n module Lua\n module Win\n # Your code goes here...\n end\n end\nend\n" }, { "from": "gpt", "value": "require \"rufus/lua/win/...
ruby
chosen
[ { "from": "system", "value": "Add debug statement to by_weekend test to discover cause of build 9 fail\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'by weekend' do\n\n it \"should be able to find the posts on the weekend of the 1st of January\" do\n posts_count = Post...
ruby
chosen
[ { "from": "system", "value": "Fix helper spec for Rspec2.\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + '/../spec_helper'\n\ndescribe EmailSpec::Helpers do\n include EmailSpec::Helpers\n describe \"#parse_email_for_link\" do\n it \"properly finds links with text\" do\n...
ruby
chosen
[ { "from": "system", "value": "Add Subscriber Count to Class Method\n" }, { "from": "human", "value": "require \"faraday\"\nrequire \"faraday_middleware\"\n\nmodule FayeSimpleClient\n class CustomError < StandardError; end\n class Client\n\n class << self\n attr_accessor :endpoint, :sec...
ruby
chosen
[ { "from": "system", "value": "Clean up FindByName a bit\n" }, { "from": "human", "value": "module Economic\n module Proxies\n module Actions\n module CreditorContactProxy\n class FindByName\n attr_reader :name\n\n def initialize(caller, name)\n @calle...
ruby
chosen
[ { "from": "system", "value": "Simplify logic of Shell.exe, remove unused cases.\n" }, { "from": "human", "value": "class CertCheck\n ##\n # Execute shell commands. Simple popen3 wrapper, that returns either\n # STDOUT or exit status, and aborts on non zero status.\n #\n class Shell\n def...
ruby
chosen
[ { "from": "human", "value": "Add /pratices endpoint with naive searching\n\nIt just looks for substring matches against the practice name for now.\n" }, { "from": "gpt", "value": "require \"json\"\nrequire \"sinatra\"\n\nPRACTICES = JSON.parse(File.read(\"data/general-medical-practices.json\"))\...
ruby
chosen
[ { "from": "system", "value": "Set header in after filter.\n" }, { "from": "human", "value": "require \"sinatra\"\n\ngames_json = File.read(\"public/api/v1/games.json\")\n\nget \"/\" do\n\tjson_exists = File.exists?(\"public/api/v1/games.json\")\n\tjson_modified_time = json_exists ? File.mtime(\"...
ruby
chosen
[ { "from": "system", "value": "Load the rake task instead of requiring them\n\nBased on http://edgeapi.rubyonrails.org/classes/Rails/Railtie.html#class-Rails::Railtie-label-Loading+rake+tasks+and+generators" }, { "from": "human", "value": "module SitemapGenerator\n class Railtie < Rails::Railtie...
ruby
chosen
[ { "from": "system", "value": "Enable use `call` as instance variable in view template because it isn't use\n" }, { "from": "human", "value": "module Yuba\n class ViewModel\n module Rendering\n def render(*args)\n view_model_hash = args.find { |arg| arg.is_a?(Hash) && arg[:view_mo...
ruby
chosen
[ { "from": "system", "value": "Update data migration to use new Rummager client\n" }, { "from": "human", "value": "Rummageable.index(Organisation.search_index, Whitehall.government_search_index_path)\n" }, { "from": "gpt", "value": "index = Whitehall::SearchIndex.for(:government)\nind...
ruby
chosen
[ { "from": "system", "value": "Add a simple welcome message to the repl\n" }, { "from": "human", "value": "module SimpleRepl\n def receive_data data\n process = proc {\n begin\n eval(data)\n rescue ::Exception => e\n e.inspect\n ...
ruby
chosen
[ { "from": "system", "value": "Use standardize Apache 2 license string\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "name 'omnibus_updater'\nmaintainer 'Chef Software, Inc.'\nmaintainer_email 'cookbooks@chef.io'...
ruby
chosen
[ { "from": "system", "value": "Add more static page tests\n" }, { "from": "human", "value": "require_relative '../acceptance_helper'\n\nclass StaticPageTest < AcceptanceTestCase\n def test_homepage_exists\n visit '/'\n\n assert page.has_content?('exercism')\n end\n\n def test_about_exist...
ruby
chosen
[ { "from": "human", "value": "BackwardsCompatability: Add script to rename module Calabash::Cucumber to Calabash::IOS\n" }, { "from": "gpt", "value": "if Kernel.const_defined?(:CALABASH_BACKWARDS_COMPATIBILITY_SCRIPT_RUN)\n raise 'Calabash backwards compatibility script can only be run once'\nen...
ruby
chosen
[ { "from": "system", "value": "Write context & expectations for bulk assignments controller spec\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe BulkInterventionAssignmentsController, type: :controller do\n\nend\n" }, { "from": "gpt", "value": "require 'rai...
ruby
chosen
[ { "from": "human", "value": "Update final_legal_document_variable_id foreign key to bigint\n" }, { "from": "gpt", "value": "class ChangeFinalLegalDocumentVariableIdToBigint < ActiveRecord::Migration[6.0]\n def up\n change_column :agreement_transaction_audits, :final_legal_document_variable_i...
ruby
chosen
[ { "from": "system", "value": "Fix test app to work with 1.9\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'rack/test'\n\nrequire 'hijacker/middleware'\n\nmodule Hijacker\n describe Middleware do\n include Rack::Test::Methods\n\n def app\n Rack::Builder.new do\n ...
ruby
chosen
[ { "from": "human", "value": "Add test for npn protocol in custom ssl.\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe NetHttp2::Client do\n\n describe \"npm protocols in SSL\" do\n\n subject { client.instance_variable_get(:@ssl_context) }\n\n context \"when no custom SS...
ruby
chosen
[ { "from": "system", "value": "Add repo_gpgcheck to redhat varnish repo\n" }, { "from": "human", "value": "provides :varnish_repo, platform_family: ['rhel', 'fedora']\n\ndefault_action :configure\n\nproperty :major_version, kind_of: Float, equal_to: [2.1, 3.0, 4.0, 4.1], default: lazy { node['var...
ruby
chosen
[ { "from": "system", "value": "Use the derived request_method from AD::Request rather than the raw REQUEST_METHOD from rack.\n\nThis takes _method into account so the log shows the method which ActionController sees.\n" }, { "from": "human", "value": "require 'active_support/core_ext/time/convers...
ruby
chosen
[ { "from": "system", "value": "Add Instabug as a framework in the podspec\n" }, { "from": "human", "value": "require \"json\"\n\njson = File.read(File.join(__dir__, \"package.json\"))\npackage = JSON.parse(json).deep_symbolize_keys\n\nPod::Spec.new do |s|\n s.name = package[:name]\n s.version =...
ruby
chosen
[ { "from": "system", "value": "Remove `visit` in controller specs\n\nUsing the capybara method `visit` in controller specs is deprecated.\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe PictureController do\n let(:picture_content) { \"BINARY IMAGE CONTENT\" }\n let(:pictu...
ruby
chosen
[ { "from": "system", "value": "Add context to delete specs so we can add other specs\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Spree::Admin::ShippingMethodsController, type: :controller do\n include AuthenticationWorkflow\n\n describe \"shipping method not referenced ...
ruby
chosen
[ { "from": "system", "value": "Revert \"Update to version 1.2.2\"\n\nThis reverts commit 264ad0c29d56bfda081aad27c8f711ec58bb5b06.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name =\t'SDCAlertView'\n s.version =\t'1.2.2'\n s.license =\t{ :type => 'MIT', :file ...
ruby
chosen
[ { "from": "system", "value": "Use strings for index names instead of symbols.\n" }, { "from": "human", "value": "class CreateMessageRecipients < ActiveRecord::Migration\n def self.up\n create_table :message_recipients do |t|\n t.column :messageable_id, :integer, :unsigned => true, :re...
ruby
chosen
[ { "from": "system", "value": "Check for blank user attributes in migration\n" }, { "from": "human", "value": "class PopulateAlephIdFromUserAttributes < ActiveRecord::Migration\n def up\n say_with_time \"Migrating Aleph ID.\" do\n User.all.each do |user|\n User.class_eval { serial...
ruby
chosen
[ { "from": "system", "value": "Remove the flash notice after destroying OAuth authentication\n\nThe flash notice will not be shown before the user manually navigates to\ncertain pages, and the pages does not include the main Web UI. Therefore,\nit cannot be expected that the user sees the message as soon as ...
ruby
chosen