conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Enable level 2 for everyone\n" }, { "from": "human", "value": "class LevelAccess < Struct.new(:team)\n\n def can_access?(level)\n return true if level == 1\n score = get_score_for(level-1)\n required = get_required_for(level-1)\n score >= required\n en...
ruby
chosen
[ { "from": "human", "value": "Add test for expanded links endpoint\n\nThis endpoint used to be internal for testing, but we will now use it\nfrom other apps. It needs some tests.\n" }, { "from": "gpt", "value": "require \"rails_helper\"\n\nRSpec.describe \"GET /v2/expanded-links/:id\", type: :req...
ruby
chosen
[ { "from": "human", "value": "Add specs for attributes comparison (based on latest Equalizer gem working version)\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Virtus::Attribute, '#== (defined by including Virtus::Equalizer)' do\n let(:attribute) { described_class.build(Stri...
ruby
chosen
[ { "from": "system", "value": "Add acts_as_list to subscription template groups\n" }, { "from": "human", "value": "module Subscriptions\n module Concerns\n module Models \n module SubscriptionTemplateGroup\n extend ActiveSupport::Concern\n \n included do\n ...
ruby
chosen
[ { "from": "system", "value": "Update release date of gem.\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\nrequire \"annotate_models/version\"\n\nGem::Specification.new do |spec|\n\n spec.name = \"annotate_models\"\n spec.version = AnnotateModels:...
ruby
chosen
[ { "from": "system", "value": "Add handling for multi-word and multi-ingredient searching\n" }, { "from": "human", "value": "class Recipe < ActiveRecord::Base\n has_many :comments\n validates_presence_of :api_id\n def self.get_recipes_by_ingredient(ingredient, limit)\n \n response = HTTP...
ruby
chosen
[ { "from": "system", "value": "Make AuditLogger talk to NewRelic, not Airbrake\n\nWe removed Airbrake in 480b55289725eebd3cd15977f229f298c1cbdf7d but didn't stop the logger from talking to it. We can achieve the same thing with the ``NewRelic::Agent.notice_error`` api (although we can't provide quite as muc...
ruby
chosen
[ { "from": "system", "value": "Add the before_destroy callback in Alumni model\n\n- Before destroying an Alumni, always destroy the associated\n AlumniStatus, AlumniData and the TieAlumni records too.\n\nSigned-off-by: Siddharth Kannan <805f056820c7a1cecc4ab591b8a0a604b501a0b7@gmail.com>" }, { "from...
ruby
chosen
[ { "from": "system", "value": "Add before_save { self.restaurant_name to capitalize first letter" }, { "from": "human", "value": "class Review < ApplicationRecord\n belongs_to :user\n belongs_to :restaurant\n has_many :review_cuisines\n has_many :cuisines, through: :review_cuisines\n\n valid...
ruby
chosen
[ { "from": "system", "value": "Remove glow lib from dummy load path" }, { "from": "human", "value": "require 'rubygems'\ngemfile = File.expand_path('../../Gemfile', __FILE__)\n\nif File.exist?(gemfile)\n ENV['BUNDLE_GEMFILE'] = gemfile\n require 'bundler'\n Bundler.setup\nend\n\n$:.unshift Fil...
ruby
chosen
[ { "from": "human", "value": "Make sure MetaTags.config/configuration work as expected" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe MetaTags::Configuration do\n it 'should be returned by MetaTags.config' do\n expect(MetaTags.config).to be_instance_of(MetaTags::Configuratio...
ruby
chosen
[ { "from": "system", "value": "Use memory adapter for rom isolation specs\n" }, { "from": "human", "value": "require 'rom-rails'\n\ndescribe ROM, '.finalize' do\n subject(:env) { ROM.finalize.env }\n\n before { ROM.setup(:sql, 'sqlite::memory') }\n\n it 'sets up lazy-env first' do\n expect(...
ruby
chosen
[ { "from": "system", "value": "Use a different redis database while testing\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\n$: << File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'lib'))\n\nrequire 'pathname'\nrequire 'yajl'\nrequire 'beanstalk-client'\nrequire 'daemons'\n...
ruby
chosen
[ { "from": "system", "value": "Fix calculation issue with nyc totals\n" }, { "from": "human", "value": "class LocationsController < ApplicationController\n\n\tdef show\n\n\tend\n\n\tdef ros_index\n\t\t@location = Location.find_by(loc_code:\"ros\")\n\t\t@location_name = @location.name\n\t\t@total_...
ruby
chosen
[ { "from": "system", "value": "Fix rescue_from order in PositionsController\n" }, { "from": "human", "value": "class PositionsController < ApplicationController\n respond_to :json\n\n rescue_from ActionController::RoutingError, with: :render_404\n rescue_from ActiveRecord::RecordNotFound, with...
ruby
chosen
[ { "from": "system", "value": "Make @colour_palette accessible to all methods" }, { "from": "human", "value": "class TeamNameController < ApplicationController\n skip_before_action :verify_authenticity_token, only: [:create]\n\n def create\n @colour_palette = [\n \"purple\",\n \"ma...
ruby
chosen
[ { "from": "human", "value": "Add basic test for substitutions\n" }, { "from": "gpt", "value": "require 'test_helper'\n\ncontext \"Substitions\" do\n setup do\n @rendered = render_string(\":frog: Yo, I am a frog.\\n\\nA frog says, '{frog}'\")\n end\n\n test \"defines\" do\n result = N...
ruby
chosen
[ { "from": "system", "value": "Refactor test to only do one it\n" }, { "from": "human", "value": "require_relative '../../../../spec_helper'\n\ndescribe 'govuk::app::package', :type => :define do\n let(:title) { 'giraffe' }\n\n context 'with no params' do\n it do\n expect {\n sho...
ruby
chosen
[ { "from": "system", "value": "Use a question mark for checkign in hash\n" }, { "from": "human", "value": "$:.unshift File.join(File.dirname(__FILE__), *%w[lib])\n\nrequire 'rubygems'\nrequire 'pagoda/app'\nrequire 'digest/md5'\n\nuse Rack::ShowExceptions\n\nif ENV.has_key 'HTTP_MESSAGE'\n messa...
ruby
chosen
[ { "from": "system", "value": "Add middleware to insert <script> tag\n" }, { "from": "human", "value": "require 'rack'\nrequire 'rack/proxy'\nrequire 'uri'\n\nGOV_UK_URL = URI.parse('https://www.gov.uk')\nMIRROR_JAVASCRIPT_PATH = '/mirror.js'\n\nclass Proxy < Rack::Proxy\n def rewrite_env(env)\n...
ruby
chosen
[ { "from": "system", "value": "Remove unused 'remember me' code\n\n\ngit-svn-id: 801577a2cbccabf54a3a609152c727abd26e524a@1250 a18515e9-6cfd-0310-9624-afb4ebaee84e\n" }, { "from": "human", "value": "class BunnySessionsController < ApplicationController\n def new\n end\n \n def create\n sel...
ruby
chosen
[ { "from": "system", "value": "Handle the custom search path for XCTest\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'Specta'\n s.version = '1.0.5'\n s.license = 'MIT'\n s.summary = 'A light-weight TDD / BDD framework.'\n s.homepage = 'http://github.com/specta/sp...
ruby
chosen
[ { "from": "system", "value": "Add tests for creating labelings\n" }, { "from": "human", "value": "# Brimir is a helpdesk system to handle email support requests.\n# Copyright (C) 2012-2014 Ivaldi http://ivaldi.nl\n#\n# This program is free software: you can redistribute it and/or modify\n# it un...
ruby
chosen
[ { "from": "system", "value": "Remove codebar logo from course invitation attachments\n" }, { "from": "human", "value": "class CourseInvitationMailer < ActionMailer::Base\n include EmailHeaderHelper\n\n helper ApplicationHelper\n\n def invite_student course, member, invitation\n @course = C...
ruby
chosen
[ { "from": "system", "value": "Update author name and email\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"NSData+TDTImageMIMEDetection\"\n s.version = \"0.1.0\"\n s.summary = \"Category on NSData to check if it represents PNG or JPEG.\"\n s...
ruby
chosen
[ { "from": "system", "value": "Tests: Use before/after :all, not before/after :each\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Tracking::CLI do\n\n\tbefore :each { backup_data }\n\tafter :each { restore_data }\n\n\tit 'performs a few operations on a new list and then cl...
ruby
chosen
[ { "from": "human", "value": "Add a spec for GitHub Enterprise support\n" }, { "from": "gpt", "value": "describe '...' do\n\n MOCK_GHE_HOST = 'ghe.example.com'\n MOCK_USER = 'foo'\n MOCK_PASSWORD = 'bar'\n MOCK_AUTHZ_GHE_URL = \"http://#{MOCK_USER}:#{MOCK_PASSWORD}@#{MOCK_GHE_HOST}/\"\n MOCK...
ruby
chosen
[ { "from": "system", "value": "Fix shared runners queue update\n" }, { "from": "human", "value": "module Ci\n class UpdateBuildQueueService\n def execute(build)\n build.project.runners.each do |runner|\n if runner.can_pick?(build)\n runner.tick_runner_queue\n end\n...
ruby
chosen
[ { "from": "system", "value": "Add author and change homepage to reflect maintainer change\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'rack-reverse-proxy'\n s.version = \"0.8.1\"\n s.authors = [\"Jon Swope\", \"Ian Ehlert\", \"Roman Ernst\"...
ruby
chosen
[ { "from": "system", "value": "Add cancellation reason, timestamps to visit API\n\nSo that PVB Public can build a visit show page with the reason.\n" }, { "from": "human", "value": "json.visit do\n json.id @visit.id\n json.processing_state @visit.processing_state\n json.prison_id @visit.prison...
ruby
chosen
[ { "from": "system", "value": "Remove TODO comments from DBParameterGroup\n" }, { "from": "human", "value": "module Terraforming::Resource\n class DBParameterGroup\n def self.tf(client = Aws::RDS::Client.new)\n # TODO: fetch parameter (describe-db-parameters)\n Terraforming::Resourc...
ruby
chosen
[ { "from": "system", "value": "Allow seed to take admin credentials from env\n" }, { "from": "human", "value": "# Seed add you the ability to populate your db.\n# We provide you a basic shell for interaction with the end user.\n# So try some code like below:\n#\n# name = shell.ask(\"What's your...
ruby
chosen
[ { "from": "human", "value": "Add seed data from users and list of genres\n" }, { "from": "gpt", "value": "# Users\n\nUser.create(\n username: \"evan\",\n email: \"evan@email.com\",\n password: \"000000\",\n password_confirmation: \"000000\"\n)\n\nUser.create(\n username: \"mphelps\",\n ema...
ruby
chosen
[ { "from": "system", "value": "Clean up before starting the spec\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe Api::V1::InvoicesController, type: :controller do\n include Randomness\n include ResponseJson\n\n it 'should list all Invoices for a Transaction' do\n rand_...
ruby
chosen
[ { "from": "human", "value": "Add first Middleware tests :D\n" }, { "from": "gpt", "value": "require 'spec_helper'\nrequire 'rack'\nrequire './lib/organic-sitemap/middleware/url_capture'\nrequire 'pry'\n\ndescribe OrganicSitemap::Middleware::UrlCapture do\n let(:app) { proc{[status, headers, bod...
ruby
chosen
[ { "from": "system", "value": "Switch sample spec to truncation\n\nPostgresql was experiencing \"No live threads left. Deadlock?\" under\nRails 5.1.\n" }, { "from": "human", "value": "# This file is copied to ~/spec when you run 'ruby script/generate rspec'\n# from the project root directory.\nEN...
ruby
chosen
[ { "from": "system", "value": "Refactor Spree::Money's with_currency and no_cents option settings\n" }, { "from": "human", "value": "require 'money'\n\nmodule Spree\n class Money\n attr_reader :money\n\n def initialize(amount, options={})\n @money = ::Money.parse([amount, (options[:cu...
ruby
chosen
[ { "from": "system", "value": "Update our cron job format.\n" }, { "from": "human", "value": "# Use this file to easily define all of your cron jobs.\n#\n# It's helpful, but not entirely necessary to understand cron before proceeding.\n# http://en.wikipedia.org/wiki/Cron\n\nset :output, \"log/cro...
ruby
chosen
[ { "from": "system", "value": "Update React dependency in podspec\n" }, { "from": "human", "value": "require 'json'\nversion = JSON.parse(File.read('package.json'))[\"version\"]\n\nPod::Spec.new do |s|\n\n s.name = \"BVLinearGradient\"\n s.version = version\n s.homepage ...
ruby
chosen
[ { "from": "system", "value": "Use vcloud-launcher configs in govuk-provisioning\n\nvcloud-templates and vcloud-box-spinner are dead. This is a simpler version\nof Nicola's yaml_input branch which:\n\n- Uses the updated syntax of vcloud-launcher\n- Only takes the required items out of each vApp entry\n- Does...
ruby
chosen
[ { "from": "system", "value": "Maintain db schema from spec helper\n" }, { "from": "human", "value": "require 'simplecov'\nSimpleCov.start 'rails'\n\nENV['RAILS_ENV'] = 'test'\n\nrequire File.expand_path('../../config/environment', __FILE__)\n\nrequire 'rspec/rails'\nrequire 'capybara/poltergeist...
ruby
chosen
[ { "from": "system", "value": "Update tarball URL and sha256 to 2016.10.25" }, { "from": "human", "value": "class Halide < Formula\n desc \"The Halide image processing language\"\n homepage \"http://halide-lang.org\"\n url \"https://github.com/halide/Halide/releases/download/release_2016_03_02...
ruby
chosen
[ { "from": "system", "value": "Remove unused & incorrect copy/pasted code.\n" }, { "from": "human", "value": "module SpreeRelatedProducts\n module Generators\n class InstallGenerator < Rails::Generators::Base\n\n # def add_javascripts\n # append_file \"app/assets/javascripts/store...
ruby
chosen
[ { "from": "system", "value": "Fix minor bug in filter controller\n" }, { "from": "human", "value": "class FiltersController < ApplicationController\n def edit\n @languages = Filter.where(filterable_type:\"Language\")\n @skills = Filter.where(filterable_type:\"Skill\")\n @text_editors =...
ruby
chosen
[ { "from": "system", "value": "Check if VM is already powered off before halting\n\nBefore this commit, rolling back a snapshot from a VM in a poweroff\nstate results in the below error:\n\nStderr: VBoxManage: error: Invalid machine state: PoweredOff (must be\nRunning, Paused or Stuck)\n\nThis commit adds a ...
ruby
chosen
[ { "from": "system", "value": "Check that MathJax SVGs are actually valid\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass Mathematical::MathJaxTest < Test::Unit::TestCase\n\n render = Mathematical::Render.new\n\n MATHJAX_TEST_TEST_DIR = File.join('ext', 'mathematical', 'mtex2M...
ruby
chosen
[ { "from": "system", "value": "Complete reducing page load time by updating JSON serializers\n" }, { "from": "human", "value": "class ChapterSerializer < ActiveModel::Serializer\n attributes :id, :created_at, :completed_at, :title, :description, :goal\n has_many :entries\nend\n" }, { "f...
ruby
chosen
[ { "from": "system", "value": "Order editions by title in the topics manager\n" }, { "from": "human", "value": "class TopicsController < ApplicationController\n before_action :instantiate_latest_editions, only: [:new, :edit]\n\n def index\n @topics = Topic.all.order(updated_at: :desc)\n end...
ruby
chosen
[ { "from": "system", "value": "Exclude /usr/lib/ruby from RCov C0 code coverage report\n" }, { "from": "human", "value": "gem 'rspec', '>=1.0.0'\nrequire('spec')\nrequire('spec/rake/spectask')\nrequire('spec/rake/verify_rcov')\n#require('rcov_report')\n\ngem 'ZenTest'\nrequire('autotest')\nrequir...
ruby
chosen
[ { "from": "system", "value": "Make name, active, environment and description attributes on payment method mass-assignable by internal calls\n" }, { "from": "human", "value": "module Spree\n class PaymentMethod < ActiveRecord::Base\n\n DISPLAY = [:both, :front_end, :back_end]\n default_sc...
ruby
chosen
[ { "from": "system", "value": "Add rake to development dependencies\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/validate_as_email/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = ['James Conroy-Finn']\n gem.email ...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary trash in stdout." }, { "from": "human", "value": "# Database foreign keys\nrequire 'foreigner'\nrequire 'carrierwave'\nbegin \n require 'sunspot_rails'\n Logger.new(STDOUT).debug 'The sunspot_rails gem is present. Loading it into mailboxer. You ...
ruby
chosen
[ { "from": "system", "value": "Make sure all output is Ruby (will be converted by generator)\n" }, { "from": "human", "value": "require \"json_test_data\"\n\nmodule Rambo\n module RamlModels\n class Body\n attr_reader :body\n\n def initialize(body)\n @body = body\n end\n...
ruby
chosen
[ { "from": "system", "value": "Add static methods to UrbanDictionary" }, { "from": "human", "value": "require 'urban_dictionary/version'\n\nmodule UrbanDictionary\nend" }, { "from": "gpt", "value": "require 'uri'\nrequire 'net/http'\n\nrequire 'urban_dictionary/version'\nrequire 'urba...
ruby
chosen
[ { "from": "system", "value": "Fix hardcoded RegExp when matching git repository\n" }, { "from": "human", "value": "require \"pathname\"\n\nmodule Whatsnew\n class Project\n def initialize(path)\n @path = path\n @name = Dir.glob(File.join(path, \"*\")).find do |file|\n file =...
ruby
chosen
[ { "from": "system", "value": "Make component row html safe\n" }, { "from": "human", "value": "module Noodall::ComponentsHelper\n\n\n def component_row(*args)\n node = args.shift\n raise ActiveRecord::RecordNotFound if node.nil?\n components = args.map { |slot_code| node.send(slot_code) }...
ruby
chosen
[ { "from": "human", "value": "Add translation test for activerecord\n" }, { "from": "gpt", "value": "# coding: utf-8\nrequire 'test_helper'\nrequire 'models/utilisateur'\nclass ActiverecordTest < Test::Unit::TestCase\n\n def test_human_attribute_name\n GettextColumnMapping.locale = 'en'\n ...
ruby
chosen
[ { "from": "system", "value": "Remove steak from acceptance helper\n" }, { "from": "human", "value": "# encoding: utf-8\nrequire_relative './spec_helper'\nrequire \"steak\"\nrequire 'capybara/rails'\nrequire \"capybara/dsl\"\nrequire \"selenium-webdriver\"\nrequire \"capybara/poltergeist\"\n\n# P...
ruby
chosen
[ { "from": "system", "value": "Disable plugin test for Travis, need investigation\n" }, { "from": "human", "value": "require 'serverspec'\n\nif ENV['TRAVIS']\n set :backend, :exec\nend\n\ndescribe 'vagrant Ansible role' do\n\n # Declare variables\n executable = ''\n packages = Array[]...
ruby
chosen
[ { "from": "system", "value": "Make uid a numeric type to pass validation\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Entry do\n\n it { should have_fields(:script) }\n it { should validate_length_of(:script) }\n\n let(:c) do\n User.create(\n name: \"Bill Nye\",...
ruby
chosen
[ { "from": "human", "value": "Add basic tests for money column\n" }, { "from": "gpt", "value": "require File.expand_path(File.dirname(__FILE__) + '/spec_helper')\n\nclass MoneyRecord < ActiveRecord::Base\n money_column :price\nend\n\ndescribe \"MoneyColumn\" do\n\n it \"should typecast string t...
ruby
chosen
[ { "from": "system", "value": "Use `let` instead of `subject` in the tests and make them more descriptive.\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe \"include_url matcher\" do\n include RSpec::Sitemap::Matchers\n\n context \"on a File\" do\n subject { fixture('ba...
ruby
chosen
[ { "from": "system", "value": "Adjust spec to not modify global state\n\nThis way the second context is also truly unconfigured, plus\nno possible test order shenanigans/global influence.\n" }, { "from": "human", "value": "require \"helper\"\n\ndescribe SimpleCov::Configuration do\n describe \"#...
ruby
chosen
[ { "from": "system", "value": "Test that the jsonb storage of arbitrary fields works.\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe Person, type: :model do\n it 'should have a valid factory' do\n expect(create(:person)).to be_valid\n end\n \n it 'requires first name...
ruby
chosen
[ { "from": "system", "value": "Fix Y10K bug in update tests, at @zoeimogen's insistence.\n\nSee https://twitter.com/zoeimogen/status/280699989674577921\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Update do\n before(:each) do\n user = User.create! :username => \"test\"...
ruby
chosen
[ { "from": "system", "value": "[Command::Push] Add temporary foward command 2\n" }, { "from": "human", "value": "module Pod\n class Command\n class Push < Command\n self.summary = 'Temporary placeholder for the `pod repo push` command'\n\n\n def initialize(argv)\n @push_comma...
ruby
chosen
[ { "from": "system", "value": "Implement generate_diff method for FileHunk\n" }, { "from": "human", "value": "require_relative 'hunk_base'\nrequire_relative 'hunk'\n\nmodule GitCrecord\n module Hunks\n class File < HunkBase\n attr_reader :hunks\n\n def initialize(filename_a, filenam...
ruby
chosen
[ { "from": "system", "value": "Stop warnings about redefining constants when reloading plugins." }, { "from": "human", "value": "module Globot\n module Plugin\n class Welcome < Globot::Plugin::Base\n\n SCRIPTS = [\n '%s is in da house!',\n 'Welcome to the room, %s.',\n ...
ruby
chosen
[ { "from": "system", "value": "Make sure latest release is the most recently modified release\n" }, { "from": "human", "value": "Capistrano::Configuration.instance(:must_exist).load do\n after \"deploy:restart\", \"deploy:cleanup\"\nend\n" }, { "from": "gpt", "value": "Capistrano::Co...
ruby
chosen
[ { "from": "system", "value": "Add implicit cast method to Reference\n" }, { "from": "human", "value": "module MongoModel\n class Reference\n attr_reader :id\n \n def initialize(id)\n @id = id\n end\n \n def to_s\n id.to_s\n end\n \n def hash\n id.hash\n...
ruby
chosen
[ { "from": "system", "value": "Add an error when no type defined for YUICompressor filter\n" }, { "from": "human", "value": "module Nutils\n module Filters\n\n # @author Arnau Siches\n #\n # @version 1.2.0\n #\n # @note Requires «yui-compressor»\n class YuiCompressor < Nanoc3::...
ruby
chosen
[ { "from": "system", "value": "Use title instead of item.title\n" }, { "from": "human", "value": "#! /usr/bin/env ruby\n\nrequire \"rss\"\n\nclass Rebuild\n def initialize\n begin\n @rss = RSS::Parser.parse(\"http://feeds.rebuild.fm/rebuildfm\")\n rescue SocketError\n puts \"Can'...
ruby
chosen
[ { "from": "system", "value": "Add ActiveRecord debugging helper for RSpec\n" }, { "from": "human", "value": "ENV['RAILS_ENV'] ||= 'test'\nrequire 'spec_helper'\nrequire File.expand_path('../../config/environment', __FILE__)\nrequire 'rspec/rails'\nrequire 'capybara/rspec'\n\nActiveRecord::Migrat...
ruby
chosen
[ { "from": "system", "value": "Add comment about dependency on \"jruby-openssl\" for `rake release` from JRuby env\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"spec_support/version\"\n\n# Describe your gem and decla...
ruby
chosen
[ { "from": "human", "value": "Add a formula for installation\n" }, { "from": "gpt", "value": "require 'formula'\n\nclass BrewDesc < Formula\n url 'git://github.com/telemachus/brew-desc'\n homepage 'https://github.com/telemachus/brew-desc'\n version '0.0.1'\n\n def install\n bin.install 'bi...
ruby
chosen
[ { "from": "system", "value": "Stop requiring UUIDs in messages to support commands as well as events\n" }, { "from": "human", "value": "module Realm\n module Messaging\n class MessageType\n GENERIC_PROPERTIES = [ :message_type, :version, :timestamp, :uuid ].freeze\n\n def initializ...
ruby
chosen
[ { "from": "human", "value": "Make Relation lazy by default\n" }, { "from": "gpt", "value": "module ROM\n module AutoCurry\n def self.extended(klass)\n busy = false\n curried = klass.curried\n\n klass.define_singleton_method(:method_added) do |name|\n return if busy\n\n ...
ruby
chosen
[ { "from": "system", "value": "Improve error message on undefined value\n" }, { "from": "human", "value": "require 'set'\n\nmodule Smartdown\n class Engine\n class UndefinedValue < StandardError; end\n\n class State\n def initialize(data = {})\n @data = duplicate_and_normalize_...
ruby
chosen
[ { "from": "system", "value": "Add :host option to FileSystem storage for CDNs\n" }, { "from": "human", "value": "require \"uploadie/utils\"\n\nrequire \"fileutils\"\nrequire \"find\"\n\nclass Uploadie\n module Storage\n class FileSystem\n attr_reader :directory, :subdirectory\n\n d...
ruby
chosen
[ { "from": "system", "value": "Revert \"Revert \"Allow proper loading of failed Bencoded data\"\"\n\nThis reverts commit 5262935bf43adf18d10be95c926df5d643f8b5d5.\n" }, { "from": "human", "value": "require 'bencode'\n\nmodule Torckapi\n module Response\n class Base\n protected\n\n d...
ruby
chosen
[ { "from": "system", "value": "Replace the parameter overwrite and extract the slide loading switch\n" }, { "from": "human", "value": "module Wingtips\n class Configuration\n attr_reader :slide_classes\n\n def initialize(path)\n @allow_unnamed_slides = false\n\n path = File.expan...
ruby
chosen
[ { "from": "system", "value": "Include author in JSON crumb response\n" }, { "from": "human", "value": "json.array!(@crumbs) do |crumb|\n json.extract! crumb, :id, :latitude, :longitude, :user_id, :timestamp, :message\n json.url crumb_url(crumb, format: :json)\nend\n" }, { "from": "gpt"...
ruby
chosen
[ { "from": "human", "value": "Add formula for PhpDocumentor 2\n" }, { "from": "gpt", "value": "require 'formula'\nrequire File.expand_path(\"../../Requirements/php-meta-requirement\", Pathname.new(__FILE__).realpath)\nrequire File.expand_path(\"../../Requirements/phar-requirement\", Pathname.new(...
ruby
chosen
[ { "from": "system", "value": "Use correct metadata for test app\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'spec_helper'\n\nRSpec.describe TestApp::Literal, '#string' do\n subject { object.command(double) }\n\n let(:object) { described_class.new }\n\n it { should be(objec...
ruby
chosen
[ { "from": "system", "value": "Remove hack class and explicit scope\n" }, { "from": "human", "value": "require 'monit'\nclass MonitStatus < Monit::Status\nend\n\nmodule Bipbip\n\n class Plugin::Monit < Plugin\n\n def metrics_schema\n [\n {:name => 'Running', :type => 'gauge', :u...
ruby
chosen
[ { "from": "system", "value": "Refactor and removed instance variables\n" }, { "from": "human", "value": "$: << File.dirname(__FILE__)\nrequire 'game_engine'\n\nclass ConsoleGameEngine < GameEngine\n\n attr_reader :ui\n\n def initialize(args)\n @ttt_board = args.fetch(:ttt_board, nil)\n @...
ruby
chosen
[ { "from": "system", "value": "Add gemspec files to allow bundler to run from the gem" }, { "from": "human", "value": "MIXLIB_AUTHN_VERSION = '1.3.0'\n\nGem::Specification.new do |s|\n s.name = \"mixlib-authentication\"\n s.version = MIXLIB_AUTHN_VERSION\n s.platform = Gem::Platform::RUBY\n s...
ruby
chosen
[ { "from": "system", "value": "Tidy up comment referring to hash\n" }, { "from": "human", "value": "module Bouncer\n ##\n # Used to hold all the details about this request and how we might redirect it through mappings.\n # Serves as a context for any rendered template.\n class RequestContext\...
ruby
chosen
[ { "from": "system", "value": "Add entities to Engine autoload_paths\n" }, { "from": "human", "value": "# Fat Free CRM\n# Copyright (C) 2008-2011 by Michael Dvorkin\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public Li...
ruby
chosen
[ { "from": "system", "value": "Use eager_autoload for S3 resource\n\nAs explained in the [awsblog][0], aws-sdk is autoloaded to keep the\nstart time low. That isn't entirely threadsafe and can cause loading\nerrors in multi threaded systems. To fix this, all of 'S3' is now\neagerly autoloaded.\n\nFixes #93\n...
ruby
chosen
[ { "from": "system", "value": "Add dependency on React pod" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"RNDeviceInfo\"\n s.version = \"0.4.1\"\n s.summary = \"Device Information for react-native\"\n\n s.homepage = \"https://github.com/rebeccahughes/...
ruby
chosen
[ { "from": "system", "value": "Add haml generator so we can use scaffolding for base views.\n" }, { "from": "human", "value": "module ImageManagement\n class Engine < Rails::Engine\n isolate_namespace ImageManagement\n config.generators do |g|\n g.test_framework :rspec, :view_specs =>...
ruby
chosen
[ { "from": "system", "value": "Fix flakey test that depended on threads\n\nThis rewrites the test to check the underlying behaviour, which is\nthat we retry a request for a specific kind of error.\n" }, { "from": "human", "value": "require \"rails_helper\"\nrequire Rails.root.join(\"app/models/ro...
ruby
chosen
[ { "from": "system", "value": "Add simple spec for visit status page\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe VisitsController, type: :controller do\n before do skip 'Status not yet implemented' end\n\n describe 'show' do\n let(:visit) { create(:visit) }\n\...
ruby
chosen
[ { "from": "system", "value": "Check for link to poll in specs\n" }, { "from": "human", "value": "require \"rails_helper\"\n\nfeature \"Admin Budgets\" do\n\n background do\n admin = create(:administrator).user\n login_as(admin)\n end\n\n scenario \"Admin ballots link appears if budget h...
ruby
chosen
[ { "from": "system", "value": "Add link to API documentation in gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'code42/version'\n\nGem::Specification.new do |gem|\n ...
ruby
chosen
[ { "from": "system", "value": "Send approval emails to all nonstudents in course\n\nContent Experts want to get these emails to, they are likely to be helpful for any other users participating in a support role as well.\n" }, { "from": "human", "value": "#= Routines for adding or removing a cours...
ruby
chosen
[ { "from": "system", "value": "Make ExpectationError inherit from Exception, rather than StandardError\n" }, { "from": "human", "value": "require 'mocha/backtrace_filter'\n\nmodule Mocha\n\n class ExpectationError < StandardError\n \n def initialize(message = nil, backtrace = [])\n su...
ruby
chosen
[ { "from": "human", "value": "Add a formula for csshX.\n\ncsshX is an SSH multiplexer. It connects to multiple machines via SSH\nand lets you enter the same commands on each one of them.\n\nThere is no build system, just a single Perl script to be installed into\nbin/.\n\nSigned-off-by: Adam Vandenberg <34c2...
ruby
chosen
[ { "from": "system", "value": "Revert \"Move the include of splunklogging into the appconfig check\"\n\nThis reverts commit 25752e9f93a48bdeb292438208bba0e51f6fed0c.\n" }, { "from": "human", "value": "if AppConfig[:enable_splunk_logging]\n require File.expand_path('../../../lib/log_overrider', _...
ruby
chosen