conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Use keyword arguments for set_color\n" }, { "from": "human", "value": "module LIFX\n module LightTarget\n MSEC_PER_SEC = 1000\n def set_color(color, duration = LIFX::Config.default_duration)\n queue_write(payload: Protocol::Light::Set.new(\n col...
ruby
chosen
[ { "from": "system", "value": "Fix Bundler version (~> 1.7)\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'lita/vkontakte/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Update Better Touch Tool to 1.20\n" }, { "from": "human", "value": "cask :v1 => 'bettertouchtool' do\n\n if MacOS.release <= :snow_leopard\n version '0.939'\n sha256 'fad5e9d36259c379bdb33188cf15d179fd9ff73023035c98f5734e7e3e13bb75'\n\n # bettertouchtool.c...
ruby
chosen
[ { "from": "system", "value": "Layout/IndentationWidth: Use 2 (not 4) spaces for indentation.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n#\n# Namespace for the Socializer engine\n#\nmodule Socializer\n # Wraps Socializer\"s functionality so that it can be shares with oth...
ruby
chosen
[ { "from": "system", "value": "Upgrade Remote Desktop Manager to version 2.0.4.0\n\nFixed newline at end of file.\n" }, { "from": "human", "value": "cask :v1 => 'remote-desktop-manager' do\n version '1.1.11.0'\n sha256 'f5e9ec3d2a3bea912e1686ee167f4dcca5643d504fd1cac49381eaf446e5f82d'\n\n # de...
ruby
chosen
[ { "from": "system", "value": "Update Oxygen icons to 4.4.1.\n" }, { "from": "human", "value": "require 'formula'\n\nclass OxygenIcons <Formula\n url 'ftp://ftp.kde.org/pub/kde/stable/4.4.0/src/oxygen-icons-4.4.0.tar.bz2'\n homepage 'http://www.oxygen-icons.org/'\n md5 'fbcd429cc822cb88a815d97...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary library from configuration\n" }, { "from": "human", "value": "require 'sidekiq/middleware/i18n'\n\nhost = ENV.fetch('REDIS_HOST') { 'localhost' }\nport = ENV.fetch('REDIS_PORT') { 6379 }\npassword = ENV.fetch('REDIS_PASSWORD') { false }\ndb = ENV....
ruby
chosen
[ { "from": "system", "value": "Change increment method signature to match actual signature\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire \"datadog/statsd\"\n\nclass StubStatsd\n def increment; end\nend\n\nmodule GitHubClassroom\n def self.statsd\n @statsd ||= if...
ruby
chosen
[ { "from": "system", "value": "Fix summarising mimimum spend condition.\n" }, { "from": "human", "value": "class PromotionSpendCondition < PromotionCondition\n desc \"Minimum Spend\"\n condition_scope :order\n exclusivity_scope :none\n position 5\n\n metadata(:config) do\n float :amount,...
ruby
chosen
[ { "from": "system", "value": "Update Navicat for SQL Server to 11.1.9\n" }, { "from": "human", "value": "cask :v1 => 'navicat-for-sql-server' do\n version '11.1.7'\n sha256 '6f3d7e13d929395f92ccf040867fa80b3cf29651070a6473ed574da76fbb461e'\n\n url \"http://download.navicat.com/download/navica...
ruby
chosen
[ { "from": "system", "value": "Use more intention revealing predicate" }, { "from": "human", "value": "require_dependency \"renalware/medications\"\n\nmodule Renalware\n module Medications\n class TreatablePresenter < DumbDelegator\n def sortable?\n __getobj__.class == Patient\n ...
ruby
chosen
[ { "from": "system", "value": "Improve Url address format validation\n\nBy anchoring our regex at the beginning of the string, we prevent\npossibly incorrect addresses from slipping through the cracks.\n\nChange-Id: Ied867410dcb37d99f0a7c5fe3d435b7b26bbded8\n" }, { "from": "human", "value": "clas...
ruby
chosen
[ { "from": "human", "value": "Use a form object for search form\n" }, { "from": "gpt", "value": "class SearchForm < Reform::Form\n property :q\n\n def initialize\n super(OpenStruct.new)\n end\n\n def self.property(name, options={})\n super(name, options.merge(virtual: true))\n end\nend...
ruby
chosen
[ { "from": "system", "value": "Check post existence before processing\n" }, { "from": "human", "value": "class PushJob < ApplicationJob\n queue_as :default\n\n rescue_from StandardError do |exception|\n logger.error(exception)\n Error.dump(exception, class_name: self.class.name)\n post...
ruby
chosen
[ { "from": "human", "value": "Set up replica identity index for Role\n\nrefs FOO-1171\nflag=none\n\ntest plan:\n - migration works up and down\n - tests pass\n\nChange-Id: I3a45025a1b8f178de84d9511b0efe56546d701f1\nReviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/260530\nTested-by: Service Cloud Je...
ruby
chosen
[ { "from": "system", "value": "Use a glob instead of specifically loading each lib file\n\nThis should prevent future issues with missing lib files.\n" }, { "from": "human", "value": "Gem::Specification.new do |s| \n s.name = \"fixture_dependencies\"\n s.version = \"1.7.1\"\n s.author = \"Jere...
ruby
chosen
[ { "from": "human", "value": "Add specs for `RemindPendingCheckAssignment` service\n" }, { "from": "gpt", "value": "require \"rails_helper\"\n\ndescribe CheckAssignments::RemindPendingCheckAssignment do\n include RepositoriesHelpers\n\n let(:service) { described_class.new(project_check) }\n le...
ruby
chosen
[ { "from": "system", "value": "Remove code for Soldius 2.5 is specs\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nRSpec.describe Spree::ProductsController, type: :controller do\n let!(:product) { create(:product, available_on: 1.year.from_now) }\n let!(:user) { build(:u...
ruby
chosen
[ { "from": "system", "value": "Remove timeout, rescue socket connection failures.\n" }, { "from": "human", "value": "require 'timeout'\n\nmodule Gearman\n class Client\n\n PACK = 'NN'\n UNPACK = 'a4NN'\n\n def echo(data)\n echo_req_packet_type = 16\n echo_req_packet_magic = \"...
ruby
chosen
[ { "from": "system", "value": "[Keyring] Transform name to a string upon initialization\n" }, { "from": "human", "value": "require 'osx_keychain'\n\nmodule CocoaPodsKeys\n class Keyring\n attr_accessor :keys, :path, :name\n\n def initialize(name, path, keys = [])\n @name = name\n ...
ruby
chosen
[ { "from": "system", "value": "Work around lack of logger silence\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\n# Scenario::Application.config.session_store :cookie_store, :key => '_scenario_session'\n\n# Use the database for sessions instead of...
ruby
chosen
[ { "from": "system", "value": "[skip ci] Add documentation comment to donations controller\n" }, { "from": "human", "value": "class Api::DonationsController < ApplicationController\n respond_to :json\n\n def total\n params.permit(:start, :end)\n start_date = params.fetch(:start, Date.toda...
ruby
chosen
[ { "from": "system", "value": "Fix N+1 query problem in FillEventTemplate class\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Results\n class FillEventTemplate\n # @param [::Event] event\n # @return [::ResultsTemplate]\n def self.perform(event)\n new(ev...
ruby
chosen
[ { "from": "system", "value": "Support Ruby naming convention for boolean getter procedures\n" }, { "from": "human", "value": "require 'active_support/concern'\n\nmodule Flavors\n module Preferences\n extend ::ActiveSupport::Concern\n\n module ClassMethods\n def preference(name, optio...
ruby
chosen
[ { "from": "system", "value": "Fix list of fotos in admin backend.\n" }, { "from": "human", "value": "ActiveAdmin.register Photo do\n belongs_to :poi, :optional => true\n belongs_to :user, :optional => true\n belongs_to :region, :optional => true\n\n filter :user_id, :as => :numeric\n filte...
ruby
chosen
[ { "from": "system", "value": "Make question available on previousquestion\n" }, { "from": "human", "value": "module Smartdown\n module Api\n class PreviousQuestion\n extend Forwardable\n\n def_delegators :@question, :title, :options\n\n attr_reader :response\n\n def initi...
ruby
chosen
[ { "from": "system", "value": "Add bearer tokens for link-checker-api authentication\n" }, { "from": "human", "value": "require \"gds_api/publishing_api_v2\"\nrequire \"gds_api/calendars\"\nrequire \"gds_api/link_checker_api\"\n\nmodule Services\n def self.publishing_api\n @publishing_api ||=...
ruby
chosen
[ { "from": "system", "value": "Fix group factory in rails 4\n\nparams[:address] was breaking the creation of the EnterpriseGroup\n" }, { "from": "human", "value": "require \"tasks/sample_data/addressing\"\nrequire \"tasks/sample_data/logging\"\n\nclass GroupFactory\n include Logging\n include A...
ruby
chosen
[ { "from": "system", "value": "Add a scope for available\n\nChange-Id: I772a38d9b50dfbe763e3a5653512becc7ffaee1a\n" }, { "from": "human", "value": "module Spree\n class LicenseKey < ActiveRecord::Base\n belongs_to :inventory_unit, :class_name => \"Spree::InventoryUnit\"\n belongs_to :varia...
ruby
chosen
[ { "from": "system", "value": "Update cache clearing for Rails 3" }, { "from": "human", "value": "# = CacheObserver\n#\n# Expires caches.\nclass CacheObserver < ActiveRecord::Observer\n observe :event, :venue\n\n #---[ Unique methods ]--------------------------------------------------\n\n # Re...
ruby
chosen
[ { "from": "system", "value": "Fix a bug where YouTube video URLs get cut off" }, { "from": "human", "value": "class RunValidator < ActiveModel::Validator\n def validate(record)\n validate_default_timing(record)\n validate_video_url(record)\n end\n\n private\n\n def validate_default_tim...
ruby
chosen
[ { "from": "system", "value": "Refactor: Use keyword args in IndexFileFinder\n" }, { "from": "human", "value": "module Adsf::Rack\n class IndexFileFinder\n def initialize(app, options)\n @app = app\n (@root = options[:root]) || raise(ArgumentError, ':root option is required but was ...
ruby
chosen
[ { "from": "system", "value": "Prepare for next development iteration\n" }, { "from": "human", "value": "module Asciidoctor\n module DocTest\n VERSION = '1.5.1.2'\n end\nend\n" }, { "from": "gpt", "value": "module Asciidoctor\n module DocTest\n VERSION = '1.5.2.dev'\n end\ne...
ruby
chosen
[ { "from": "system", "value": "Use loop rather than assigning defaults one by one\n" }, { "from": "human", "value": "module Brightbox\n class FirewallRule < Api\n attr_writer :attributes\n\n def self.create(options)\n new(conn.firewall_rules.create(options))\n end\n\n def self.g...
ruby
chosen
[ { "from": "system", "value": "Update gemspec and add runtime dependency for activesupport.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'matrix/version'\n\nGem::Specification.new d...
ruby
chosen
[ { "from": "system", "value": "Update http requirement from ~> 3.0 to >= 3, < 5\n\nUpdates the requirements on [http](https://github.com/httprb/http) to permit the latest version.\n- [Release notes](https://github.com/httprb/http/releases)\n- [Changelog](https://github.com/httprb/http/blob/master/CHANGES.md)...
ruby
chosen
[ { "from": "system", "value": "Add install and get_package_version for FreeBSD10\n\nlike 34a45cf and 7c2a3da\n" }, { "from": "human", "value": "module SpecInfra\n module Command\n class FreeBSD10 < FreeBSD\n def check_installed(package, version=nil)\n if version\n \"pkg q...
ruby
chosen
[ { "from": "system", "value": "Remove superfluous self in JSONSerializer\n" }, { "from": "human", "value": "module Vault\n module Rails\n module JSONSerializer\n DECODE_OPTIONS = {\n max_nested: false,\n create_additions: false,\n }.freeze\n\n def self.encod...
ruby
chosen
[ { "from": "system", "value": "Change name of adjust method\n" }, { "from": "human", "value": "module Writer\n class OverwritePrevention\n def self.adjust_name(name)\n count = 1\n\n while File.exists?(name)\n name = append_count(name, count +=1)\n end\n\n name\n ...
ruby
chosen
[ { "from": "system", "value": "Move one more test over to use panopticon_has_metadata\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass Admin::TransactionsControllerTest < ActionController::TestCase\n\n setup do\n stub_request(:delete, \"#{Plek.current.find(\"arbiter\")}/slugs...
ruby
chosen
[ { "from": "system", "value": "Handle case of one item\n" }, { "from": "human", "value": "# Polyfill from Rubinius for Ruby 2.2's `slice_when` method\n# https://github.com/rubinius/rubinius/commit/f21d58d735383a30156575a2c51b0982b6bae217\nmodule Enumerable\n unless instance_methods.include? :sli...
ruby
chosen
[ { "from": "system", "value": "Fix ruby utf8 byte sequence error\n" }, { "from": "human", "value": "#! /usr/bin/env ruby\n#\n# check-hardware-fail\n#\n# DESCRIPTION:\n# Check dmesg for failing hardware\n# Detects things like overheating CPUs, dying hard drives, etc.\n#\n# OUTPUT:\n# plain...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.5.2.0 to 0.6.0.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'raygun_client'\n s.version = '0.5.2.0'\n s.summary = 'Client for the Raygun API using the Obsidian HTTP cl...
ruby
chosen
[ { "from": "system", "value": "Update Beyond Compare.app to 4.0.4.19477\n" }, { "from": "human", "value": "cask :v1 => 'beyond-compare' do\n version '4.0.3.19420'\n sha256 '2feb23098fa6fdc6885ef57fbea1a638a820f4eaeffbbd2e820ef7dc6272342f'\n\n url \"http://www.scootersoftware.com/BCompareOSX-#{...
ruby
chosen
[ { "from": "system", "value": "Allow HTTP Requests for JSON API-endpoints\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 wi...
ruby
chosen
[ { "from": "system", "value": "Update the comment for the shelves setting\n" }, { "from": "human", "value": "# A Struct for conveniently storing individual shelves for the shelves setting.\nShelf = Struct.new(:begin, :end)\n\nAlexandria::Application.configure do\n # This file contains configurat...
ruby
chosen
[ { "from": "system", "value": "Fix error raised while checking pidfile\n" }, { "from": "human", "value": "namespace :deploy do\n desc 'Start hightops'\n task :start_hightops do\n on roles fetch(:hightops_roles, :app) do\n within current_path do\n execute 'echo Starting Hightops'\...
ruby
chosen
[ { "from": "system", "value": "Use struct accessor in List methods too\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'ffi-glib/container_class_methods'\n\nmodule GLib\n # Common methods for List and SList.\n module ListMethods\n include Enumerable\n attr_read...
ruby
chosen
[ { "from": "system", "value": "Expand extensions and move them to a class attr_accessor\n" }, { "from": "human", "value": "module Sprockets\n class Environment\n def initialize(root = \".\")\n @trail = Hike::Trail.new(root)\n @trail.extensions.push(\".coffee\", \".less\", \".scss\",...
ruby
chosen
[ { "from": "system", "value": "Use client from env if present\n" }, { "from": "human", "value": "module Userbin\n module UserbinClient\n def userbin\n @userbin ||= Userbin::Client.new(request, response)\n end\n end\n\n ActiveSupport.on_load(:action_controller) do\n include Userbi...
ruby
chosen
[ { "from": "system", "value": "Revert \"Dump libsodium symbols in CI environment\"\n\nThis reverts commit f23acf9e5cc69a032afd3839dc2084a02a3c924c.\n" }, { "from": "human", "value": "require \"rake/clean\"\n\nfile \"lib/libsodium.so\" => :build_libsodium do\n cp $LIBSODIUM_PATH, \"lib/libsodium....
ruby
chosen
[ { "from": "human", "value": "Add example of Socket usage\n" }, { "from": "gpt", "value": "\n$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))\n\nrequire 'minx'\nrequire 'minx/io'\nrequire 'socket'\n\ninclude ::Socket::Constants\n\nsockaddr = Socket.sockaddr_in(80, 'www.eb.dk')\n...
ruby
chosen
[ { "from": "system", "value": "Disable creation of embedded automation managers\n" }, { "from": "human", "value": "class ManageIQ::Providers::EmbeddedAutomationManager < ManageIQ::Providers::AutomationManager\n require_nested :Authentication\n require_nested :ConfigurationScript\n require_nest...
ruby
chosen
[ { "from": "system", "value": "Change project cache key to depend on ID instead of full path\n\nPreviously, project cache used as part of the namespace the `full_path`,\nwhich included namespace and project slug.\n\nThat meant that anytime a project was renamed or transfered to a\ndifferent namespace, we wou...
ruby
chosen
[ { "from": "system", "value": "Add missing initializer for parent\n" }, { "from": "human", "value": "module Imap::Backup\n class CLI::Restore < Thor\n include Thor::Actions\n include CLI::Helpers\n\n attr_reader :email\n attr_reader :account_names\n\n def initialize(email = nil, o...
ruby
chosen
[ { "from": "system", "value": "Remove puts added for debugging\n" }, { "from": "human", "value": "require 'yaml'\n\nmodule SemiAuto\n class Configuration\n attr_reader :access_key_id\n attr_reader :secret_access_key\n attr_reader :region\n attr_reader :load_balancer_name\n attr_re...
ruby
chosen
[ { "from": "system", "value": "Rename method to match the intention better\n" }, { "from": "human", "value": "module Veritas\n module Algebra\n class Product < Relation\n include BinaryOperation\n\n def self.new(left, right)\n unless (left.header & right.header).empty?\n ...
ruby
chosen
[ { "from": "system", "value": "Add correct base class for LineItem class in FindByVariant finder\n" }, { "from": "human", "value": "module Spree\n class LineItem\n class FindByVariant\n def execute(order:, variant:, options: {})\n order.line_items.detect do |line_item|\n ...
ruby
chosen
[ { "from": "system", "value": "Remove completed talk migration update all to pass tests\n" }, { "from": "human", "value": "class AddCompletedToTalks < ActiveRecord::Migration\n def change\n add_column :talks, :completed, :boolean, :default => false\n\n Talk.all.each do |t|\n t.complet...
ruby
chosen
[ { "from": "human", "value": "Add specs testing single page app rending and login redirect\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe ApplicationController do\n context \"authenticated\" do\n login_user\n describe \"GET index\" do\n render_views\n it \"ren...
ruby
chosen
[ { "from": "system", "value": "Throw 404 if attachment can not be found.\n" }, { "from": "human", "value": "require 'spec_helper'\n\nmodule Alchemy\n describe AttachmentsController do\n let(:attachment) { build_stubbed(:attachment) }\n\n before {\n attachment.stub(:restricted?).and_re...
ruby
chosen
[ { "from": "human", "value": "Add simple (partial) test for TestEmailsController\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe TestEmailsController do\n describe \"#new\" do\n it \"should give some default text\" do\n get :new\n assigns(:text).should == \"Hello ...
ruby
chosen
[ { "from": "system", "value": "Apply correct gem.files with Dir\n\n- Removing gem.files with git\n- Removing unecessary gem.test_files\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + '/lib/omniauth-remote-user/version'\n\nGem::Specification.new do |gem|\n gem.add_runtime_depe...
ruby
chosen
[ { "from": "system", "value": "Update gem spec to 2.5.0 and add protobof as requirement\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\n\nGem::Specification.new do |s|\n s.name ...
ruby
chosen
[ { "from": "system", "value": "Set the virtualbox config scope\n" }, { "from": "human", "value": "require \"vagrant\"\n\nmodule VagrantPlugins\n module ProviderVirtualBox\n class Plugin < Vagrant.plugin(\"2\")\n name \"VirtualBox provider\"\n description <<-EOF\n The VirtualBox...
ruby
chosen
[ { "from": "system", "value": "Make import script read from stdin\n\nUsing ARGV conflicts with passing an --environment argument to rails\nrunner\n" }, { "from": "human", "value": "require \"nokogiri\"\n\ndoc = Nokogiri::HTML(open(ARGV[0]))\ndoc.css('#content p').each do |p|\n begin\n quote =...
ruby
chosen
[ { "from": "system", "value": "Remove color-picker from Atom packages to install\n" }, { "from": "human", "value": "require \"open-uri\"\nrequire \"open_uri_redirections\"\nrequire \"progressbar\"\nrequire_relative \"../../progress_bar\"\nrequire \"thor\"\n\nmodule Codelation\n class Cli < Thor\...
ruby
chosen
[ { "from": "system", "value": "Improve check for whether fork is available\n" }, { "from": "human", "value": "#\n# This file is part of ruby-ffi.\n# For licensing, see LICENSE.SPECS\n#\n\nrequire File.expand_path(File.join(File.dirname(__FILE__), \"spec_helper\"))\n\n# Skip platforms that don't i...
ruby
chosen
[ { "from": "human", "value": "Add some tests for english strings\n" }, { "from": "gpt", "value": "require 'Language'\nDir[File.dirname(__FILE__) + \"/../lib/errors/*.rb\"].each {|file| require file }\n\nRSpec.describe Language do\n context \"default\" do\n before do\n @langua...
ruby
chosen
[ { "from": "system", "value": "Add spec for actions on base spec.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe TableCloth::Base do\n subject { Class.new(TableCloth::Base) }\n let(:view_context) { ActionView::Base.new }\n\n context 'columns' do\n it 'has a column meth...
ruby
chosen
[ { "from": "system", "value": "Fix org creation to include login and admin.\n" }, { "from": "human", "value": "module Octokit\n class EnterpriseAdminClient\n\n # Methods for the Enterprise Orgs API\n #\n # @see https://developer.github.com/v3/enterprise/orgs/\n module Orgs\n\n #...
ruby
chosen
[ { "from": "system", "value": "Fix bug on installation of nested package name\n" }, { "from": "human", "value": "require \"serverkit/resources/package\"\n\nmodule Serverkit\n module Resources\n class HomebrewPackage < Package\n # @note Override to force to use brew command\n def app...
ruby
chosen
[ { "from": "system", "value": "Add pry as development dependency\nso that debug is easier next time(and you don't need to temporarily add it again)\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/retryable/version', __FILE__)\n\nGem::Specification.ne...
ruby
chosen
[ { "from": "system", "value": "Move define_constructors to class level\n" }, { "from": "human", "value": "# This class is inherited by the has_one and belongs_to association classes \n\nmodule ActiveRecord::Associations::Builder\n class SingularAssociation < Association #:nodoc:\n def valid_o...
ruby
chosen
[ { "from": "human", "value": "Test that configuration of ownership works\n" }, { "from": "gpt", "value": "require 'test_helper'\n\nclass ActsAsApprovableOwnershipTest < Test::Unit::TestCase\n context 'with default configuration' do\n setup { ActsAsApprovable::Ownership.configure }\n\n shou...
ruby
chosen
[ { "from": "system", "value": "Use the correct acceptance URL for builder\n\nSigned-off-by: Joshua Timberman <d6955d9721560531274cb8f50ff595a9bd39d66f@chef.io>\n" }, { "from": "human", "value": "include_recipe '::install'\n\nhab_package 'core/redis'\n\nhab_package 'lamont-granquist/ruby' do\n ch...
ruby
chosen
[ { "from": "system", "value": "Add and change syntax of query tool migrations for postgres compatibility.\n" }, { "from": "human", "value": "class AddLongLatQueryTool < ActiveRecord::DataMigration\n def up\n\n view_sql = <<-SQL\n CREATE OR REPLACE VIEW geometry_transam_assets_view AS\n...
ruby
chosen
[ { "from": "system", "value": "Reset page to 0 when changing filter.\n" }, { "from": "human", "value": "module ArtifactsHelper\n def temportal_facet_path(params, low, high)\n artifacts_path(params.dup.update(low_date: low, high_date: high))\n end\n\n def temporal_facet_menu_item(params, low...
ruby
chosen
[ { "from": "system", "value": "Simplify relation between a build and metadata\n\nThis removes erroneously defined polymorphic association, because\nspecifying `belongs_to` relationship with a class that already supports\npolymorphic associations works out-of-the-box.\n" }, { "from": "human", "val...
ruby
chosen
[ { "from": "system", "value": "Set gemsspec to be compatible with 4.2\n" }, { "from": "human", "value": "$:.push File.expand_path('../lib', __FILE__)\n\n# Maintain your gem's version:\nrequire 'select2_helper/version'\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do...
ruby
chosen
[ { "from": "system", "value": "Add single_quad definition for the ServiceTemplate model\n" }, { "from": "human", "value": "class ServiceTemplateDecorator < MiqDecorator\n def self.fonticon\n 'fa fa-cube'\n end\n\n def fonticon\n atomic? ? super : 'fa fa-cubes'\n end\n\n def fileicon\n ...
ruby
chosen
[ { "from": "system", "value": "Change to update to use new names.\n" }, { "from": "human", "value": "# coding: utf-8\n\nrequire 'tty-spinner'\n\nTTY::Formats::FORMATS.size.times do |i|\n format = \"spin_#{i+1}\"\n options = {format: format.to_sym, hide_cursor: true}\n spinner = TTY::Spinner.ne...
ruby
chosen
[ { "from": "system", "value": "Remove content of connect capybara spec.\n\nNot sure what this was trying to achieve, but the current behaviour\ndoesn't start a server unless started from rspec.\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe \"Capybara\" do\n\tdescribe \"Wi...
ruby
chosen
[ { "from": "system", "value": "Return times and near-times in JSON format.\n" }, { "from": "human", "value": "require 'sinatra'\nrequire 'eventmachine'\nrequire 'em-http'\nrequire 'json'\nrequire 'sinatra/redis'\n\nSECONDS_TTL = 12 * 60 * 60\nMINUTES_TTL = 9 * 24 * 60 * 60\n\nconfigure :produ...
ruby
chosen
[ { "from": "system", "value": "Add homepage and license info to the gemspec\n" }, { "from": "human", "value": "# encoding: utf-8\nrequire File.expand_path('../lib/silverpop/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.add_dependency 'addressable', '~> 2.3'\n gem.add_dependency '...
ruby
chosen
[ { "from": "human", "value": "Add ability to offer games\n" }, { "from": "gpt", "value": "#/usr/bin/env ruby\nrequire File.expand_path('../../lib/state.rb', __FILE__)\nrequire File.expand_path('../../lib/client.rb', __FILE__)\n\nclass Game\n\n game = State.new\n nc = Client.new\n nc.login\n g...
ruby
chosen
[ { "from": "system", "value": "Remove explicit dependency on minitest\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'sluggi/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Update method signatures (changed since pull request).\n" }, { "from": "human", "value": "require 'geocoder/lookups/base'\nrequire 'geocoder/results/maxmind'\nrequire 'csv'\n\nmodule Geocoder::Lookup\n class Maxmind < Base\n\n private # -------------------------...
ruby
chosen
[ { "from": "system", "value": "Add not_compliant_on to special calls (specs only)\n" }, { "from": "human", "value": "require 'opal/nodes'\n\nclass Opal::Nodes::CallNode\n # Rubyspec uses this call to load in language specific features at runtime.\n # We can't do this at runtime, so handle it du...
ruby
chosen
[ { "from": "human", "value": "Add plugin with polymorphic association to audits\n" }, { "from": "gpt", "value": "# Keeps a record of the changes after create/update/destroy\nmodule Sequel\n module Plugins\n module Auditable\n\n def self.configure(model, options = {})\n # Associati...
ruby
chosen
[ { "from": "system", "value": "Include certain helpers only for controller specs\n\nTravis CI was failing because of the conflict between the `sign_out` method\nmeant for integration tests and the `sign_out` method used for controller specs.\n\nExample failure: https://travis-ci.org/thoughtbot/clearance/jobs...
ruby
chosen
[ { "from": "system", "value": "Make message for TemplateNotFoundError more readable" }, { "from": "human", "value": "require 'tilt'\nrequire 'dry-equalizer'\n\nmodule Dry\n module View\n class Renderer\n include Dry::Equalizer(:paths, :format, :engine)\n\n TemplateNotFoundError = Cl...
ruby
chosen
[ { "from": "system", "value": "Fix monkey patch of Schema.define so it passes the info hash which\nis necessary to initialize schema_migrations table. Why does it\nmatter when using nulldb? In some cases we us the nulldb adapter to\nget around database checks when the task we are running has no need\nfor a d...
ruby
chosen
[ { "from": "system", "value": "Fix code: set the 2nd option to JSON.generate method\n" }, { "from": "human", "value": "module Sisimai\n class Data\n # Sisimai::Data::JSON dumps parsed data object as a JSON format. This class\n # and method should be called from the parent object \"Sisimai:...
ruby
chosen
[ { "from": "system", "value": "Change interface for setting the time between interface. Now accept a proc." }, { "from": "human", "value": "module Voteable\n def is_voteable(options = {}, &block)\n has n, :votes, 'Voteable::Vote', :as => :voteable, :child_key => [ :voteable_id ]\n\n #if !o...
ruby
chosen
[ { "from": "system", "value": "Move randoms into defs and all defs inside private. TODO: remove $\n" }, { "from": "human", "value": "class Name \n def generate\n name = Array.new(rand(2..12))\n charVowels = [\"a\", \"e\", \"i\", \"o\", \"u\", \"y\"]\n charConsonants = [\"b\", \"c\", \"d...
ruby
chosen
[ { "from": "system", "value": "Set correct date for the first version\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'tooth'\n s.version = '0.0.1'\n s.date = '2013-08-12'\n s.description = \"Simple page objects for Capybara\"\n s.summary = \...
ruby
chosen
[ { "from": "system", "value": "Test for vector library inclusion.\n" }, { "from": "human", "value": "require 'pong'\n\ndescribe Pong do\n it \"is not a bartender\" do\n \texpect { Pong.mix(:mojito) }.to raise_error\n end\nend" }, { "from": "gpt", "value": "require 'pong'\nrequire '...
ruby
chosen
[ { "from": "system", "value": "Add deps github_api ~> 0.8.11\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'github/keys/version'\n\nGem::Specification.new do |gem|\n gem.n...
ruby
chosen
[ { "from": "system", "value": "Change Rating to Friending (this file was copied from rating.rb)\n" }, { "from": "human", "value": "class Rating < ActiveRecord::Base\n belongs_to :friendee, :polymorphic=>true\n belongs_to :friendor, :polymorphic=>true\n validates_uniqueness_of :friendee_id, :sc...
ruby
chosen