conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add more information to failure status\n" }, { "from": "human", "value": "class StatusChecker < Client\n\n attr_accessor :id, :idDomain\n\n def after_initialize(message)\n @message = message\n @key = message.key\n end\n\n def consume\n verify_quickbooks...
ruby
chosen
[ { "from": "system", "value": "Remove filter from keyboard example.\n" }, { "from": "human", "value": "require 'gosu'\n\nclass KeyboardExample < Gosu::Window\n\tdef initialize\n\t\tsuper 640, 480\n\t\tself.caption = \"Keyboard Example\"\n\t\t@font = Gosu::Font.new(32, name: \"Nimbus Mono L\")\n\t...
ruby
chosen
[ { "from": "system", "value": "Add get() wrapper to catch when ret is nil and die.\n\n- ret is nil, e.g., if the solution ID being used is invalid.\n" }, { "from": "human", "value": "require 'uri'\nrequire 'MrMurano/Config'\nrequire 'MrMurano/http'\nrequire 'MrMurano/verbosing'\nrequire 'MrMurano...
ruby
chosen
[ { "from": "system", "value": "Convert controller spec to request spec\n\nController specs are no longer a supported part of Rails core, and request specs are now the recommended replacement since they hit the router and middlewhare, and they render views by default.\n" }, { "from": "human", "val...
ruby
chosen
[ { "from": "human", "value": "Add podspec to integrate with CocoaPods\n" }, { "from": "gpt", "value": "Pod::Spec.new do |s|\n\n s.name = \"Postino\"\n s.version = \"0.0.1\"\n s.summary = \"\"\n s.homepage = \"https://github.com/miguelbassila/postino\"\n s.license =...
ruby
chosen
[ { "from": "system", "value": "Add alias FB for FizzBuzz.\n\nSigned-off-by: Krzysztof Wilczynski <9bf091559fc98493329f7d619638c79e91ccf029@linux.com>\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\n#\n# fizzbuzz.rb\n#\n# Copyright 2012 Krzysztof Wilczynski\n#\n# Licensed under the...
ruby
chosen
[ { "from": "system", "value": "Fix bug with 404 errors\n" }, { "from": "human", "value": "class WishyWishyApp < Sinatra::Base\n before %r{/api(.*)} do\n content_type :json\n pass if params[:captures].first == ''\n halt json_status 400, 'Please use SSL' if\n settings.force_ssl && !r...
ruby
chosen
[ { "from": "system", "value": "Add beta to Gephi version field\n" }, { "from": "human", "value": "class Gephi < Cask\n url 'https://launchpad.net/gephi/0.8/0.8.2beta/+download/gephi-0.8.2-beta.dmg'\n homepage 'http://gephi.org/'\n version '0.8.2'\n sha1 'cea18e3c70881de29bb263d982e7b359809994...
ruby
chosen
[ { "from": "system", "value": "Use the correct ANSI escape code to reset SGR parameters.\n" }, { "from": "human", "value": "module Guard\n module UI\n class << self\n\n def info(message, options = {})\n unless ENV[\"GUARD_ENV\"] == \"test\"\n reset_line if options[:reset]...
ruby
chosen
[ { "from": "system", "value": "Add a note to remind myself of something to do later\n" }, { "from": "human", "value": "require 'handsoap'\nrequire 'logger'\n\nrequire 'jiraSOAP/remoteEntities.rb'\nrequire 'jiraSOAP/remoteAPI.rb'\n\nrequire 'jiraSOAP/JIRAservice.rb'\n\n#overrides and additions\nre...
ruby
chosen
[ { "from": "system", "value": "Return an enumerator if no block is given for `walk`\n" }, { "from": "human", "value": "module CommonMarker\n class Node\n include Enumerable\n\n # Public: An iterator that \"walks the tree,\" descending into children recursively.\n #\n # blk - A {Proc}...
ruby
chosen
[ { "from": "system", "value": "Package version increased from 0.4.3.5 to 0.5.0.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'evt-log'\n s.version = '0.4.3.5'\n s.summary = 'Logging to STD IO with levels, tagging, and coloring'\n s.de...
ruby
chosen
[ { "from": "system", "value": "Configure Ahoy to try to collect more data" }, { "from": "human", "value": "class Ahoy::Store < Ahoy::Stores::ActiveRecordTokenStore\n # customize here\nend\n" }, { "from": "gpt", "value": "class Ahoy::Store < Ahoy::Stores::ActiveRecordTokenStore\n\nend...
ruby
chosen
[ { "from": "system", "value": "Use connection.adapter_name for determining database type\n" }, { "from": "human", "value": "SUPER_ADMIN_CHECK = Proc.new do |person|\n Setting.get(:access, :super_admins).include? person.email\nend\n\nPEOPLE_ATTRIBUTES_SHOWABLE_ON_HOMEPAGE = %w(website service_nam...
ruby
chosen
[ { "from": "system", "value": "Check if socket responds to sync_close=\n" }, { "from": "human", "value": "require \"forwardable\"\n\nmodule HTTP\n module Timeout\n class Null\n extend Forwardable\n\n def_delegators :@socket, :close, :closed?\n\n attr_reader :options, :socket\n\...
ruby
chosen
[ { "from": "system", "value": "Use `system` over `exec` to spawn a subshell. If using verbose, use `%x[command]` instead to return output.\n" }, { "from": "human", "value": "def scp_transfer(direction, from, to, options = {})\n remote_prefix = \"#{domain!}:\"\n remote_prefix = \"#{user}@#{remot...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary items from podspec" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"PXInfiniteScrollView\"\n s.version = \"0.1.2\"\n s.summary = \"Pages. It loops. It's infinite.\"\n s.description = <<-DES...
ruby
chosen
[ { "from": "system", "value": "Check whether Markdown file exists\n" }, { "from": "human", "value": "require \"eventmachine\"\n\nmodule Mado\n class FileHandler < EventMachine::FileWatch\n def initialize(sockets)\n @sockets = sockets\n end\n\n def file_modified\n @sockets.each...
ruby
chosen
[ { "from": "system", "value": "Change log level of Alchemy.log_warning from warn to debug.\n\nLog level warn is also used in production environments.\nBut the Alchemy warn logger is meant to only log in dev environments.\n" }, { "from": "human", "value": "module Alchemy\n module Logger\n\n # ...
ruby
chosen
[ { "from": "system", "value": "Add centos as a supported platform\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "name 'kubernetes'\nmaintainer 'Andre Elizondo'\nmaintainer_email 'andre@chef.io'\nlicense ...
ruby
chosen
[ { "from": "system", "value": "Fix confusion of File and Chef::Provider::File\n" }, { "from": "human", "value": "name 'sys'\nmaintainer 'GSI HPC department'\nmaintainer_email 'hpc@gsi.de'\nlicense 'Apache 2.0'\ndescription 'System Software configuration and mainten...
ruby
chosen
[ { "from": "system", "value": "Sort these agents by name.\n" }, { "from": "human", "value": "require 'active_support/inflector'\nrequire \"huginn_agent/version\"\n\nclass HuginnAgent\n\n def self.inherited type\n @types ||= []\n @types << type\n end\n\n def self.types\n @types ||= []\...
ruby
chosen
[ { "from": "system", "value": "Add missing ZeroMoney cop require\n\nMissed this in https://github.com/Shopify/money/pull/205\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'rubocop/cop/money/missing_currency'\n" }, { "from": "gpt", "value": "# frozen_strin...
ruby
chosen
[ { "from": "system", "value": "Fix specjour prepare task not recreating db\n\nThe prepare task drops the database then tries to recreate it but won't\nrecreate the database when the stale connection still exists.\n" }, { "from": "human", "value": "module Specjour\n module DbScrub\n require 'r...
ruby
chosen
[ { "from": "system", "value": "Change to fix class mismatch\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'action_controller'\nrequire 'action_view'\n\nrequire_relative 'controller_extensions'\nrequire_relative 'view_extensions'\n\nmodule Loaf\n if defined?(Rails::Railtie)\n ...
ruby
chosen
[ { "from": "system", "value": "Remove clutter from categories column" }, { "from": "human", "value": "namespace :downloads do\n\n desc \"make downloadable for packages\"\n task packages: :environment do\n book = Spreadsheet::Workbook.new\n\n sheet = book.create_worksheet name: 'Julia Pack...
ruby
chosen
[ { "from": "system", "value": "Add the rspec load call for rake_task\n\nThis is needed to actually trigger the LoadError. If it isn't present\nthen the rescue block will never fire and the uninitialized constant\nerror for RSpec will still happen in prod.\n" }, { "from": "human", "value": "begin\...
ruby
chosen
[ { "from": "system", "value": "Add alias methods for Province\n" }, { "from": "human", "value": "require 'forwardable'\nrequire 'thailand/country'\nrequire 'thailand/region'\nrequire 'thailand/querying'\n\nmodule Thailand\n class Province < Region\n extend Querying\n extend SingleForwardab...
ruby
chosen
[ { "from": "system", "value": "Send attachments without array wrapping\n" }, { "from": "human", "value": "class PostMessage < SlackService\n def post!\n result 500, 'Missing Webhook URL' unless webhook_url.present?\n\n notifier = Slack::Notifier.new webhook_url\n\n notifier.channel = va...
ruby
chosen
[ { "from": "system", "value": "Rename TQ1 start_date and end_date\n" }, { "from": "human", "value": "\nclass HL7::Message::Segment::TQ1 < HL7::Message::Segment\n weight 2\n add_field :set_id, idx: 1\n add_field :quantity, idx: 2\n add_field :repeat_pattern, idx: 3\n add_field :explicit_time,...
ruby
chosen
[ { "from": "system", "value": "Clean Up If Rails Block\n\nAssuming this will only work with rails now that this will be an Engine\nover a strait gem.\n" }, { "from": "human", "value": "require 'ship_fosdick/version'\nrequire 'ship_fosdick/railtie'\nrequire 'ship_fosdick/engine'\n\n# Fosdick integ...
ruby
chosen
[ { "from": "system", "value": "Fix enqueuing jobs for Sidekiq 4.2.\n" }, { "from": "human", "value": "module Sidecloq\n # Plugin for sidekiq-web\n module Web\n VIEW_PATH = File.expand_path('../../../web/views', __FILE__)\n\n def self.registered(app)\n app.get '/recurring' do\n ...
ruby
chosen
[ { "from": "system", "value": "Add summary and description to gemspec" }, { "from": "human", "value": "# frozen_string_literal: true\n\n# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'lackeys/version'\n\nGem::Specifica...
ruby
chosen
[ { "from": "system", "value": "Add API endpoint for obtaining plugin URL.\n" }, { "from": "human", "value": "module Quanto\n\n class Client\n\n def record_metric(value, type, opts={})\n metric = {\n metric_type: type,\n value: value,\n date: opts[:date] || Date.toda...
ruby
chosen
[ { "from": "system", "value": "Use \\r\\n for line ending\n" }, { "from": "human", "value": "module Rack\n class Pesticide\n def initialize(app)\n @app = app\n end\n\n def call(env)\n if pest?(env)\n forbidden\n else\n @app.call(env)\n end\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Add watch kit demo schemes\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"moa\"\n s.version = \"1.0.44\"\n s.license = { :type => \"MIT\" }\n s.homepage = \"https://github.com/evgenyneu/moa\"\n s.summary = \"An image ...
ruby
chosen
[ { "from": "system", "value": "Move rivals after MSI in settings view\n" }, { "from": "human", "value": "class Seeders::League\n LEAGUES = {\n '10' => 'MSI',\n '2' => 'NA LCS',\n '3' => 'EU LCS',\n '6' => 'LCK',\n '7' => 'LPL',\n '8' => 'LMS',\n '4' => 'NA CS',\n '5' => '...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.1.0 to 0.1.1\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'casing'\n s.version = '0.1.0'\n s.summary = 'Convert the case of strings, symbols, and hash keys, including ca...
ruby
chosen
[ { "from": "system", "value": "Fix definition of source file in resource\n\nFix syntax of defining either of 2 source files for the template, based on SUSE major release" }, { "from": "human", "value": "#\n# Cookbook:: timezone_iii\n# Recipe:: suse\n#\n# Copyright:: 2017, Brad Beveridge\n#\n# Lic...
ruby
chosen
[ { "from": "system", "value": "Allow to pass commit hash to tester\n" }, { "from": "human", "value": "\ndef run_or_fail(command)\n pid = Process.spawn(command)\n Process.wait(pid)\n $?.exitstatus == 0\nend\n\ndesc 'Run all tests (JS and code in a standalone environment)'\ntask 'docker:test' do...
ruby
chosen
[ { "from": "human", "value": "Add rake task to upload already downloaded pdfs\n" }, { "from": "gpt", "value": "namespace :papers do\n\n desc 'switch logger to stdout'\n task to_stdout: :environment do\n Rails.logger = Logger.new(STDOUT)\n end\n\n desc 'Upload papers to s3'\n task upload: :...
ruby
chosen
[ { "from": "system", "value": "Fix uptap action for homebrew_tap matcher.\n" }, { "from": "human", "value": "if defined?(ChefSpec)\n\n def tap_homebrew_tap(tap)\n ChefSpec::Matchers::ResourceMatcher.new(:homebrew_tap, :tap, tap)\n end\n\n def untap_homebrew_tap(tap)\n ChefSpec::Matchers:...
ruby
chosen
[ { "from": "system", "value": "Support for CrossBuild in gem rake file" }, { "from": "human", "value": "MRuby::Gem::Specification.new('mruby-raspberry') do |spec|\n # Note that it needs WiringPI libraries (http://wiringpi.com)\n spec.license = 'MIT'\n spec.author = 'Paolo Bosetti and Matteo R...
ruby
chosen
[ { "from": "system", "value": "Add some text handling methods" }, { "from": "human", "value": "module PadUtils\n\n def self.convert_to_ruby_name(val)\n \"\"\n end\n\n # Replace text within a file.\n # old_text can be a regex or a string\n def self.replace(file, old_text, new_text)\n te...
ruby
chosen
[ { "from": "system", "value": "Add support for format as symbol (e.g. when specified in routes.rb or inside the controller\n" }, { "from": "human", "value": "require 'singleton'\n\nmodule RablRails\n class Library\n include Singleton\n\n def initialize\n @cached_templates = {}\n en...
ruby
chosen
[ { "from": "system", "value": "Create and require mixins directory\n" }, { "from": "human", "value": "Dir[\"lib/shipping_materials/*.rb\"].each {|f| require f }\n\nmodule ShippingMaterials\n def self.config\n yield Config\n end\nend\n" }, { "from": "gpt", "value": "Dir[\"lib/ship...
ruby
chosen
[ { "from": "system", "value": "Add TODO for remebering to refactor todo's output\n" }, { "from": "human", "value": "# What_now definitions\n\nrequire 'ptools'\n\nTodo = Struct.new :text, :path, :line\n\nmodule WhatNow\n class << self\n\n def ignorecase\n @ignorecase = true\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Remove build_attributes method and rename collect_source_files method.\n" }, { "from": "human", "value": "module Svgeez\n class SvgElement\n def initialize(source, destination)\n @source = source\n @destination = destination\n end\n\n def build\n...
ruby
chosen
[ { "from": "system", "value": "Add gem description and summary\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'kstarv/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Allow <p> tags in markdown\n" }, { "from": "human", "value": "require 'BlueCloth'\n# Dubious to import this in a Merb project:\nrequire 'action_controller'\n\nmodule Boardlog\n class Sanitize\n \n def self.sanitize_markdown(markdown)\n sanitize_html(Blue...
ruby
chosen
[ { "from": "system", "value": "Add Homebrew directory to $LOAD_PATH\n\nfix #5\n" }, { "from": "human", "value": "BREW_HOME = `brew --repository`.strip\nCASK_HOME = \"#{BREW_HOME}/Library/Taps/caskroom/homebrew-cask\"\n$LOAD_PATH.unshift(\"#{CASK_HOME}/lib\")\n\nrequire 'vendor/homebrew-fork/globa...
ruby
chosen
[ { "from": "system", "value": "Rename argument from bucket_name to bucketname\n" }, { "from": "human", "value": "require \"version\"\nrequire \"aws-sdk\"\nrequire \"apns\"\n\nmodule ApnsS3\n # Set PEM file to APNS module\n #\n # @param [String] aws_access_key_id\n # @param [String] aws_secret...
ruby
chosen
[ { "from": "system", "value": "Add missing includes for LivenessHealthcheck & ReadinessHealthcheck\n" }, { "from": "human", "value": "require \"erubis\"\nrequire \"nokogiri\"\nrequire \"ostruct\"\nrequire \"rack/request\"\nrequire \"uri\"\nrequire \"status_renderer\"\nrequire \"host\"\nrequire \"...
ruby
chosen
[ { "from": "system", "value": "Change read_with_front_matter to no longer need a path, only allow filtered metadata keys.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Dimples\n # A mixin class that handles reading and parsing front matter from a file.\n module Fron...
ruby
chosen
[ { "from": "system", "value": "Update Dalli dependency to ~> 2.0\n" }, { "from": "human", "value": "# encoding: utf-8\n\nGem::Specification.new do |gem|\n gem.name = 'memdash'\n gem.version = '0.0.1'\n\n gem.authors = ['Brian Ryckbost', 'Steve Richert']\n gem.email = ['bryckbost@...
ruby
chosen
[ { "from": "system", "value": "Fix message expectations for \"Batch\"\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe \"Notifications page\", type: :feature do\n before do\n sign_in FactoryGirl.create(:user_with_mail)\n visit \"/notifications\"\n end\n\n it \"lists n...
ruby
chosen
[ { "from": "system", "value": "Fix params in controller specs\n" }, { "from": "human", "value": "RSpec.describe Spree::StaticContentController, type: :controller do\n let!(:store) { create(:store, default: true) }\n\n before do\n allow(controller).to receive(:spree_current_user).and_return(n...
ruby
chosen
[ { "from": "system", "value": "Use Kubuntu Backports PPA to get libqt and qmake 4.7 for Capybara WebKit\n" }, { "from": "human", "value": "case node[:platform]\nwhen \"debian\", \"ubuntu\"\n package \"libqt4-dev\"\n package \"qt4-qmake\"\nend" }, { "from": "gpt", "value": "case node...
ruby
chosen
[ { "from": "system", "value": "Support PHP 5.3.9RC4 and 5.4.0RC5.\n\nAdd an alias for 5.3.9 => 5.3.9RC4.\n" }, { "from": "human", "value": "default[:php][:multi][:versions] = [\"5.2.17\", \"5.3.2\", \"5.3.8\", \"5.3.9rc3\", \"5.4.0rc4\"]\ndefault[:php][:multi][:aliases] = {\"5.2\" => \"5.2.17\",...
ruby
chosen
[ { "from": "system", "value": "Add Sinatra and ActiveRecord dependencies" }, { "from": "human", "value": "require File.expand_path('../lib/dredge/version', __FILE__)\n\nGem::Specification.new do |s|\n s.name = 'dredge'\n s.version = Dredge::VERSION\n s.date = Time.now.strftime('%Y-...
ruby
chosen
[ { "from": "system", "value": "Stop using deprecated report_exception method of Rollbar.\n" }, { "from": "human", "value": "# -*- encoding : utf-8 -*-\nI18n.backend.class.send(:include, I18n::Backend::Fallbacks)\n\nI18n.enforce_available_locales = false\n\n# for local\nI18n.default_locale = :fr\n...
ruby
chosen
[ { "from": "system", "value": "Raise exceptions for missing translations\n" }, { "from": "human", "value": "I18n.enforce_available_locales = true\n" }, { "from": "gpt", "value": "I18n.enforce_available_locales = true\nif Rails.env.development? || Rails.env.test?\n I18n.exception_hand...
ruby
chosen
[ { "from": "system", "value": "Remove unused instance variable from CitationsController\n" }, { "from": "human", "value": "class CitationsController < ApplicationController\n include CurationConcerns::CurationConcernController\n include Sufia::Breadcrumbs\n include Sufia::SingularSubresourceCo...
ruby
chosen
[ { "from": "system", "value": "Remove international delegations from embassy finder\n" }, { "from": "human", "value": "class EmbassiesController < ApplicationController\n def index\n @embassies_by_location = WorldLocation.order(:slug).map do |location|\n Embassy.new(location)\n end\n ...
ruby
chosen
[ { "from": "system", "value": "Add two entries with the same client name equals the same client\n" }, { "from": "human", "value": "class Clients\n attr_reader(:id, :client_name)\n\n define_method(:initialize) do |attributes|\n @id = attributes.fetch(:id)\n @client_name = attributes.fetch...
ruby
chosen
[ { "from": "human", "value": "Create a single asset update job that can be overridden as needed\n" }, { "from": "gpt", "value": "#------------------------------------------------------------------------------\n#\n# AssetValueUpdateJob\n#\n# Updates an assets estimated value\n#\n#-----------------...
ruby
chosen
[ { "from": "system", "value": "Destroy ApiKeys when machine removed.\n" }, { "from": "human", "value": "class ArcadeMachine < ActiveRecord::Base\n validates :name, presence: true\n\n has_many :machine_ownerships, dependent: :destroy\n has_many :users, through: :machine_ownerships\n\n has_many...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary work for MySQL\n" }, { "from": "human", "value": "class RedirectRoute < ActiveRecord::Base\n belongs_to :source, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations\n\n validates :source, presence: true\n\n validates :path,\n len...
ruby
chosen
[ { "from": "system", "value": "Change staff policy to match old names with new routes\n" }, { "from": "human", "value": "class StaffPolicy < ApplicationPolicy\n def index?\n user.admin?\n end\n\n def show?\n admin_or_self\n end\n\n def create?\n user.admin?\n end\n\n def update?\n...
ruby
chosen
[ { "from": "system", "value": "Make constant for default starting lives\n" }, { "from": "human", "value": "class Hangman\n attr_reader :guesses\n\n def initialize(starting_lives: 10, word: \"hangman\")\n @starting_lives = starting_lives\n @word = word\n @guesses = []\n end\n\n def wo...
ruby
chosen
[ { "from": "human", "value": "Add a spec to test interface validatation\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ninclude PacketFu\n\ndescribe Utils do\n context \"when using ifconfig\" do\n it \"should return a hash\" do\n PacketFu::Utils.ifconfig().should be_a(::Hash)\n...
ruby
chosen
[ { "from": "system", "value": "Change require's to relative paths\n" }, { "from": "human", "value": "require 'active_support'\nunless Module.respond_to?(:mattr_accessor)\n require 'active_support/core_ext/module/attribute_accessors'# rescue nil # this may be needed for ActiveSupport versions >=...
ruby
chosen
[ { "from": "system", "value": "BlogFeed: Update to match tumblr API change, only fetch text posts\n" }, { "from": "human", "value": "class BlogFetcher\n BASE_URL = 'http://blog.mayday.us/api'\n ENDPOINTS = {\n recent: '/read/json?num=5',\n press_releases: '/read/json?tagged=press%...
ruby
chosen
[ { "from": "system", "value": "Fix two typos in a row!\n" }, { "from": "human", "value": "require_relative 'spinach/version'\nrequire_relative 'spinach/config'\nrequire_relative 'spinach/runner'\nrequire_relative 'spinach/parser'\nrequire_relative 'spinach/dsl'\nrequire_relative 'spinach/feature'...
ruby
chosen
[ { "from": "human", "value": "Add accountability mechanisms for club application flow\n" }, { "from": "gpt", "value": "class OpsAccountabilityJob < ApplicationJob\n PIPELINE_KEY = Rails.application.secrets.streak_club_applications_pipeline_key\n\n NEEDS_REVIEW_STAGE_KEY = '5001'.freeze\n ACCEP...
ruby
chosen
[ { "from": "system", "value": "Set a default pour timeout\n" }, { "from": "human", "value": "module Setting\n def self.hubot_url\n settings['hubot_url']\n end\n\n def self.faye_url\n \tsettings['faye_url']\n end\n\n def self.pour_timeout\n \tsettings['pour_timeout']\n end\n\n def self...
ruby
chosen
[ { "from": "system", "value": "Add conditional to session destroy action, to only allow signing out if the current user is already signed in.\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n def new\n end\n\n def create\n user = User.find_by(email: param...
ruby
chosen
[ { "from": "system", "value": "Set up message expectations with spies\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe Subscribers::Slack, type: :subscriber do\n describe '#process' do\n let(:event_name) { 'call_failed.stats_report' }\n let(:start) { 2.minutes.ag...
ruby
chosen
[ { "from": "system", "value": "Fix: Return error message with failed provider name\n" }, { "from": "human", "value": "module CurrencyRate\n class Synchronizer\n attr_accessor :storage\n\n def initialize(storage: nil)\n @storage = storage || FileStorage.new\n end\n\n def sync_fia...
ruby
chosen
[ { "from": "system", "value": "Use starting branch instead of assuming master\n" }, { "from": "human", "value": "namespace :docs do\n desc \"Generate the latest docs from the source code and add to gh-pages\"\n task :generate do\n ensure_clean_git\n run \"git checkout master\"\n run \"...
ruby
chosen
[ { "from": "system", "value": "Consolidate the three operations into separate methods.\n" }, { "from": "human", "value": "module Venn\n class Diagram\n\n def initialize\n @values = {}\n end\n\n def method_missing(meth, *args, &blk)\n if meth[-3, 3] == '_is'\n @values[me...
ruby
chosen
[ { "from": "system", "value": "Remove newlines from monkey-patch warning\n\nThese produce \"empty\" log events in Kibana which makes me :(\n```\n@fields.syslog_program:puppet AND @message:\"(/var/lib/puppet/lib/puppet/provider/package/autoload_monkey_patch.rb)\"\n```\n" }, { "from": "human", "val...
ruby
chosen
[ { "from": "system", "value": "Remove tests so Travis CI build passes.\n\nSigned-off-by: Siddharth Kannan <805f056820c7a1cecc4ab591b8a0a604b501a0b7@gmail.com>\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass BillsControllerTest < ActionController::TestCase\n test \"should get in...
ruby
chosen
[ { "from": "system", "value": "Add simple test for RefreshAll." }, { "from": "human", "value": "require_relative \"../../../test_helper\"\n\nmodule Troo\n describe RefreshAll do\n let(:described_class) { RefreshAll }\n let(:options) { { } }\n\n before do\n end\n\n after do\n ...
ruby
chosen
[ { "from": "system", "value": "Update course header stats to use students_without_instructor_students\n" }, { "from": "human", "value": "json.course do\n json.(@course, :id, :title, :description, :start, :end, :school,\n :term, :subject, :slug, :url, :listed, :submitted, :listed,\n ...
ruby
chosen
[ { "from": "system", "value": "Move file require out of method\n" }, { "from": "human", "value": "require \"torkify/version\"\n\n# Listen to tork events and execute ruby code when they happen.\n#\n# E.g.\n#\n# listener = Torkify.listener\n# class Observer\n# def on_pass(event)\n# pu...
ruby
chosen
[ { "from": "system", "value": "Correct load path expectation and add relative path expectation for __FILE__\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + '/../spec_helper'\n\n# specs for __FILE__\n\ndescribe \"The __FILE__ constant\" do\n it \"equals the current filename\" ...
ruby
chosen
[ { "from": "system", "value": "Add feature to wait until socket is open\n" }, { "from": "human", "value": "require \"foreman/kicker/version\"\nrequire \"foreman/kicker/executor\"\nrequire \"foreman/kicker/watchdog\"\n\nmodule Foreman\n module Kicker\n def self.port=(port)\n @port = port\...
ruby
chosen
[ { "from": "human", "value": "Add archived field to products\n" }, { "from": "gpt", "value": "class AddArchivedFieldToProducts < ActiveRecord::Migration\n def self.up\n add_column :products, :archived, :boolean, :default => false\n end\n\n def self.down\n remove_column :products, :archiv...
ruby
chosen
[ { "from": "system", "value": "Fix small bug in read_tag.\n" }, { "from": "human", "value": "module MIPS\n class MIPSSyntaxError < StandardError\n def initialize(msg)\n @msg = msg\n end\n\n def to_s\n msg\n end\n end\n\n # Assembly MIPS codes into machine codes.\n class ...
ruby
chosen
[ { "from": "system", "value": "Use regex to define syntax\n" }, { "from": "human", "value": "module MIPS\n class MIPSSyntaxError < StandardError\n def initialize(msg)\n @msg = msg\n end\n\n def to_s\n msg\n end\n end\n\n # Assembly MIPS codes into machine codes.\n class ...
ruby
chosen
[ { "from": "system", "value": "Fix typo for wished_product_attributes within WishedProductsController\n\nFixes #54\n" }, { "from": "human", "value": "class Spree::WishedProductsController < Spree::StoreController\n respond_to :html\n\n def create\n @wished_product = Spree::WishedProduct.new(...
ruby
chosen
[ { "from": "system", "value": "Add question and answer wrappers\n" }, { "from": "human", "value": "require \"isurvey/version\"\n\nmodule Isurvey\n attr_accessor :company_identifier, :survey_password\n\n def savon_client\n @savon_client ||= Savon.client(\n wsdl: \"https://isurveysoft.com...
ruby
chosen
[ { "from": "system", "value": "Make sure Time extensions are loaded\n\nTime::iso8601 was not available in some cases when 'time' was not already\nrequired, closes #17\n" }, { "from": "human", "value": "require 'net/http'\nrequire 'json'\nrequire 'simple_segment/version'\nrequire 'simple_segment/c...
ruby
chosen
[ { "from": "system", "value": "Add Global Trello API app_key\n" }, { "from": "human", "value": "require \"trello_standup/version\"\n\nmodule TrelloStandup\nend\n" }, { "from": "gpt", "value": "require \"trello_standup/version\"\nrequire \"trello_standup/cli\"\n\nmodule TrelloStandup\n...
ruby
chosen
[ { "from": "human", "value": "Add migration to add external_id column to gplan_nodes\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nclass AddExternalIdToGobiertoPlansNodes < ActiveRecord::Migration[5.2]\n def change\n add_column :gplan_nodes, :external_id, :string\n end\ne...
ruby
chosen
[ { "from": "system", "value": "Fix cache expiration, it was broken by e94335\n" }, { "from": "human", "value": "class FeedbacksController < ApplicationController\n before_filter :authenticate_user!, except: [:create]\n before_action :set_feedback, only: [:show, :edit, :update, :destroy]\n\n pr...
ruby
chosen
[ { "from": "human", "value": "Add implementation of twentieth rule of disambiguator prefix\n" }, { "from": "gpt", "value": "module Sastrawi\n module Morphology\n module Disambiguator\n class DisambiguatorPrefixRule20\n def disambiguate(word)\n contains = /^pe([wy])([aiueo...
ruby
chosen
[ { "from": "system", "value": "Allow organisation admins to edit themselves\n" }, { "from": "human", "value": "class UserPolicy < BasePolicy\n\n def new?\n current_user.superadmin? || current_user.admin? || current_user.organisation_admin?\n end\n alias_method :create?, :new?\n alias_metho...
ruby
chosen
[ { "from": "system", "value": "Update test for networking script\n" }, { "from": "human", "value": "control \"open-development-environment-devbox-script-networking\" do\n title \"open-development-environment-devbox-script-networking control\"\n\n describe file(\"/etc/network/interfaces\") do\n ...
ruby
chosen