conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Remove deprecation warnings in new RSpecs\n" }, { "from": "human", "value": "# encoding: utf-8\n\n$: << File.join(File.dirname(__FILE__), \"/../../lib\" )\nrequire 'cucumber_priority'\n" }, { "from": "gpt", "value": "# encoding: utf-8\n\n$: << File.join(...
ruby
chosen
[ { "from": "system", "value": "Add a configuration example for enabling MongoDB logging" }, { "from": "human", "value": "require 'rspec'\nrequire 'rr'\nrequire 'vidibus-gem_template'\n\nrequire 'support/stubs'\nrequire 'support/models'\n\nMongoid.configure do |config|\n name = 'vidibus-gem_templ...
ruby
chosen
[ { "from": "system", "value": "Add pry when runnign specs\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path(\"../../lib\", __FILE__)\nrequire \"franklin\"\n" }, { "from": "gpt", "value": "$LOAD_PATH.unshift File.expand_path(\"../../lib\", __FILE__)\nrequire \"fran...
ruby
chosen
[ { "from": "system", "value": "Support basic auth on push endpoint\n" }, { "from": "human", "value": "require_dependency 'cangaroo/application_controller'\n\nmodule Cangaroo\n class EndpointController < ApplicationController\n before_action :ensure_json_request\n before_action :handle_requ...
ruby
chosen
[ { "from": "system", "value": "Use correct ENV Var for CodeClimate\n" }, { "from": "human", "value": "if ENV[\"CODECLIMATE_REPO_TOKEN\"]\n require \"simplecov\"\n SimpleCov.start\nend\n\nDir[File.dirname(__FILE__) + \"/support/**/*.rb\"].each { |f| require f }\n\nRSpec.configure do |config|\n ...
ruby
chosen
[ { "from": "system", "value": "Add support for :focus metadata filtering in rspec\n\nThis is just a convenience to allow isolated tests to be run by adding\n:focus to the example or example group metadata.\n" }, { "from": "human", "value": "require 'neo-tmdb'\nrequire 'vcr'\n\nVCR.configure do |c...
ruby
chosen
[ { "from": "system", "value": "Add RSpec filter configurations to allow running just focused specs.\n" }, { "from": "human", "value": "require 'rdf'\nrequire 'rdf/spec'\nrequire 'rdf/spec/matchers'\n\nRSpec.configure do |config|\n config.include(RDF::Spec::Matchers)\n config.exclusion_filter = ...
ruby
chosen
[ { "from": "system", "value": "Exclude the scraper for SimpleCov if ENV is TRAVIS_CI\n" }, { "from": "human", "value": "require 'coveralls'\nCoveralls.wear!\n\nrequire 'ovchipkaart'\n\n# Add support files\nDir[File.join(File.dirname(__FILE__), \"support/**/*.rb\")].each { |file| require file }\n\...
ruby
chosen
[ { "from": "system", "value": "Fix coverage of some spec files was not measured\n" }, { "from": "human", "value": "# coding: utf-8\n\nRSpec.configure do |config|\n config.expect_with :rspec do |c|\n # Yes, I'm writing specs in should syntax intentionally!\n c.syntax = :should\n end\n\n c...
ruby
chosen
[ { "from": "system", "value": "Update summary, description and homepage in gemspec\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'greeklish/version'\n\nGem::Specification.new do |spe...
ruby
chosen
[ { "from": "system", "value": "Drop and recreate schema before test run\n\nThe performance hit is not so bad for the\nconvenience it provides.\n" }, { "from": "human", "value": "require \"pry\"\nrequire \"support/sequel_test_support\"\n\nRSpec.configure do |config|\n config.expect_with :rspec do...
ruby
chosen
[ { "from": "system", "value": "Remove unused rspec :focus metadata configuration\n\nI actually remember that being kinda dangerous\nfrom app development. If you happen to forget to\nremove a :focus flag, only the focused tests will\nbe run.\n\nDuring library development, I found myself simply\nrunning the sp...
ruby
chosen
[ { "from": "human", "value": "Add a minitest example for comparison. [test]\n" }, { "from": "gpt", "value": "require 'minitest/unit'\nrequire 'minitest/autorun'\n\nclass ShowThemHowToBeatIt < MiniTest::Unit::TestCase\n\n # will fail\n def test_show_them_how_to_funky\n refute_equal(\"funky\"...
ruby
chosen
[ { "from": "system", "value": "Remove extra thread in error handler - already in a threadpool\n" }, { "from": "human", "value": "module ActionSubscriber\n module Middleware\n class ErrorHandler\n include ::ActionSubscriber::Logging\n\n def initialize(app)\n @app = app\n ...
ruby
chosen
[ { "from": "system", "value": "Add Municipality::to_form_array method name_only option\n" }, { "from": "human", "value": "require 'csv'\n\nmodule Arbetsformedlingen\n class MunicipalityCode\n CODE_MAP = CSV.read(\n File.expand_path('../../../../data/municipality-codes.csv', __FILE__)\n ...
ruby
chosen
[ { "from": "system", "value": "Remove the unnecessary fake domain nonsense from the Rails2 generator\n\nFixes #56\n" }, { "from": "human", "value": "module Sauce\n module Generators\n class InstallGenerator < Rails::Generators::Base\n source_root File.expand_path(\"../templates\", __FILE...
ruby
chosen
[ { "from": "system", "value": "Add the new Eastern US region to GCE\n" }, { "from": "human", "value": "module ManageIQ\n module Providers::Google\n module Regions\n # From https://cloud.google.com/compute/docs/zones\n REGIONS = {\n \"us-central1\" => {\n :name ...
ruby
chosen
[ { "from": "system", "value": "Update desc to be relevant & accurate" }, { "from": "human", "value": "namespace :migrate do\n desc \"Populate tag objects with parent ids\"\n task :move_primary_section_into_taggable => :environment do\n Artefact.all.each do |artefact|\n unless artefact.a...
ruby
chosen
[ { "from": "system", "value": " Comment added to task show to view single task comment\n" }, { "from": "human", "value": "class TaskCommentsController < ApplicationController\n def index\n \t@tasks = Task.find(params[:task_id]) \n @comments=@tasks.comments\n end\n def index\n end\n def ...
ruby
chosen
[ { "from": "system", "value": "Add clear method and no-index option for start to ThinkingSphinx::Test.\n" }, { "from": "human", "value": "class ThinkingSphinx::Test\n def self.init(suppress_delta_output = true)\n FileUtils.mkdir_p config.indices_location\n config.settings['quiet_deltas'] =...
ruby
chosen
[ { "from": "system", "value": "Refactor longer varname to pair\n" }, { "from": "human", "value": "require 'spec_helper'\n\nRSpec.describe 'Bitconnect integration specs' do\n client = Cryptoexchange::Client.new\n\n it 'fetch pairs' do\n pairs = client.pairs('bitconnect')\n expect(pairs).no...
ruby
chosen
[ { "from": "system", "value": "Add tvos deployment target in podspec\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"QRSwift\"\n s.version = \"0.3.0\"\n s.summary = \"Swift framework for generating QR codes\"\n\n s.description = <<-DESC\n ...
ruby
chosen
[ { "from": "system", "value": "Exclude this test from CI\n" }, { "from": "human", "value": "require \"spec_helper\"\nrequire \"bunny/concurrent/synchronized_sorted_set\"\n\ndescribe Bunny::Concurrent::SynchronizedSortedSet do\n it \"synchronizes common operations needed by Bunny\" do\n s = de...
ruby
chosen
[ { "from": "system", "value": "Refactor the status prerequisite validator\n" }, { "from": "human", "value": "class StatusPrerequisiteValidator < ActiveModel::EachValidator\n def validate_each(record, attribute, value)\n if value == \"scheduled\"\n return true if record.has_draft? && reco...
ruby
chosen
[ { "from": "system", "value": "Put test in pending - tag is expected to have many pintags\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe Tag, type: :model do\n describe 'tag associations' do\n it { is_expected.to have_many(:pintags)}\n it { is_expected.to valid...
ruby
chosen
[ { "from": "system", "value": "Add evernote_oauth as runtime 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 'envryo/version'\n\nGem::Specification.new do |spec|\n spec.nam...
ruby
chosen
[ { "from": "system", "value": "Fix sample fitness evaluator to use array of hashes\n" }, { "from": "human", "value": "def sample_template\n [{ a: 1..100, b: 2..100 }]\nend\n\ndef sample_fitness_evaluator\n fitness_evaluator = Object.new\n def fitness_evaluator.fitness(params)\n params.each_...
ruby
chosen
[ { "from": "system", "value": "Change to ensure passes on old rubies and windows\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nRSpec.describe TTY::Prompt::Timer do\n it \"times out loop execution\" do\n timer = TTY::Prompt::Timer.new(0.03, 0.01)\n yielded = []\n\n ...
ruby
chosen
[ { "from": "system", "value": "Allow changing of delete link text\n" }, { "from": "human", "value": "module RawnetAdmin\n module ResourceHelper\n def show_link_to(route, text='Show', options={})\n icon_link_to text, route, 'search', options\n end\n\n def edit_link_to(route, text='E...
ruby
chosen
[ { "from": "system", "value": "Support specs running with config.eager_load=true\n\n`ActiveAdmin::Aplication.remove_active_admin_load_paths_from_rails_autoload_and_eager_load`\nis not working on feature tests.\n\nStarting from Rails 7.0, running tests with eager_load enabled produces the following error:\n\n...
ruby
chosen
[ { "from": "system", "value": "Split Podfile spec into several sub-specs.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"SwiftySwift\"\n s.version = \"1.0.1\"\n s.summary = \"SwiftySwift is a collection of useful extensions for Swift types and Cocoa obje...
ruby
chosen
[ { "from": "system", "value": "Add multiLap key to _event_data JSON response\n" }, { "from": "human", "value": "{\n eventId: @event.id,\n eventName: @event.name,\n splits: @event.ordered_splits.map do |split|\n {\n id: split.id,\n ...
ruby
chosen
[ { "from": "system", "value": "Update to pod spec description\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'SwiftKeychainWrapper'\n s.version = '2.0.0' \n s.summary = 'Static wrapper for the iOS Keychain written in Swift.'\n s.description = <<-DESC\n A simple static w...
ruby
chosen
[ { "from": "system", "value": "Complete the answer for 4.3.1 Return A Formatted Address.\n" }, { "from": "human", "value": "# Format an Address\n\n# I worked on this challenge [by myself].\n\n\n# Your Solution Below\n" }, { "from": "gpt", "value": "# Format an Address\n\n# I worked on...
ruby
chosen
[ { "from": "human", "value": "Add a script to list the routes in a region\n\nThis may be useful when we're trying to understand what things are\nrunning on the platform.\n\nPossible future improvements:\n\n- send a `dig` to custom domains to see if DNS is actually setup\n- send an HTTP request to the domain ...
ruby
chosen
[ { "from": "system", "value": "Add Rubocop to help keep the codebase healthy\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\n\nrequire 'safeword'\n\nGem::Specification.new do |spec|\n spec.na...
ruby
chosen
[ { "from": "system", "value": "Use VCR cassete so tests will pass on travis\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass ReposControllerTest < ActionController::TestCase\n include Devise::TestHelpers\n\n fixtures :users, :repos\n\n test 'responds with 404 if repo does not ...
ruby
chosen
[ { "from": "system", "value": "Handle file patterns and names.\n" }, { "from": "human", "value": "require 'specter/version'\n\nrequire 'clap'\n\nclass Specter\n # Your code goes here...\nend\n" }, { "from": "gpt", "value": "require 'specter/version'\n\nrequire 'clap'\n\nclass Specter...
ruby
chosen
[ { "from": "system", "value": "Tweak migration to ensure that migrating from a database with existing\ndiary entries sets a default language for those entries.\n\n\n" }, { "from": "human", "value": "class ChangeDiaryEntriesLanguage < ActiveRecord::Migration\n def self.up\n remove_column \"dia...
ruby
chosen
[ { "from": "system", "value": "Package version increased from 0.1.3 to 0.1.4\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'settings'\n s.version = '0.1.3'\n s.summary = 'Settings data access and assignment'\n s.description = ' '\n\n s...
ruby
chosen
[ { "from": "system", "value": "Fix | Deletion of multiples files records\n" }, { "from": "human", "value": "module Setup\n class Deletion < Setup::Task\n include BulkableTask\n\n build_in_data_type\n\n def run(message)\n if (model = data_type_from(message).records_model)\n s...
ruby
chosen
[ { "from": "system", "value": "Fix the build bu disabling a 1.8.7 specific test\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass I18nOverrideTest < Test::Unit::TestCase\n module OverrideInverse\n\n def translate(*args)\n super(*args).reverse\n end\n alias :t :trans...
ruby
chosen
[ { "from": "human", "value": "Add a test for upstart template rendering." }, { "from": "gpt", "value": "#\n# Copyright 2015, Noah Kantrowitz\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtai...
ruby
chosen
[ { "from": "system", "value": "Fix registration test, add DeepInheritance\n" }, { "from": "human", "value": "#\n# Testcase for proper registration of all classes\n#\nrequire 'rubygems'\nrequire 'sfcc'\nrequire 'test/unit'\nrequire 'provider-testing'\n\nclass Test_Registration < Test::Unit::TestCa...
ruby
chosen
[ { "from": "human", "value": "Add a class to build a URI object\n\nThis uses the standard format for the Replicated Vendor API to build up\na uri object for an endpoint. With this simplified interface, the\nrequest client can be simplified, and the API modules only need to be\nconcerned with building the cor...
ruby
chosen
[ { "from": "system", "value": "Fix SMOKE_ITERATIONS for test suite\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe Stellar::Price, \"#from_f\" do\n subject{ Stellar::Price }\n let(:seed){ 225571644875421139403973254661022579608 } #generated using Random.new\n let(:random...
ruby
chosen
[ { "from": "system", "value": "Add spec to create VM.\n" }, { "from": "human", "value": "require \"helper\"\n\n# TODO - Global vars are so bad. Do this better.\n\ndescribe \"VMRequests\" do\n it \"creates a VM\"\n\n it \"lists available vms\" do\n res = get_compute(:local).local_list_defined...
ruby
chosen
[ { "from": "system", "value": "Add missing dependency for Beaker tests\n" }, { "from": "human", "value": "require 'beaker-rspec/helpers/serverspec'\nrequire 'beaker-rspec/spec_helper'\nrequire 'beaker/puppet_install_helper'\n\nrun_puppet_install_helper\n\nSUPPORTED_PLATFORMS = ['Debian'].freeze\n...
ruby
chosen
[ { "from": "system", "value": "Update link and email address for new github org.\n\nWe've moved the code from collectiveidea to deadmanssnitch so we should\nreflect that in the gemspec.\n" }, { "from": "human", "value": "# encoding: UTF-8\n\n$:.unshift File.expand_path(\"../lib\", __FILE__)\nrequ...
ruby
chosen
[ { "from": "system", "value": "Use built-ins for importer unit tests, avoid loading SequelRails and its dependencies\n" }, { "from": "human", "value": "# encoding: utf-8\nrequire 'pg'\nrequire 'sequel'\nrequire 'json'\nrequire 'yaml'\n\nmodule CartoDB\n module Importer2\n module Factories\n ...
ruby
chosen
[ { "from": "system", "value": "Copy fingerprinted assets only if more recent than non-fingerprinted versions\n" }, { "from": "human", "value": "require 'fileutils'\n\ndesc \"Create nondigest versions of all ckeditor digest assets\"\ntask \"assets:precompile\" do\n fingerprint = /\\-[0-9a-f]{32}\...
ruby
chosen
[ { "from": "human", "value": "Revert \"Remove TalkingData, app can use TalkingData-AppAnalytics instead\"\n\nThis reverts commit d34b2833a444cffb8f9eeee4d59133dcc4066567.\n" }, { "from": "gpt", "value": "Pod::Spec.new do |s|\n s.name = \"APIService-TalkingData\"\n s.version ...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.4.5.1 to 0.4.5.2\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'schema'\n s.summary = \"Primitives for schema and structure\"\n s.version = '0.4.5.1'\n s.description = '...
ruby
chosen
[ { "from": "system", "value": "Hide the deprecated classic namespace from RDoc\n" }, { "from": "human", "value": "# The following classes used to be in the top level namespace.\n# Loading this file enables compatibility with older Rakefile that\n# referenced Task from the top level.\n\nwarn \"WAR...
ruby
chosen
[ { "from": "system", "value": "Use HTTPS in generated URLs.\n" }, { "from": "human", "value": "module RecaptchaMailhide\n module URL\n BASE_URL = \"http://www.google.com/recaptcha/mailhide/d\"\n\n def self.url_for(email)\n public_key = RecaptchaMailhide.configuration.public_key\n ...
ruby
chosen
[ { "from": "system", "value": "Fix 'uninitialized constant Recorder::Rails::Railtie' error\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Recorder\n module Rails\n class Railtie < Rails::Railtie\n initializer 'recorder.configure' do |_app|\n require 're...
ruby
chosen
[ { "from": "human", "value": "feat(task): Add a rake task to poll imdb\n" }, { "from": "gpt", "value": "namespace :data do\n desc 'Poll data from Imdb to import movies in our database'\n task :poll_imdb => :environment do\n Movie.create imdb_id: rand(999_999)\n end\nend\n" } ]
ruby
chosen
[ { "from": "system", "value": "Send related items in order to publishing-api\n\nThe ordering is important because the user has specified it in the UI.\n" }, { "from": "human", "value": "namespace :publishing_api do\n desc \"Send all related items to the publishing-api again\"\n task republish_r...
ruby
chosen
[ { "from": "system", "value": "Add a hello world call implementation\n" }, { "from": "human", "value": "module TicTacToe\n\n class RackShell\n\n def self.new_shell\n return RackShell.new\n end\n\n end\n\nend\n" }, { "from": "gpt", "value": "module TicTacToe\n\n class Rac...
ruby
chosen
[ { "from": "system", "value": "Reduce the number of comparisons during iteration\n" }, { "from": "human", "value": "require \"delegate\"\n\nmodule Timerage\n # A range of time. The exposes the Range like interface.\n class TimeInterval < DelegateClass(Range)\n def initialize(*args)\n rn...
ruby
chosen
[ { "from": "system", "value": "Revert \"Allow proper loading of failed Bencoded data\"\n\nThis reverts commit b000225b6a3068eb858ed8290fe3594ed849e383.\n" }, { "from": "human", "value": "require 'bencode'\n\nmodule Torckapi\n module Response\n class Base\n protected\n\n def self.bde...
ruby
chosen
[ { "from": "system", "value": "Remove override constructor to initialize model\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n# Copyright 2014 TIS Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the L...
ruby
chosen
[ { "from": "system", "value": "Bump new version and add requires_arc to podspec\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"CMNavBarNotificationView\"\n s.version = \"1.0.3\"\n s.summary = \"An in-app notification view above the navigation bar totally...
ruby
chosen
[ { "from": "system", "value": "Allow to run with activemodel 4.2.x\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": "Fix wrong test class name\n" }, { "from": "human", "value": "require 'helper'\n\nclass TestStoreConstruction < Test::Pwl::TestCase\n # when comparing timestamps, allow not more than this difference in seconds\n TIMESTAMP_PRECISION = 1\n\n def test_created\n as...
ruby
chosen
[ { "from": "system", "value": "Add favicon icon to Atom feed output.\n\nSigned-off-by: Brian L. Troutwine <760e7dab2836853c63805033e514668301fa9c47@troutwine.us>\n" }, { "from": "human", "value": "xml.instruct!\nxml.feed \"xmlns\" => \"http://www.w3.org/2005/Atom\" do\n xml.title \"Brian L. Trou...
ruby
chosen
[ { "from": "system", "value": "Connect to mongo on heroku too\n" }, { "from": "human", "value": "require \"sinatra/json\"\n\nconfigure do\n session = Moped::Session.new([ '127.0.0.1:27017' ])\n session.use \"cloud_counter_#{ENV['RACK_ENV']}\"\nend\n\npost '/counters' do\n json ({id: 'x', name:...
ruby
chosen
[ { "from": "human", "value": "Add controller spec (not full)\n" }, { "from": "gpt", "value": "require File.join(File.dirname(__FILE__), 'spec_helper.rb')\n\nclass Test < Merb::Controller\n def index\n \"index\"\n end\nend\n\ndescribe Merb::Controller do\n it \"should set the language on req...
ruby
chosen
[ { "from": "system", "value": "Add a test that plays through a tie game\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'io/console'\n\ndescribe \"Playing a full game\" do\n let(:console) { mock_console }\n let(:board) { TicTacToe::Board.new }\n let(:game) { TicTacToe::G...
ruby
chosen
[ { "from": "human", "value": "Add legacy version of mpfr.\n\n* Add mpfr 2.4.2 from GCC infrastructure.\n" }, { "from": "gpt", "value": "require 'formula'\n\nclass Mpfr2 < Formula\n homepage 'http://www.mpfr.org/'\n # Tracking legacy version on gcc ftp\n url 'ftp://gcc.gnu.org/pub/gcc/infrastru...
ruby
chosen
[ { "from": "system", "value": "Reduce sql calls on list of policies\n" }, { "from": "human", "value": "class PoliciesController < ApplicationController\n # TODO: Reenable CSRF protection\n skip_before_action :verify_authenticity_token\n\n before_action :authenticate_user!, except: [:index, :sh...
ruby
chosen
[ { "from": "system", "value": "Raise error when subject not found\n" }, { "from": "human", "value": "class SubjectsController < ApplicationController\n before_filter :force_http\n\n inherit_resources\n belongs_to :jurisdiction, parent_class: Metadatum, finder: :find_by_abbreviation, param: :ju...
ruby
chosen
[ { "from": "system", "value": "Check if already bson object id first. Assumes that is most common.\n" }, { "from": "human", "value": "# encoding: UTF-8\nrequire 'set'\nrequire 'mongo'\nrequire 'plucky/extensions'\n\nmodule Plucky\n autoload :CriteriaHash, 'plucky/criteria_hash'\n autoload :Opti...
ruby
chosen
[ { "from": "system", "value": "Print out AWS S3 confirmation of server_side_encrpytion status\n\n+ ... also don't save an object to the DB unless we hear back from AWS that it saved successfully\n" }, { "from": "human", "value": "class IepStorer\n def initialize(file_name:,\n pat...
ruby
chosen
[ { "from": "system", "value": "Add require_path, load version from JSRebuild::VERSION constant and add gem platform to gemspec.\n" }, { "from": "human", "value": "Gem::Specification.new do |gem|\n gem.name = \"jsrebuild\"\n gem.version = \"0.1.0\"\n \n gem.author = \"Benedict ...
ruby
chosen
[ { "from": "system", "value": "Add missing require for StringIO\n" }, { "from": "human", "value": "require 'socket'\n\nclass Server\n def initialize(port, sleep = 1)\n @port = port\n @sleep = sleep\n @server = nil\n end\n\n def start(block = self.method(:ping))\n @server = TCPSe...
ruby
chosen
[ { "from": "system", "value": "Add some moderation controller tests\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe ModerationController, type: :controller do\nend\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\nRSpec.describe ModerationControlle...
ruby
chosen
[ { "from": "system", "value": "Use spaces instead of tabs.\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\nrequire(File.join(File.expand_path(File.dirname(__FILE__)), *%w{ .. lib shared }))\n\n`git rev-parse --verify HEAD`\nagainst = if $? == 0\n\t'HEAD'\nelse\n\t'4b825dc642cb6eb9a060e5...
ruby
chosen
[ { "from": "system", "value": "Include default route for formats\n\ngit-svn-id: afc9fed30c1a09d8801d1e4fbe6e01c29c67d11f@6576 5ecf4fe2-1ee6-0310-87b1-e25e094e27de\n" }, { "from": "human", "value": "ActionController::Routing::Routes.draw do |map|\n # The priority is based upon order of creation: ...
ruby
chosen
[ { "from": "system", "value": "Fix '=' instead of '==' typo on conditional" }, { "from": "human", "value": "module CSI\n class Record\n attr_accessor :type\n attr_accessor :code\n attr_accessor :name\n attr_accessor :correlations\n\n # Instantiate a CSI record based on a type ('NA...
ruby
chosen
[ { "from": "system", "value": "Fix locking issue on disconnect\n" }, { "from": "human", "value": "require_relative 'sessions/session_pool'\n\nmodule Mongoid\n module Sessions\n class << self\n def synchronize(&block)\n @lock ||= Mutex.new\n @lock.synchronize(&block)\n ...
ruby
chosen
[ { "from": "human", "value": "Add a syntax test to help support multiple Rubies\n\nThis is no real gain on Travis, which runs the full test suite\nagainst two Rubies. It does catch a few classes of error when\nrunning the test suite locally.\n" }, { "from": "gpt", "value": "require 'test_helper'\...
ruby
chosen
[ { "from": "system", "value": "Make news readable for public\n" }, { "from": "human", "value": "class NewsController < ApplicationController\n before_action :set_news, only: [:show, :edit, :update, :destroy]\n skip_before_action :authenticate_user!, only: :index\n\n respond_to :html\n\n def i...
ruby
chosen
[ { "from": "system", "value": "Handle case of nil tenant id on group, user, and ems.\n\nIf the group, user, ems is nil (handled already) or if their tenant id\nis nil(fixed in this commit), we need to fall through to the next option.\n\nOwning group -> current user -> parent ems -> root tenant\n\nFixes some ...
ruby
chosen
[ { "from": "system", "value": "Fix issue with not found constant\n" }, { "from": "human", "value": "class Reports::AdminReport\n attr_reader :id, :year, :params\n\n def initialize(id, year, params = {})\n @id = id\n @year = year\n @params = params\n end\n\n def as_csv\n case id\n ...
ruby
chosen
[ { "from": "system", "value": "Fix role reference in checkout\n" }, { "from": "human", "value": "module Spree\n User.class_eval do\n scope :dibs_referrers, lambda { includes(:roles).where(\"#{::Spree::Role.table_name}.name\" => \"dibs_referral\") }\n has_many :dibs_referrals, class_name: '...
ruby
chosen
[ { "from": "system", "value": "Whitelist instead of blacklist user attributes" }, { "from": "human", "value": "class UserSerializer\n include TalkSerializer\n include ModerationActions\n \n all_attributes except: :email\nend\n" }, { "from": "gpt", "value": "class UserSerializer\n ...
ruby
chosen
[ { "from": "system", "value": "Reorder assertions to report error/output on a non-zero exit status.\n" }, { "from": "human", "value": "require 'simplecov'\n\nSimpleCov.start do\n add_filter 'test'\n project_name 'Bzip2::FFI'\nend\n\nrequire 'bzip2/ffi'\nrequire 'fileutils'\nrequire 'minitest/au...
ruby
chosen
[ { "from": "system", "value": "Fix a deprecation warning in mocha.\n" }, { "from": "human", "value": "ENV['RACK_ENV'] = 'test'\n\n$LOAD_PATH << File.expand_path('../../', __FILE__)\n$LOAD_PATH << File.expand_path('../../lib', __FILE__)\n\nrequire \"bundler/setup\"\nrequire \"minitest/autorun\"\nr...
ruby
chosen
[ { "from": "system", "value": "Add reset of Seedbank variables and FakeModel constant.\n\nSigned-off-by: James McCarthy <474ba67bdb289c6263b36dfd8a7bed6c85b04943@thisishatch.co.uk>\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'minitest/autorun'\n\n# Configure Rails Environment\n...
ruby
chosen
[ { "from": "system", "value": "Reduce coverage for recent pull requests\n" }, { "from": "human", "value": "require 'pathname'\n\nrequire 'boot'\nrequire 'mocha/setup'\n\nunless ENV['COVERAGE'] == 'off'\n COVERAGE_THRESHOLD = 38\n require 'simplecov'\n require 'simplecov-rcov'\n require 'cover...
ruby
chosen
[ { "from": "human", "value": "Add classes to manage MNIST datasets.\n" }, { "from": "gpt", "value": "module MNISTData\n class DataUnpackingError < RuntimeError\n end\n\n class Labels\n def initialize(filename)\n datafile = File.binread(filename)\n @data = datafile.unpack('NNC*')\n...
ruby
chosen
[ { "from": "system", "value": "Work on new versions also" }, { "from": "human", "value": "# encoding: utf-8\ndef self.add_to_path path\n path = File.expand_path \"../#{path}/\", __FILE__\n\n $:.unshift path unless $:.include? path\nend\n\nadd_to_path 'lib'\n\nrequire 'test_runner/version'\n\nGem:...
ruby
chosen
[ { "from": "system", "value": "Use self.table_name as set_table_name is deprecated\n" }, { "from": "human", "value": "class Mixin < ActiveRecord::Base\nend\n\nclass ListMixin < ActiveRecord::Base\n set_table_name \"mixins\"\n default_scope order(:pos)\n acts_as_list :column => \"pos\", :scope ...
ruby
chosen
[ { "from": "system", "value": "Fix typo in variable name\n" }, { "from": "human", "value": "module Opal\n def self.gem_dir\n File.expand_path('../..', __FILE__.untaint)\n end\n\n def self.core_dir\n File.expand_path('../../../opal', __FILE__.untaint)\n end\n\n def self.std_dir\n Fil...
ruby
chosen
[ { "from": "system", "value": "Update SWXMLHash to 4.1 in podspec\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'SourceKittenFramework'\n s.version = `make get_version`\n s.summary = 'An adorable little framework for interacting with ...
ruby
chosen
[ { "from": "system", "value": "Fix authenticate_by_token before filter inclusion.\n" }, { "from": "human", "value": "module TokenAuthentication\n\n class Unauthorized < StandardError; end\n\n module ActsAsTokenAuthenticatable\n extend ActiveSupport::Concern\n\n included do\n private ...
ruby
chosen
[ { "from": "system", "value": "Add new property ECS Service resource type\n" }, { "from": "human", "value": "#\n# ECS Service resource\n# http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html\n#\nrequire 'kumogata/template/helper'\nrequire 'kumogata/template/...
ruby
chosen
[ { "from": "system", "value": "Remove success message when contribution is successfully\n" }, { "from": "human", "value": "module Neighborly::Balanced::Bankaccount\n class PaymentsController < AccountsController\n def create\n attach_bank_to_customer\n update_customer\n\n @cont...
ruby
chosen
[ { "from": "system", "value": "Remove pointless private getter when the setter is public\n" }, { "from": "human", "value": "require \"writer/configuration\"\nrequire \"writer/version\"\nrequire \"writer/file_creator\"\n\nmodule Writer\n class << self\n def write!(name = nil, content = nil)\n ...
ruby
chosen