conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Resolve style violation in array declaration\n" }, { "from": "human", "value": "require 'test_helper'\nrequire 'json'\n\nclass TestLambdaPermission < Minitest::Test\n def setup\n @template = ::Convection.template do\n description 'Lambda Permission Test Tem...
ruby
chosen
[ { "from": "system", "value": "[PH][99263050] OnePlatform: Create a before run hook, expose options as class variable and access it in before run hook\n" }, { "from": "human", "value": "module Autobots\n class Runner\n\n @after_hooks = []\n\n def self.after_run(&blk)\n @after_hooks <<...
ruby
chosen
[ { "from": "system", "value": "Use fenced code blocks in documentation comments [ci skip]\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'api_sampler/middleware'\n\nmodule ApiSampler\n # Integration with the parent Rails app.\n #\n # ## Usage\n #\n # Add the foll...
ruby
chosen
[ { "from": "system", "value": "Remove options params and add configuration object\n" }, { "from": "human", "value": "# frozen_string_literal: true\nrequire 'base'\nrequire 'build_audit_trigger'\nrequire 'change_audit_table'\nrequire 'create_new_audit_table'\nrequire 'create_audit_tables_for_exist...
ruby
chosen
[ { "from": "system", "value": "Add explicit require for cache library\n" }, { "from": "human", "value": "require_relative 'config'\n\nmodule Cloudstrap\n class Hook\n def initialize(name, **options)\n @name = name\n @options = options\n self\n end\n\n attr_reader :name\n\...
ruby
chosen
[ { "from": "system", "value": "Use Object, not Class, as target class\n" }, { "from": "human", "value": "module Configure\n def self.activate(target_class=nil, factory_method: nil)\n target_class ||= Class\n\n macro_module = Configure::Macro\n\n return if target_class.is_a? macro_module...
ruby
chosen
[ { "from": "system", "value": "Fix issue with missing module\n" }, { "from": "human", "value": "require \"filestack_rails/configuration\"\nrequire \"filestack_rails/transform\"\nrequire \"filestack_rails/engine\"\n\nmodule FilestackRails\n # Your code goes here...\nend\n" }, { "from": "g...
ruby
chosen
[ { "from": "system", "value": "Replace temp variables with queries\n\n`body` and `content`\n" }, { "from": "human", "value": "require 'nokogumbo'\n\nmodule Emcee\n # Document is responsible for parsing HTML and handling interaction with the\n # resulting document.\n class Document\n attr_re...
ruby
chosen
[ { "from": "human", "value": "Add initializer to automatically include Model::Ecm::Rbac::UserConcern into the User class (configured in Ecm::Rbac.user_class_name).\n" }, { "from": "gpt", "value": "Rails.configuration.to_prepare do\n puts \"Including Model::Ecm::Rbac::UserConcern in #{Ecm::Rbac.u...
ruby
chosen
[ { "from": "system", "value": "Update podspec. Should have been doing this all along.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'AmazeKit'\n s.version = '0.1.1'\n s.authors = {'Jeff Kelley' => 'SlaunchaMan@gmail.com'}\n s.license = 'Proprietary'\n s.homepage =...
ruby
chosen
[ { "from": "system", "value": "Add sub kernel declaration for C runtime.\n" }, { "from": "human", "value": "module BOAST\n\n module CRuntime\n include CompiledRuntime\n\n def fill_library_header\n get_output.puts \"#include <inttypes.h>\"\n get_output.puts \"#define __assume_alig...
ruby
chosen
[ { "from": "system", "value": "Add a method to lookup an order\n" }, { "from": "human", "value": "module Neteller\n class Client\n include HTTParty\n\n def self.config=(config)\n @@config = config\n end\n\n def self.config\n @@config\n end\n\n def initialize\n @c...
ruby
chosen
[ { "from": "system", "value": "Improve method_missing usage in JIRA::JIRAService\n\nNow we raise the proper exception but still give a more friendly message.\n" }, { "from": "human", "value": "module JIRA\nclass JIRAService < Handsoap::Service\n include RemoteAPI\n\n attr_reader :auth_token, :u...
ruby
chosen
[ { "from": "system", "value": "Refactor and add rating to response\n" }, { "from": "human", "value": "require 'nokogiri'\nrequire 'open-uri'\n\nmodule Cinch\n module Plugins\n class Tnms\n include Cinch::Plugin\n\n match /(tnms)$/\n match /(tnms) (.+)/, method: :with_num\n ...
ruby
chosen
[ { "from": "system", "value": "Remove now unnecessary upkeep phases\n\nOther games can add it back if it's needed for that game's turn\nstructure.\n" }, { "from": "human", "value": "require \"realms/turns/builder\"\n\nmodule Realms\n module Turns\n def self.structure\n @structure ||= Bui...
ruby
chosen
[ { "from": "system", "value": "Use begin-end block with response if there is an exception\n" }, { "from": "human", "value": "require 'rss'\nrequire 'open-uri'\n\nmodule Cinch\n module Plugins\n class Maniadb\n include Cinch::Plugin\n\n match /(artist) (.+)/\n match /(album) (.+...
ruby
chosen
[ { "from": "system", "value": "Make sure we only check for the sudo library on debian\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "describe service('sssd') do\n it { should be_enabled }\n it { should be_running }\nend\n\ndescr...
ruby
chosen
[ { "from": "system", "value": "Add options hash argument to client method.\n" }, { "from": "human", "value": "require 'savon'\n\nrequire 'inforouter/access_list'\nrequire 'inforouter/folder_rule'\nrequire 'inforouter/client'\nrequire 'inforouter/configuration'\nrequire 'inforouter/errors'\nrequir...
ruby
chosen
[ { "from": "system", "value": "fixture: Write to file by default, stdout on flag\n" }, { "from": "human", "value": "require 'thor'\nrequire 'puppetfiler/puppetfile'\nrequire 'puppetfiler/version'\n\nmodule Puppetfiler\n class CLI < Thor\n desc 'check [puppetfile]', 'Check forge for newe...
ruby
chosen
[ { "from": "system", "value": "Bump version after fixing image tracking\n" }, { "from": "human", "value": "spec = Gem::Specification.new do |s|\n s.name = 'piwik_analytics'\n s.version = '1.0.2'\n s.date = Time.now.strftime \"%Y-%m-%d\"\n s.author ...
ruby
chosen
[ { "from": "human", "value": "Add Snapped for Mac Beta v0.1.5\n\nThere is no stable version of this software yet.\n" }, { "from": "gpt", "value": "class Snapped < Cask\n version '0.1.5'\n sha256 '8cec22bd0c88b1fb0680e018a6706aeaf925688b84bdd2c7a2e5fdb99d20bd52'\n\n url 'http://cl.ly/2J3L2r2h0A...
ruby
chosen
[ { "from": "system", "value": "Allow limit of Scorecard::Board results.\n" }, { "from": "human", "value": "class Scorecard::Board\n include Enumerable\n\n def initialize(model, options = {})\n @model, @options = model, options\n end\n\n def each(&block)\n to_a.each &block\n end\n\n de...
ruby
chosen
[ { "from": "human", "value": "Add Souschef Runner, one that takes care\n" }, { "from": "gpt", "value": "module Souschef\n # Runner library that does all the hard work\n class Runner\n attr_accessor :opts\n\n def initialize(opts)\n @opts = opts\n adjust_cb_path\n load_config...
ruby
chosen
[ { "from": "system", "value": "Move to prepare out of initializer\n" }, { "from": "human", "value": "module SuckerPunch\n class Railtie < ::Rails::Railtie\n initializer \"sucker_punch.logger\" do\n SuckerPunch.logger = Rails.logger\n\n ActionDispatch::Reloader.to_prepare do\n ...
ruby
chosen
[ { "from": "system", "value": "Drop unit / functional / integration path components.\n\nWhen trying to determine a class name from a filename, it needs to drop\nthe unit / functional / helper / integration folder component in order\nto determine the class name correctly.\n" }, { "from": "human", ...
ruby
chosen
[ { "from": "system", "value": "Fix for Aggregator memory adapter initialization\n" }, { "from": "human", "value": "require 'delegate'\nrequire 'moneta'\n\nmodule Tronprint\n class Aggregator < Delegator\n def initialize(options = {})\n adapter_underscored = options.delete :adapter\n ...
ruby
chosen
[ { "from": "system", "value": "Add coordinates_for, add_missing_coordinates, remove_extra_characters, add_county_to_incomplete_location\n" }, { "from": "human", "value": "module BigBrotherPR\n module Utils\n def self.included(base)\n base.extend(self)\n end\n\n def add_base_url_to_...
ruby
chosen
[ { "from": "system", "value": "Add yardoc return type for configuration attribute" }, { "from": "human", "value": "require 'one_signal/version'\nrequire 'one_signal/client'\nrequire 'forwardable'\n\n# The OneSignal module provides access to all the main operations\nmodule OneSignal\n class << se...
ruby
chosen
[ { "from": "system", "value": "Simplify EmailAssessor.domain_in_file? line checking logic\n" }, { "from": "human", "value": "require \"email_assessor/email_validator\"\n\nmodule EmailAssessor\n def self.domain_is_disposable?(domain)\n domain_in_file?(domain, configuration.disposable_domains_f...
ruby
chosen
[ { "from": "system", "value": "Allow a mute option for tests\n" }, { "from": "human", "value": "module Frisky\n # This class provides the foundations for a standalone command\n class Command\n extend ActiveSupport::Concern\n\n attr_reader :options\n\n def initialize(options)\n @op...
ruby
chosen
[ { "from": "system", "value": "Refactor duplicate code into method" }, { "from": "human", "value": "module GitRecent\n require 'thor'\n class Cli < Thor\n desc 'list', 'List recently checked-out git branches'\n def list\n recent_branch_names = GitRecent::BranchLister.new.branch_names...
ruby
chosen
[ { "from": "system", "value": "Add queue_path method to Batch class" }, { "from": "human", "value": "require 'active_support'\n\nmodule JobBoss\n class Batch\n attr_accessor :batch_id\n\n extend ActiveSupport::Memoizable\n # Used to queue jobs in a batch\n # Usage:\n # batch.que...
ruby
chosen
[ { "from": "human", "value": "Add rake task to register routes\n\nThe register_routes task will be needed until the point that manuals are\nregistered as artefacts in panopticon, at which point route registration\ncan be done from there.\n" }, { "from": "gpt", "value": "namespace :router do\n ta...
ruby
chosen
[ { "from": "system", "value": "Modify error message to write to STDERR\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'octokit'\nrequire 'rugged'\n\nmodule Upstreamer\n class CLI\n def self.run(argv = ARGV)\n self.new(argv).run\n end\n\n def initialize(argv = ARGV)...
ruby
chosen
[ { "from": "system", "value": "Refactor Summoner in preparation for new API calls\n" }, { "from": "human", "value": "class Vigor\n class Summoner\n attr_accessor :id, :name, :profile_icon_id, :level, :revision_date\n\n def initialize(data)\n @id = data[\"id\"]\n @name = data[\"na...
ruby
chosen
[ { "from": "system", "value": "Make sure we use an adapter for our faraday connection\n\nWhen adding middleware to the faraday connection we need to\nbe explicit about which adapter we'll use, otherwise no HTTP\nrequests are actually made.\n\nSadly, Faraday doesn't raise an exception if the adapter is\nmissi...
ruby
chosen
[ { "from": "system", "value": "Use the correct version tag\n" }, { "from": "human", "value": "name \"chef-marketplace\"\nmaintainer \"Chef Software, Inc. <partnereng@chef.io>\"\nhomepage \"http://www.chef.io\"\nlicense \"Apache-2.0\"\nlicense_file \"LICENSE\"\n\ninstall_dir \"/opt/chef-marketplac...
ruby
chosen
[ { "from": "system", "value": "Add tasks to run event archiving and importing\n" }, { "from": "human", "value": "\nnamespace :events do\nend\n" }, { "from": "gpt", "value": "namespace :events do\n desc \"Export events to S3. Defaults to the beginning of week 2 months ago, otherwise d...
ruby
chosen
[ { "from": "system", "value": "Update multi_json dependency to 1.7\n" }, { "from": "human", "value": "require File.expand_path('../lib/magnum/payload/version', __FILE__)\n\nGem::Specification.new do |s|\n s.name = \"magnum-payload\"\n s.version = Magnum::Payload::VERSION\n s.summary...
ruby
chosen
[ { "from": "system", "value": "Add a simple basic user agent\n" }, { "from": "human", "value": "require \"gemstash\"\nrequire \"faraday\"\nrequire \"faraday_middleware\"\n\nmodule Gemstash\n #:nodoc:\n class WebError < StandardError\n attr_reader :code\n\n def initialize(message, code)\n ...
ruby
chosen
[ { "from": "system", "value": "Move this to the top, as it should get your attention first.\n" }, { "from": "human", "value": "module ConveyorBelt\n\n class Contract\n\n attr_reader :mass_operation\n\n def find target_id\n target_id\n end\n\n def start_mass_operation_definition ...
ruby
chosen
[ { "from": "system", "value": "Change basic auth middleware to only rely on simple data.\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'faraday'\nrequire 'base64'\n\nmodule Github\n class Request\n class BasicAuth < Faraday::Middleware\n dependency 'base64'\n\n def...
ruby
chosen
[ { "from": "system", "value": "Use 1.8.7-style map with symbol-to-proc.\n" }, { "from": "human", "value": "module Librarian\n #\n # Represents the output of the resolution process. Captures the declared\n # dependencies plus the full set of resolved manifests. The sources are\n # already know...
ruby
chosen
[ { "from": "system", "value": "Fix typo in option description\n" }, { "from": "human", "value": "require 'optparse'\nmodule Lifelike\n module CLI\n class Options\n def self.parse!(argv)\n new.parse!(argv)\n end\n\n def initialize\n @options = default_options\n ...
ruby
chosen
[ { "from": "system", "value": "Add debugging info to rotation\n" }, { "from": "human", "value": "require 'cymbal'\n\nmodule Menagerie\n ##\n # Connection object that contains releases\n class Collection\n def initialize(params = nil)\n params = Cymbal.symbolize(params || {})\n @pa...
ruby
chosen
[ { "from": "system", "value": "Remove the platform attribute from the gemspec, as is the new style.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire \"librarian/version\"\n\nG...
ruby
chosen
[ { "from": "system", "value": "Allow users to specify options for Sass.\n" }, { "from": "human", "value": "module Jekyll\n class Sass < Converter\n safe true\n priority :low\n\n def matches(ext)\n ext =~ /^\\.sass$/i\n end\n\n def output_ext(ext)\n \".css\"\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Add filtering to budgets entities load" }, { "from": "human", "value": "module PopulateData\n module Gobierto\n class Entity < Client\n\n ENDPOINT_URI = \"/collections/c-entidades-presupuestos-municipales/items\".freeze\n\n attr_reader(\n :munic...
ruby
chosen
[ { "from": "system", "value": "Add name attribute to chef cookbooks for compatibility with Chef >=12\n" }, { "from": "human", "value": "maintainer \"Colin Surprenant\"\nmaintainer_email \"colin.surprenant@gmail.com\"\nlicense \"MIT License\"\ndescription \"installs and configu...
ruby
chosen
[ { "from": "system", "value": "Fix for uninitialized constant Forwardable\n\nI get the following error when running middleman with the\nmiddleman-pagination plugin installed:\n\n uninitialized constant Middleman::Pagination::ExtensionContext::Forwardable (NameError)\n\nHere is a fix.\n" }, { "from...
ruby
chosen
[ { "from": "system", "value": "Add methods to Grape::Route to support rake routes\n\nGrape::Route does not have corresponding methods to run properly in\npardino's rake routes task. This commit adds those methods.\n" }, { "from": "human", "value": "#encoding: UTF-8\n\nmodule PadrinoGrape\n\n mod...
ruby
chosen
[ { "from": "system", "value": "Use new User.find in Config\n" }, { "from": "human", "value": "require 'dotenv'\nrequire 'hashie'\n\nmodule Pagerduty\n module CLT\n class Config\n include PathHelper\n\n DEFAULT_CONFIG_FILE = File.join(ENV['HOME'], '.pagerduty_env')\n\n def initi...
ruby
chosen
[ { "from": "system", "value": "Fix 'stack level too deep' in TemplateError\n" }, { "from": "human", "value": "class TemplateError < StandardError\n attr_accessor :original, :template\n\n def initialize(template, message, original = nil)\n super(message)\n self.template = template\n sel...
ruby
chosen
[ { "from": "system", "value": "Change how items are reloaded from yaml checkpoints\n\nWe now attempt to keep objects (ids) and just reload individual smaller\ndata points. This means most Optical:: objects are done in turn on just\ntheir instance values, also arrays are not loaded in bulk, instead their\nval...
ruby
chosen
[ { "from": "system", "value": "Use the Github HTTPS URL" }, { "from": "human", "value": "require 'rubygems'\n\nGem::Specification.new do |spec|\n spec.name = 'radcli'\n spec.version = '1.0.0'\n spec.authors = ['Mårten Cassel']\n spec.license = 'Artistic-2.0'\n spec.e...
ruby
chosen
[ { "from": "system", "value": "Correct comment about starting the server.\n" }, { "from": "human", "value": "# Use the same API key and secret as the live version.\nPusherFake.configure do |configuration|\n configuration.app_id = Pusher.app_id\n configuration.key = Pusher.key\n configuratio...
ruby
chosen
[ { "from": "system", "value": "Allow vocabulary not to load, but issue an error; these are typically transient, when the vocabularies are being built.\n" }, { "from": "human", "value": "require 'rdf'\nrequire 'rdf/vocabulary'\nrequire 'rdf/vocab'\n\n# Monkey-patch RDF::Vocab.each to load all voca...
ruby
chosen
[ { "from": "system", "value": "Drop change email button in example app\n" }, { "from": "human", "value": "class FormController < UIViewController\n URL_REGEX = /https?:\\/\\/[\\S]+/\n\n attr_reader :form\n\n def viewDidLoad\n super\n\n view.backgroundColor = '#EFEFF4'.to_color\n self....
ruby
chosen
[ { "from": "system", "value": "Simplify Piwik Plugins Service and use deliver instead of http_post\n" }, { "from": "human", "value": "class Service::PiwikPlugins < Service::HttpPost\n\n self.title = 'Piwik Plugins'\n\n url \"http://plugins.piwik.org/\"\n\n logo_url \"http://piwik.org/wp-conten...
ruby
chosen
[ { "from": "system", "value": "Verify connection before requests (MySQL error)\n" }, { "from": "human", "value": "require 'uri'\nrequire 'time'\nrequire 'sinatra/base'\nrequire 'active_record'\nrequire 'logger'\n\nmodule Sinatra\n module ActiveRecordHelper\n def database\n options.databa...
ruby
chosen
[ { "from": "system", "value": "Add additional hack to make it work with redis.\n" }, { "from": "human", "value": "require 'taggable_cache/extensions'\n\nmodule TaggableCache\n class Railtie < ::Rails::Railtie\n initializer \"taggable_cache\" do |app|\n ActiveSupport.on_load(:active_recor...
ruby
chosen
[ { "from": "system", "value": "Use a lenient bundler 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 \"mixlib/install/version\"\n\nGem::Specification.new do |spec|\n spec...
ruby
chosen
[ { "from": "human", "value": "Add some specs for Rbuv::Poll\n" }, { "from": "gpt", "value": "require 'spec_helper'\nrequire 'shared_examples/handle'\nrequire 'shared_context/loop'\nrequire 'socket'\n\ndescribe Rbuv::Poll do\n include_context Rbuv::Loop\n subject { Rbuv::Poll.new(loop, 0) }\n\n ...
ruby
chosen
[ { "from": "system", "value": "Update spec helper to include ActiveModel\n" }, { "from": "human", "value": "require 'rubygems'\n\n# All our specs should require 'spec_helper' (this file)\n\n# If RACK_ENV isn't set, set it to 'test'. Sinatra defaults to development,\n# so we have to override that...
ruby
chosen
[ { "from": "human", "value": "Add rmonitor configuration for my work laptop\n" }, { "from": "gpt", "value": "profile \"docked\" do\n device \"DP1-1\", :mode => \"1920x1080\", :rate => \"60.00\"\n device \"DP1-2\", :mode => \"1920x1080\", :rate => \"60.00\", :right_of => \"DP1-1\"\nend\n\nprofil...
ruby
chosen
[ { "from": "system", "value": "Apply current_term scope to `GET /api/lectures`\n" }, { "from": "human", "value": "class Api::LecturesController < Api::BaseController\n include Garage::RestfulActions\n include Garage::NoAuthentication\n\n def require_resources\n @resources = Lecture.includes...
ruby
chosen
[ { "from": "human", "value": "Add Source Han Code JP\n\nref https://github.com/adobe-fonts/source-han-code-jp\n" }, { "from": "gpt", "value": "cask :v1 => 'font-source-han-code-jp' do\n version '1.002'\n sha256 'ba717c01e3dd3a3dd0ef4ee7c433171ad5ef502d2187f189762128b66ca84a73'\n\n url 'https:/...
ruby
chosen
[ { "from": "system", "value": "Fix mock so it returns 201 and not 200\n\nThe mock implementation is now closer to the production code behavior.\n" }, { "from": "human", "value": "require 'sinatra'\n\nmodule ApiWrapperExample\n module Mock\n # Simple in-memory API server implementation\n cl...
ruby
chosen
[ { "from": "system", "value": "Change outbound email address and subject line in mailer\n" }, { "from": "human", "value": "class NotificationMailer < ActionMailer::Base\n default from: \"notifications@cityvoice.com\"\n include NotificationsMailerHelper\n helper :notifications_mailer\n\n def c...
ruby
chosen
[ { "from": "system", "value": "Sort requsts on the index page by name\n" }, { "from": "human", "value": "class RequestsController < ApplicationController\n\n def index\n \t@requests = Request.all\n \t@new_request = Request.new\n end\n\n def show\n \t@request = Request.find(params[:id])\n e...
ruby
chosen
[ { "from": "human", "value": "Patch rake test for Ruby 1.9.3 and Rake 0.9.2.\n\nRuby 1.9.3, especially with patches, is so much faster to start than 1.9.2, but\nthe changes in the test libraries mean that Rake-defined test tasks don't work\nprior to Rake 0.9.2.2. Alas, we're obliged by Passenger to use the s...
ruby
chosen
[ { "from": "system", "value": "Add a sketchy spec for the 'include' method\n" }, { "from": "human", "value": "module MyMixin\n def say_hello\n puts \"Hello #{name}\"\n end\nend\n\nclass MyClass\n include MyMixin\n\n def name\n \"Dan\"\n end\nend\n\ndescribe \"Mixins\" do\n example \"t...
ruby
chosen
[ { "from": "system", "value": "Remove most of the temporary setup.\n" }, { "from": "human", "value": "#!/usr/bin/env ruby -I.\n\nrequire 'gosu_enhanced'\n\nrequire 'constants'\nrequire 'resources'\nrequire 'grid'\nrequire 'drawer'\nrequire 'animation'\n\nmodule ColumnDrop\n # Gem drop game\n cl...
ruby
chosen
[ { "from": "system", "value": "Update ruby on rails path description\n\nAdd 'using Ruby on Rails' at the end of the description" }, { "from": "human", "value": "# ***************************\n# Path - Full Stack Rails\n# ***************************\n@path = Seeds::PathSeeder.create do |path|\n p...
ruby
chosen
[ { "from": "system", "value": "Add rdoc as explicit dependency for ruby 1.8.7\n\nSigned-off-by: Richard Su <7714f540107d51b2f3f593edc327741039c9a8f2@redhat.com>\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"aeolus-image\"\n s.version = \"0.6.0\"\n s...
ruby
chosen
[ { "from": "system", "value": "Use Opal::Server directly for running specs\n" }, { "from": "human", "value": "require 'bundler'\nBundler.require\n\nrequire 'opal/spec/server'\n\n# method_missing can be turned off if required (on by default)\n# Opal::Processor.method_missing_enabled = false\n\n# R...
ruby
chosen
[ { "from": "system", "value": "Set the Game owner's player name when creating a game.\n" }, { "from": "human", "value": "class GamesController < ApplicationController\n before_action :authenticate_user!, except: :events\n\n def index\n end\n\n def create\n @game = current_user.games.create...
ruby
chosen
[ { "from": "system", "value": "Use File.exist? instead of deprecated File.exists?\n" }, { "from": "human", "value": "class Forgery\n\n class FileReader\n\n # Returns an array of strings containing each line in the dictionary\n def self.read_dictionary(dictionary)\n read_file(find_file...
ruby
chosen
[ { "from": "system", "value": "Fix UDPSocket.new spec, Solaris reports a different error on unknown protocol family.\n" }, { "from": "human", "value": "require File.expand_path('../../../../spec_helper', __FILE__)\nrequire File.expand_path('../../fixtures/classes', __FILE__)\n\ndescribe 'UDPSocke...
ruby
chosen
[ { "from": "human", "value": "Add Facter fact that exposes location of the Ruby binary on the system.\n\nThis fact will expose location of the Ruby interpreter on the underlying\noperating system. This might be useful when Ruby binary is located\nin a different place than \"/usr/bin/ruby\" for whatever reas...
ruby
chosen
[ { "from": "system", "value": "Include a SHA256 of each file in the data list\n" }, { "from": "human", "value": "json.array! @bot_data do |data|\n json.key data.key\n json.created_at data.created_at\n json.updated_at data.updated_at\nend\n" }, { "from": "gpt", "value": "json.array!...
ruby
chosen
[ { "from": "system", "value": "Update bundler dev dep to v2\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'everything/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Include tests for event edits\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass EventsEditTest < ActionDispatch::IntegrationTest\nend\n" }, { "from": "gpt", "value": "require 'test_helper'\n\nclass EventsEditTest < ActionDispatch::Integra...
ruby
chosen
[ { "from": "system", "value": "Add necessary Web-Lgcy-Scripting feature to support WMI access\n" }, { "from": "human", "value": "powershell_script 'Install SMTP' do\n code <<-EOH\n Add-WindowsFeature Smtp-Server, Web-Lgcy-Mgmt-Console\n EOH\n action :run\n not_if \"(Get-WindowsFeature -Name ...
ruby
chosen
[ { "from": "system", "value": "Fix issue with url redirects not working\n" }, { "from": "human", "value": "module Breezy\n module XHRHeaders\n def redirect_back(fallback_location:, **args)\n if referer = request.headers[\"X-XHR-Referer\"]\n redirect_to referer, **args\n else\...
ruby
chosen
[ { "from": "system", "value": "Add unique index on internal_code\n" }, { "from": "human", "value": "class CreateBanks < ActiveRecord::Migration\n def change\n create_table table_name, force: true do |t|\n t.integer \"reg_number\"\n t.integer \"internal_code\"\n t.string \"b...
ruby
chosen
[ { "from": "system", "value": "Refactor OpenResponseAnswerSpec to use let\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Embeddable::OpenResponseAnswer do\n before(:each) do\n @answer = Embeddable::OpenResponseAnswer.create({\n :answer_text => \"the answer\...
ruby
chosen
[ { "from": "system", "value": "Remove dummy dsl spec for evaluator\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Henson::DSL do\n context \"self.evaluate\" do\n let(:instance) { Henson::DSL.new }\n it \"creates a new instance and calls evaluate\" do\n Henson::DS...
ruby
chosen
[ { "from": "system", "value": "Update gemspec description, summary, & homepage\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/sports_data_api/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Ryan Lovelett\"]\n gem.em...
ruby
chosen
[ { "from": "system", "value": "Use omniauth.origin, get rid of custom logic\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n # Prevent CSRF attacks by raising an exception.\n # For APIs, you may want to use :null_session instead.\n protect_from_forgery ...
ruby
chosen
[ { "from": "system", "value": "Add helper_method alias to :current_user method in AppController.\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n protect_from_forgery with: :exception\n\n private\n def current_user\n @current_user ||= User.find(s...
ruby
chosen
[ { "from": "system", "value": "Set new_session_path for Omniauth error\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n before_action :authenticate_user!, :prepare_search_users\n protect_from_forgery with: :exception\n\n def prepare_search_users\n @q...
ruby
chosen
[ { "from": "system", "value": "Use Identity Map middleware in ApplicationController\n\nThis is necessary as of dm-rails http://is.gd/cNc3z\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n protect_from_forgery\n layout 'application'\nend\n" }, { "...
ruby
chosen
[ { "from": "system", "value": "Fix redirection URL when rescuing CanCan::AccessDenied\n" }, { "from": "human", "value": " class ApplicationController < ActionController::Base\n protect_from_forgery\n\n rescue_from CanCan::AccessDenied do |exception|\n redirect_to ENV[\"API_BASE_HOST\"], :al...
ruby
chosen
[ { "from": "system", "value": "Fix sign-in redirecting \"back\" to a missing image because missing static files hit the raise_not_found method\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n # Prevent CSRF attacks by raising an exception.\n # For APIs, ...
ruby
chosen
[ { "from": "system", "value": "Fix redirect_to to use path." }, { "from": "human", "value": "class AssignmentsController < ApplicationController\n def index\n @assignments = Assignment.all\n end\n \n def show\n if Assignment.exists?(params[:id])\n @assignment = Assignment.find(pa...
ruby
chosen
[ { "from": "system", "value": "Add votes variable to get councillor votes\n" }, { "from": "human", "value": "class CouncillorsController < ApplicationController\n\n\tdef index\n\t\t@councillors = Councillor.all.order(:last_name).includes(:ward)\n\tend\n\n\tdef show\t\n\t\t@councillor = Councillor...
ruby
chosen
[ { "from": "system", "value": "Add discount serializer back temporarily until we fix apple pay\n" }, { "from": "human", "value": "class SubmissionsController < ApplicationController\n respond_to :html, :json\n must_be_authenticated\n\n def all\n @submissions = current_user.submissions\n ...
ruby
chosen
[ { "from": "system", "value": "Set a default sort order for everything\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n# Nothing much special here\nclass ApplicationRecord < ActiveRecord::Base\n self.abstract_class = true\nend\n" }, { "from": "gpt", "value": "# fr...
ruby
chosen
[ { "from": "system", "value": "Remove autosave: true from belongs_to.\n" }, { "from": "human", "value": "##\n# Join model for RTP and invoice\nclass InvoiceAllocation < ApplicationRecord\n belongs_to :cf0925, autosave: true, inverse_of: :invoice_allocations\n # delegate *Cf0925.column_names, to...
ruby
chosen