conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Add tests for redirections on person show\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nrequire \"test_helper\"\n\nclass GobiertoPeople::PeopleeControllerTest < GobiertoControllerTest\n\n def setup\n %w(agendas gifts invitations trips).each do...
ruby
chosen
[ { "from": "human", "value": "Revert \"Remove a needless file\"\n\nThis reverts commit 1c1e8f3caf32bd75fdb6ee9a84d0a7e580f0467b.\n\nBecause I still need you.\n" }, { "from": "gpt", "value": "mtimes = {}\n\nloop do\n Dir.glob(\"*.{rb,csv}\") do |path|\n mtime = File.mtime(path)\n if mtimes[...
ruby
chosen
[ { "from": "system", "value": "Remove duplicate recipe from run_list.\n" }, { "from": "human", "value": "name 'rails'\ndescription 'This role configures a Rails stack using Unicorn'\nrun_list \"recipe[apt]\", \"recipe[build-essential]\", \"recipe[percona_mysql]\", \"recipe[packages]\", \"recipe[r...
ruby
chosen
[ { "from": "system", "value": "Use the right conventions for the not_found endpoint.\n" }, { "from": "human", "value": "# encoding: utf-8\n\nclass Api::V2::RootController < Api::V2Controller\n\n def index\n resp = {\n api: {\n version: 2,\n description: \"Welcome to the ...
ruby
chosen
[ { "from": "system", "value": "Add rescue action for CanCan::AccessDenied\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n\n before_filter do\n resource = controller_path.singularize.gsub('/', '_').to_sym \n method = \"#{resource}_params\"\n para...
ruby
chosen
[ { "from": "system", "value": "Change redirect on sign in to lists_path\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n protect_from_forgery\nend\n" }, { "from": "gpt", "value": "class ApplicationController < ActionController::Base\n protect...
ruby
chosen
[ { "from": "human", "value": "[Refactor] Move common/shared methods to a superclass\n" }, { "from": "gpt", "value": "class TagKlass\n def content\n @content.strip unless @content.nil?\n end\n\n def klass\n MarkdownUI::KlassUtil.new(@klass).klass unless @klass.nil?\n end\n\n def _id\n ...
ruby
chosen
[ { "from": "system", "value": "Use Ruby 1.8-compatible hash syntax" }, { "from": "human", "value": "require \"fog\"\nrequire \"open-uri\"\n\nclass PgbackupsArchive::Storage\n\n def initialize(key, file)\n @key = key\n @file = file\n end\n\n def connection\n Fog::Storage.new({\n p...
ruby
chosen
[ { "from": "system", "value": "Allow GreenhouseGas lookup using GreenhouseGas[abbreviation]\n" }, { "from": "human", "value": "class GreenhouseGas < ActiveRecord::Base\n set_primary_key :name\n \n data_miner do\n tap \"Brighter Planet's greenhouse gas data\", Earth.taps_server\n end\nend\n...
ruby
chosen
[ { "from": "system", "value": "Use modern minitest from rubygems\n\nThe minitest shipped with ruby does not have all assertions.\n" }, { "from": "human", "value": "# encoding: utf-8\n\nGem::Specification.new do |spec|\n spec.name = 'parser'\n spec.version = '0.9.alpha1'\n spec.a...
ruby
chosen
[ { "from": "system", "value": "Update comment for new name." }, { "from": "human", "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 obtain a copy of...
ruby
chosen
[ { "from": "system", "value": "Revert \"Adds length hotfix to Section\"\n\nThis reverts commit ccb3fdf9ff39b00ae24439d733046d7e08bf1d87.\n" }, { "from": "human", "value": "class Section < Sequel::Model(:sections)\n include StartYear\n\n many_to_one :line\n\n plugin :geometry\n\n FUTURE = 9999...
ruby
chosen
[ { "from": "system", "value": "Use ActiveSupport::TestCase for resque/web test helper\n" }, { "from": "human", "value": "require 'rack/test'\nrequire 'resque/server'\n\nmodule Resque\n module TestHelper\n class Test::Unit::TestCase\n include Rack::Test::Methods\n def app\n Re...
ruby
chosen
[ { "from": "system", "value": "Add model tests for question.\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass QuestionTest < ActiveSupport::TestCase\n # test \"the truth\" do\n # assert true\n # end\nend\n" }, { "from": "gpt", "value": "require 'test_helper'\n\n#...
ruby
chosen
[ { "from": "human", "value": "Improve test coverage for ifd.rb\n" }, { "from": "gpt", "value": "require 'file_data/formats/exif/ifd'\nrequire 'file_data/formats/exif/exif_stream'\nrequire 'support/test_stream'\n\nRSpec.describe FileData::Ifd do\n let(:exif) { FileData::Ifd.new(FileData::ExifStre...
ruby
chosen
[ { "from": "system", "value": "Make bad dependencies more obvious\n\nUse null objects since we're not expecting them to be used for anything.\n\nWe need the IpProviderFactory and GlobalNetworkResolver when parsing so\nwe can give subnets an IpProvider. This is kind of crazy, especially in\napi/cloud_config_m...
ruby
chosen
[ { "from": "system", "value": "Add some tests for recursive add_once\n" }, { "from": "human", "value": "require 'test/unit'\nrequire 'event_core'\n\nclass TestOnce < Test::Unit::TestCase\n\n def setup\n @loop = EventCore::MainLoop.new\n end\n\n def teardown\n @loop = nil\n end\n\n def ...
ruby
chosen
[ { "from": "system", "value": "Include http options to net/http to allow ssl to work\n\nCirconus http trap link to the IP address of the enterprise\nbroker, so cert validation is not going to work" }, { "from": "human", "value": "require 'net/http'\n\nmodule Reporter\n module Writers\n class ...
ruby
chosen
[ { "from": "system", "value": "Remove trailing slashes before looking up pages\n" }, { "from": "human", "value": "module Spontaneous::Rack::Back\n class Map < Base\n get '/?:id?' do\n last_modified(site.modified_at)\n map = site.map(params[:id])\n if map\n json(map)\n ...
ruby
chosen
[ { "from": "system", "value": "Rewrite build script to use rakudobrew\n\nrakudobrew is like perlbrew for Perl6 and is able to build individual\nPerl6 versions which the previous code was not able to do. This makes the\nscript now more flexible, and can accept\n\n perl6:\n - 2015.04\n - latest\...
ruby
chosen
[ { "from": "system", "value": "Change default supporters to 4\n" }, { "from": "human", "value": "# General application constants\n\n# how many locations to display initially\nMAX_LOCATION_RESULTS = 10\n\n# how many supporters to display initially\nSUPPORTER_MAX = 1" }, { "from": "gpt", ...
ruby
chosen
[ { "from": "system", "value": "Remove the Dragonfly url_format configuration\n\nIt is not used anyway and relies on the Alchemy mount point, which is not availble while initializing the app. That makes it impossible to install alchemy in the app.\n" }, { "from": "human", "value": "# Alchemy CMS D...
ruby
chosen
[ { "from": "system", "value": "Upgrade RSpec to 3.4.x series for Travis builds\n" }, { "from": "human", "value": "$LOAD_PATH << File.expand_path('../lib', __FILE__)\nrequire 'scss_lint/constants'\nrequire 'scss_lint/version'\n\nGem::Specification.new do |s|\n s.name = 'scss_lint'\n ...
ruby
chosen
[ { "from": "human", "value": "Add some basic specs for extension\n" }, { "from": "gpt", "value": "require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')\n\nXSD_FILE = File.expand_path(File.dirname(__FILE__) + '/../../fixtures/wildfire-1.3.xsd')\n\ndescribe \"Buildr::JaxbXjc\" do\...
ruby
chosen
[ { "from": "system", "value": "Add Control Over Order Direction In URL For API\n" }, { "from": "human", "value": "class ApiController < ApplicationController\n\tbefore_action :change_query_order, only: :index\n\n\t@@order = :id\n\n\tdef change_query_order\n\t\tunless params[:order] == nil\n\t\t\t...
ruby
chosen
[ { "from": "system", "value": "Remove old update method from RdbController.\n\n* Method was moved to Rdb::BoardsController (API)." }, { "from": "human", "value": "class RdbController < ::ApplicationController\n unloadable\n before_filter :board, only: [:show, :update, :destroy]\n respond_to :h...
ruby
chosen
[ { "from": "system", "value": "Add helper to set class on active navigation items\n" }, { "from": "human", "value": "module ApplicationHelper\nend\n" }, { "from": "gpt", "value": "module ApplicationHelper\n\n # Set class on active navigation items\n def nav_link(text, link)\n r...
ruby
chosen
[ { "from": "system", "value": "Change flash messages to bootstrap class\n" }, { "from": "human", "value": "# The parent helper for all helpers\nmodule ApplicationHelper\nend\n" }, { "from": "gpt", "value": "# The parent helper for all helpers\nmodule ApplicationHelper\n def bootstrap...
ruby
chosen
[ { "from": "system", "value": "Change double quotes to single quotes\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire File.expand_path('../lib/ice_nine/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.name = 'ice_nine'\n gem.version = IceNine::VERSION\n ge...
ruby
chosen
[ { "from": "system", "value": "Make markdown a bit safer\n" }, { "from": "human", "value": "module ApplicationHelper\n class MarkdownHTML < Redcarpet::Render::HTML\n def header(text, level)\n slug = text.parameterize\n \"<h#{level} id=\\\"#{slug}\\\">#{text}</h#{level}>\"\n end\n...
ruby
chosen
[ { "from": "system", "value": "Fix bug where open graph and Twitter cards expect an image URL\n\nnot a path (even though they figure it out ;)\n" }, { "from": "human", "value": "module SocialMetaHelper\n def open_graph_tag(name, content, interpolation = {})\n if Symbol === content\n tag(...
ruby
chosen
[ { "from": "system", "value": "Replace usage of `answer` in `before_destroy` of Reaction with `parent`\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass Appendable::Reaction < Appendable\n after_create do\n Notification.notify parent.user, self unless parent.user == us...
ruby
chosen
[ { "from": "system", "value": "Make DTO properly loadable and saveable\n\nMake DTO properly loadable and saveable. Obtaining attributes\nis getting rid of blacklisted attrs.\n" }, { "from": "human", "value": "module ManagerRefresh\n class Dto\n attr_reader :dto_collection, :data\n\n delega...
ruby
chosen
[ { "from": "system", "value": "Add delegate local_name to entity_wrapper\n" }, { "from": "human", "value": "require 'forwardable'\n\nmodule VhdlConnector::Presenters\n class EntityPresenter\n extend Forwardable\n def_instance_delegators :@entity,\n :name, :generics, :ports\n def in...
ruby
chosen
[ { "from": "human", "value": "Fix getting back to heroku\n" }, { "from": "gpt", "value": "# Run with: rackup private_pub.ru -s thin -E production\nrequire \"bundler/setup\"\nrequire \"yaml\"\nrequire \"faye\"\nrequire \"private_pub\"\n\nFaye::WebSocket.load_adapter('thin')\n\nPrivatePub.load_conf...
ruby
chosen
[ { "from": "system", "value": "Fix reference in Tracker spec\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Tracker do\n\n context \"validations\" do\n it { should have_valid_factory(:tracker) }\n end\n\nend\n" }, { "from": "gpt", "value": "require 'spec_hel...
ruby
chosen
[ { "from": "system", "value": "Add .pre for next release\n" }, { "from": "human", "value": "module EY\n VERSION = '2.0.9'\n ENGINEYARD_SERVERSIDE_VERSION = ENV['ENGINEYARD_SERVERSIDE_VERSION'] || '2.0.3'\nend\n" }, { "from": "gpt", "value": "module EY\n VERSION = '2.0.10.pre'\n EN...
ruby
chosen
[ { "from": "system", "value": "Mark owner as optional (Rails 5.2)\n" }, { "from": "human", "value": "module DeviseGuest\n module UserConcern\n extend ActiveSupport::Concern\n\n included do\n belongs_to :owner_user, class_name: \"User\"\n has_many :guest_users, class_name: \"User\...
ruby
chosen
[ { "from": "system", "value": "Allow hyphens in database names.\n" }, { "from": "human", "value": "Puppet::Type.newtype(:mongodb_database) do\n @doc = \"Manage MongoDB databases.\"\n\n ensurable\n\n newparam(:name, :namevar=>true) do\n desc \"The name of the database.\"\n newvalues(/^\\w...
ruby
chosen
[ { "from": "system", "value": "Halt early if no log is found\n" }, { "from": "human", "value": "require 'travis/api/app'\n\nclass Travis::Api::App\n class Endpoint\n # Logs are generated by builds.\n class Logs < Endpoint\n # Fetches a log by its *id*.\n get '/:id' do |id|\n ...
ruby
chosen
[ { "from": "system", "value": "Enable all tests that pass\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\nAR_COMMAND = 'ar'\nARCHIVE_AR_COMMAND = 'bundle exec ../bin/archive-ar'\n\ndef run_test(cmd)\n puts \"Testing `ar #{cmd}`\"\n out_ar = `#{AR_COMMAND} #{cmd} 2>&1`\n out_archive_ar ...
ruby
chosen
[ { "from": "system", "value": "Set timeout for newer ruby versions\n" }, { "from": "human", "value": "class NameResolver < Scout::Plugin\n needs 'resolv'\n OPTIONS=<<-EOS\n nameserver:\n default: 8.8.8.8\n resolve_address:\n default: google.com\n EOS\n\n def build_report\n ...
ruby
chosen
[ { "from": "system", "value": "Fix buggy auto-correct for Rails/SaveBang\n\nThe return value of these methods is checked for validation errors,\nso we should not throw an exception here.\n" }, { "from": "human", "value": "module Devise\n module Models\n module Suspendable\n extend Active...
ruby
chosen
[ { "from": "system", "value": "Remove map_link_url (was for wrong provider).\n" }, { "from": "human", "value": "require 'geocoder/lookups/base'\nrequire \"geocoder/results/mapquest\"\n\nmodule Geocoder::Lookup\n class Mapquest < Base\n\n def map_link_url(coordinates)\n \"http://www.opens...
ruby
chosen
[ { "from": "system", "value": "Update categories to include private, contributing, composite schools\n" }, { "from": "human", "value": "# The PublicBodyCategories structure works like this:\n# [\n# \"Main category name\",\n# [ \"tag_to_use_as_category\", \"Sub category title\", \"sentence...
ruby
chosen
[ { "from": "system", "value": "Fix for ActiveRecord connections timeout\n" }, { "from": "human", "value": "module Workerholic\n class JobProcessor\n attr_reader :serialized_job\n\n def initialize(serialized_job)\n @serialized_job = serialized_job\n @logger = LogManager.new\n e...
ruby
chosen
[ { "from": "system", "value": "Remove require for deleted file\n" }, { "from": "human", "value": "require \"active_enumerable/version\"\nrequire \"active_enumerable/base\"\nrequire \"active_enumerable/record_not_found\"\nrequire \"active_enumerable/comparable\"\nrequire \"active_enumerable/enumer...
ruby
chosen
[ { "from": "system", "value": "Make autotest code a bit clearer\n" }, { "from": "human", "value": "Autotest.add_discovery do\n if File.directory?('features')\n if ENV['AUTOFEATURE'] =~ /true/i\n \"cucumber\"\n elsif ENV['AUTOFEATURE'] =~ /false/i\n else\n puts \"(Not running f...
ruby
chosen
[ { "from": "system", "value": "Allow Proc for default_asset_url option\n" }, { "from": "human", "value": "require \"paperclip-defaults/version\"\nrequire \"bundler/setup\"\n\nBundler.require(:default)\n\nrequire 'paperclip'\n\nmodule Paperclip\n module Defaults\n end\n\n module ClassMethods\n ...
ruby
chosen
[ { "from": "system", "value": "Allow selection back and forth. No range checking yet.\n" }, { "from": "human", "value": "module PPCurses\n\n class Form\n\n attr_accessor :elements\n attr_accessor :selected_element\n\n def initialize (screen)\n @win = screen\n @elements = []\n...
ruby
chosen
[ { "from": "system", "value": "Add default API_KEY, SHARED_SECRET for travis ci.\n" }, { "from": "human", "value": "require 'simplecov'\nrequire 'coveralls'\n\n\nSimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[\n SimpleCov::Formatter::HTMLFormatter,\n Coveralls::SimpleCov::Formatter\...
ruby
chosen
[ { "from": "system", "value": "Use ActiveRecord's includes finder to avoid N+1 problem\n" }, { "from": "human", "value": "class DashboardsController < ApplicationController\n before_action :authenticate_user!\n\n def show\n @posts = Post.all\n end\nend\n" }, { "from": "gpt", "va...
ruby
chosen
[ { "from": "system", "value": "Change to JSON responses from /jobs\n" }, { "from": "human", "value": "require_dependency \"fieri/application_controller\"\n\nmodule Fieri\n class JobsController < ApplicationController\n def create\n CookbookWorker.perform_async(job_params)\n render t...
ruby
chosen
[ { "from": "system", "value": "Remove binding.pry and resolve merge conflict\n" }, { "from": "human", "value": "module Yourls\n module Requestable\n require 'rest_client'\n\n def already_shortened?\n binding.pry\n regex = Regexp.new(domain)\n @url =~ regex\n end\n\n de...
ruby
chosen
[ { "from": "system", "value": "Remove some extraneously chained calls in the stubbing for the notification subscription tests\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe NotificationSubscription do\n let(:property) { FactoryGirl.create(:property) }\n context \"given a n...
ruby
chosen
[ { "from": "system", "value": "Add spec for restarting failed enumerator\n\nSee jruby/jruby#6157 for a CSV test that failed due to this\nmissing behavior in JRuby, specifically the comments here:\n\nhttps://github.com/jruby/jruby/issues/6157#issuecomment-619200136\n" }, { "from": "human", "value"...
ruby
chosen
[ { "from": "system", "value": "Add tests for save and files dependent on it\n" }, { "from": "human", "value": "require 'coveralls'\nCoveralls.wear!\nrequire 'spec_helper'\n# Test for Save class\nmodule Hangman\n game = Game.new\n save = Save.new(game)\n\n context '#initialize' do\n it 'is a...
ruby
chosen
[ { "from": "system", "value": "Install zsh completion by default\n" }, { "from": "human", "value": "require 'formula'\n\nHOMEBREW_GHQ_VERSION='0.4'\nclass Ghq < Formula\n homepage 'https://github.com/motemen/ghq'\n url \"https://github.com/motemen/ghq/releases/download/v#{HOMEBREW_GHQ_VERSION}/...
ruby
chosen
[ { "from": "system", "value": "Refactor pruned_args into its own method\n" }, { "from": "human", "value": "module Munge\n module Core\n class Source\n include Enumerable\n\n def initialize(item_factory:,\n items:)\n @item_factory = item_factory\n\n ...
ruby
chosen
[ { "from": "system", "value": "Add default for braintree gateway\n" }, { "from": "human", "value": "module Pay\n module Braintree\n module Api\n def self.set_api_keys\n environment = get_key_for(:environment)\n merchant_id = get_key_for(:merchant_id)\n public_key = ...
ruby
chosen
[ { "from": "system", "value": "Enhance validation formatter to indicate relationships\n" }, { "from": "human", "value": "# frozen_string_literal: true\nrequire 'forwardable'\nrequire 'sequel'\n\nrequire_relative 'pagination'\n\nmodule Sinja\n module Sequel\n module Core\n extend Forwarda...
ruby
chosen
[ { "from": "system", "value": "Mark petitions as debated every midnight\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\n# Example...
ruby
chosen
[ { "from": "system", "value": "Use slop v3 becouse v4 does not have compatibility with pry\n" }, { "from": "human", "value": "lib = File.expand_path(\"../lib\", __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire \"ruboty/version\"\n\nGem::Specification.new do |spec|\n sp...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.7.0.0 to 0.7.0.1\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'evt-schema'\n s.summary = \"Primitives for schema and structure\"\n s.version = '0.7.0.0'\n s.description...
ruby
chosen
[ { "from": "system", "value": "Add explanatory comment to Crepe::Versioning::Endpoint\n\nSigned-off-by: David Celis <b1c1d8736f20db3fb6c1c66bb1455ed43909f0d8@davidcel.is>\n" }, { "from": "human", "value": "require 'crepe/versioning/request'\n\nmodule Crepe\n module Versioning\n module Endpoin...
ruby
chosen
[ { "from": "human", "value": "Add integration test for urgent_cases with add/remove link test\n" }, { "from": "gpt", "value": "require 'test_helper'\n\nclass UrgentCasesTest < ActionDispatch::IntegrationTest\n before do\n Capybara.current_driver = :poltergeist\n @patient = create :patient,...
ruby
chosen
[ { "from": "system", "value": "Fix strange path brokenness in test suite on JRuby 9000\n" }, { "from": "human", "value": "require 'simplecov'\nrequire 'stringio'\nrequire 'tilt/erb'\n\nSimpleCov.start do\n add_filter 'spec'\nend\n\nif ENV['CI'] == 'true'\n require 'codecov'\n SimpleCov.formatt...
ruby
chosen
[ { "from": "system", "value": "Switch ApiLogging to be a module\n" }, { "from": "human", "value": "class ApiLogging\n extend ActiveSupport::Concern\n \n API_LOGGER = ActiveSupport::TaggedLogging.new(Rails.logger)\n \n def api_log(record={})\n tm = Time.now\n record.merge!(timestamp: tm...
ruby
chosen
[ { "from": "system", "value": "Update Nokogiri version to 1.6.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"sippy_cup/version\"\n\nGem::Specification.new do |s|\n s.name = \"sippy_cup\"\n s.version = SippyCup...
ruby
chosen
[ { "from": "system", "value": "Remove MacRuby references from gemspec.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/xcodeproj', __FILE__)\n\nGem::Specification.new do |s|\n s.name = \"xcodeproj\"\n s.version = Xcodeproj::VERSION\n s.date ...
ruby
chosen
[ { "from": "system", "value": "Fix error loading invalid icon\n" }, { "from": "human", "value": "class Build::Icons\n def download\n source = Models::Persistence.load(Build.source_path)\n\n Build.icons_path.mkpath\n\n source.teams.each do |team|\n file = Build.icons_path + \"#{team...
ruby
chosen
[ { "from": "system", "value": "Fix a typo in IGM test class\n" }, { "from": "human", "value": "require \"helpers/integration_test_helper\"\nrequire \"integration/factories/instance_group_manager_factory\"\n\nclass TestInstanceGroupManager < FogIntegrationTest\n include TestCollection\n\n def se...
ruby
chosen
[ { "from": "system", "value": "Allow for arguments in to_json\n" }, { "from": "human", "value": "module Hashie\n # A Hashie Hash is simply a Hash that has convenience\n # functions baked in such as stringify_keys that may\n # not be available in all libraries.\n class Hash < Hash\n include...
ruby
chosen
[ { "from": "system", "value": "Refactor loading of RubyScreen::Configuration source\n" }, { "from": "human", "value": "$:.unshift File.dirname(__FILE__)\nrequire 'preferences_loader'\nrequire 'configuration/description'\nrequire 'configuration/generator'\n\nmodule RubyScreen\n def self.process(a...
ruby
chosen
[ { "from": "human", "value": "Add brew tests command to run all unit tests.\n" }, { "from": "gpt", "value": "require 'utils'\n\nDir.chdir HOMEBREW_REPOSITORY + \"Library/Homebrew/test\"\n\n$tests_passed = true\n\ndef test t\n test_passed = system \"/usr/bin/ruby test_#{t}.rb\"\n $tests_passed &...
ruby
chosen
[ { "from": "human", "value": "Introduce a recipe for write-graphite plugin\n" }, { "from": "gpt", "value": "#\n# Copyright Peter Donald\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 obtain a c...
ruby
chosen
[ { "from": "system", "value": "Update tabs for Radiant 0.9\n" }, { "from": "human", "value": "# Uncomment this if you reference any of your controllers in activate\n# require_dependency 'application'\n\nclass EventsCalendarExtension < Radiant::Extension\n version \"0.5\"\n description \"Adds a ...
ruby
chosen
[ { "from": "system", "value": "Tweak the destination path again.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'simplecov'\nSimpleCov.start\n\nrequire 'minitest/autorun'\nrequire 'tilt/redcarpet'\nrequire 'tilt/erubis'\nrequire 'dimples'\n\ndef test_site\n @site ||=...
ruby
chosen
[ { "from": "system", "value": "Move disable_net_connect outside of setup\n" }, { "from": "human", "value": "ENV[\"RAILS_ENV\"] = \"test\"\n\nrequire File.expand_path(\"../../test/dummy/config/environment.rb\", __FILE__)\n\nrequire 'minitest/autorun'\nrequire 'webmock/minitest'\n\nmodule MiniTest...
ruby
chosen
[ { "from": "human", "value": "Add size, width, height, orig filename to image\n" }, { "from": "gpt", "value": "class AddFileMetaToImage < ActiveRecord::Migration\n def self.up\n change_table :images do |t|\n t.integer :size # bytes\n t.integer :width\n t.integer :height\n ...
ruby
chosen
[ { "from": "system", "value": "Add the Rails stuff we need\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"leaflet-rails/version\"\n\nGem::Specification.new do |s|\n s.name = \"leaflet-rails\"\n s.version = Leafl...
ruby
chosen
[ { "from": "system", "value": "Allow fd's for StreamReader.initialize as stream\n" }, { "from": "human", "value": "require \"archive/tar/reader\"\n\nclass Archive::Tar::StreamReader < Archive::Tar::Reader\n def initialize(stream, options = {})\n options = {\n block_size: 2 ** 19,\n ...
ruby
chosen
[ { "from": "system", "value": "Change async call to be immutable and simplify.\n" }, { "from": "human", "value": "# encoding: utf-8\n\nmodule FiniteMachine\n # An asynchronouse call representation\n class AsyncCall\n include Threadable\n\n attr_threadsafe :context\n\n attr_threadsafe :...
ruby
chosen
[ { "from": "system", "value": "Use redis command with a lower time complexity to filter primary key indexes.\n\nzrank is O(log(N)): http://redis.io/commands/zrank\nzscore is O(1): http://redis.io/commands/zscore\n" }, { "from": "human", "value": "module Relix\n class PrimaryKeyIndex < Index\n ...
ruby
chosen
[ { "from": "system", "value": "Remove some methods from ZoneInfo class\n" }, { "from": "human", "value": "# encoding: utf-8\n\nmodule TimezoneParser\n class ZoneInfo\n @Data = nil\n @Loaded = false\n @Offsets = nil\n @Timezones = nil\n @Metazones = nil\n\n ...
ruby
chosen
[ { "from": "system", "value": "[rackspace|identity] Handle NotAuthorized respones from the identity API in the user model\n" }, { "from": "human", "value": "require 'fog/core/collection'\nrequire 'fog/rackspace/models/identity/user'\n\nmodule Fog\n module Rackspace\n class Identity\n cla...
ruby
chosen
[ { "from": "system", "value": "Update version to 2.2.5 for release\n" }, { "from": "human", "value": "require 'metriks/opentsdb_reporter'\nrequire 'metriks/signalfx_reporter'\n\nmodule MetriksAddons\n VERSION = '2.2.4'\nend\n" }, { "from": "gpt", "value": "require 'metriks/opentsdb_r...
ruby
chosen
[ { "from": "system", "value": "Add uniq to list method\n" }, { "from": "human", "value": "require 'active_support/core_ext/array'\nrequire 'reserved_words/version'\n\nmodule ReservedWords\n DEFAULT_WORDS = %w(admin api image rss www cdn)\n\n @reserved_words = DEFAULT_WORDS.dup\n\n def self.lis...
ruby
chosen
[ { "from": "system", "value": "Add back template handler registration\n\nIn copying over the fix I inadvertantly ripped out a crucial line\nrequired for the template handler to take effect.\n\nSigned-off-by: Wincent Colaiuta <c76ac2e9cd86441713c7dfae92c451f3e6d17fdc@wincent.com>\n" }, { "from": "huma...
ruby
chosen
[ { "from": "system", "value": "Add support for rails 4\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"dbsync/version\"\n\nGem::Specification.new do |s|\n s.name = \"dbsync\"\n s.version = Dbsync::VERSION\n s.au...
ruby
chosen
[ { "from": "system", "value": "Update gemspec\n - Info and dependencies versions" }, { "from": "human", "value": "$LOAD_PATH.push File.expand_path('../lib', __FILE__)\n\nrequire 'smarteru/version'\n\nGem::Specification.new do |s|\n s.authors = ['Sasha Shamne', 'EyecueLab']\n s.name =...
ruby
chosen
[ { "from": "system", "value": "Fix for newer rspec version\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n# -*- coding: utf-8 -*-\nrequire File.expand_path(File.dirname(__FILE__) + '/spec_helper')\n$LOAD_PATH.unshift(File.join(File.dirname(__FILE__)))\n\ndescribe Chek do\n it \"normal r...
ruby
chosen
[ { "from": "system", "value": "Fix the order of latest songs\n" }, { "from": "human", "value": "class StaticPagesController < ApplicationController\n def home\n today = Time.zone.today\n @song = Rails.cache.fetch(\"pickup/#{today}\", expires_in: 1.day) { Song.includes(playings: :user).pick...
ruby
chosen
[ { "from": "system", "value": "Update fake event note generator\n" }, { "from": "human", "value": "class FakeEventNoteGenerator\n\n def initialize(student)\n @date = DateTime.new(2010, 9, 1)\n @student = student\n end\n\n def next\n @date += rand(30..60) # days\n educator = Educat...
ruby
chosen
[ { "from": "system", "value": "Set backend as exec for serverspec\n" }, { "from": "human", "value": "require 'serverspec'\n\ninclude SpecInfra::Helper::Exec\ninclude SpecInfra::Helper::DetectOS\n\nRSpec.configure do |c|\n if ENV['ASK_SUDO_PASSWORD']\n require 'highline/import'\n c.sudo_pas...
ruby
chosen
[ { "from": "human", "value": "Add OmniAuth config for mocking Facebook authentication.\n" }, { "from": "gpt", "value": "FACEBOOK_INFO = {\n \"id\" => \"12345\",\n \"link\" => \"http://facebook.com/john_doe\",\n \"email\" => \"user@example.com\",\n \"first_name\" => \"John\",\n \"last_name\" ...
ruby
chosen
[ { "from": "system", "value": "Remove has_rdoc from gemspec, since it is deprecated\n" }, { "from": "human", "value": "Gem::Specification.new do |s| \n s.name = \"fixture_dependencies\"\n s.version = \"1.10.0\"\n s.author = \"Jeremy Evans\"\n s.email = \"code@jeremyevans.net\"\n s.platform =...
ruby
chosen
[ { "from": "system", "value": "Fix bug happening in production\n\nRails was not using the correct serializers for the\ncollections presented on the `/ndcs/sdgs` api endpoint.\n\nThis PR explicitly tells which serializers to be used in\nthe `has_many` relations of `NdcsSdgs` `MetaSerializer`.\n\nTo reproduce ...
ruby
chosen
[ { "from": "system", "value": "Fix homepage to use SSL in NoMachine Cask\n\nThe HTTP URL is already getting redirected to HTTPS. Using the HTTPS URL directly\nmakes it more secure and saves a HTTP round-trip.\n" }, { "from": "human", "value": "cask :v1 => 'nomachine' do\n version '4.6.3_11'\n s...
ruby
chosen
[ { "from": "human", "value": "Add a null constraint for taggings_count column.\n" }, { "from": "gpt", "value": "class NoNullCounters < ActiveRecord::Migration\n def up\n change_column :tags, :taggings_count, :integer, :default => 0,\n :null => false\n end\n\n def down\n change_colum...
ruby
chosen