conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Remove version for development dependencies\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'background_worker/version'\n\nGem::Specification.new do |spe...
ruby
chosen
[ { "from": "human", "value": "Add deprecation for duplicate routes\n\nRails 4.0 raises an error when duplicate named routes\nare added. This was done without deprecation in 4.0.\nThis monkeypatch adds a deprecation warning for use with\nRails 3.2.\n" }, { "from": "gpt", "value": "if Rails.env.tes...
ruby
chosen
[ { "from": "system", "value": "Remove /m since it is no longer needed\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n# A simple library to prepend magic comments to all Ruby files in a given folder\n\nmodule AddMagicComment\n MAGIC_COMMENT_PREFIX = \"frozen_string_literal\"...
ruby
chosen
[ { "from": "system", "value": "Load rake tasks if gem is not active\n" }, { "from": "human", "value": "module Appsignal\n class Railtie < Rails::Railtie\n\n rake_tasks do\n require 'tasks/appsignal_tasks' if Appsignal.active\n end\n\n initializer \"appsignal.configure_rails_initial...
ruby
chosen
[ { "from": "system", "value": "Package version increased from 0.2.0.0 to 0.2.0.1\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'messaging'\n s.version = '0.2.0.0'\n s.summary = 'Messaging primitives for Eventide'\n s.description = ' '\n...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.12.3.1 to 0.13.0.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'evt-messaging'\n s.version = '0.12.3.1'\n s.summary = 'Messaging primitives for Eventide'\n s.descripti...
ruby
chosen
[ { "from": "system", "value": "Use update_column for backfilling auth_bypass_id values\n\nThis migration was written to use `update`. This changes the `updated_at`\nfield during the migration (making it look like all step by steps have been\nmodified by a content designer). Changing to `update_column` so t...
ruby
chosen
[ { "from": "system", "value": "Fix crash on startup if hosts blacklist is empty\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'url_normalizer'\n\n# Load blacklisted hosts from the YAML config file.\n# If the config file changes the server must be restarted to pick up...
ruby
chosen
[ { "from": "system", "value": "Stop ignoring script-tutorials.com link checks\n\nThe site now redirects correctly if the URLs miss the end slash.\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\nrequire 'html-proofer'\n\nHTMLProofer.check_directory('./_site', {\n\t:parallel => {\n\t\t:in...
ruby
chosen
[ { "from": "system", "value": "Refactor embedded models. Add associations between embedded models\n" }, { "from": "human", "value": "class IrsGroup\n include Mongoid::Document\n include Mongoid::Timestamps\n include Mongoid::Versioning\n include Mongoid::Paranoia\n\n # Unique identifier for ...
ruby
chosen
[ { "from": "system", "value": "Fix link handling without router\n" }, { "from": "human", "value": "module Inesita\n module ComponentVirtualDomExtension\n def self.included(base)\n base.alias_method :__a, :a\n base.define_method(:a) do |params, &block|\n params = { onclick: ->...
ruby
chosen
[ { "from": "system", "value": "Fix the msgpack_object_type enum values.\n" }, { "from": "human", "value": "require 'ffi'\n\nmodule FFI\n module MsgPack\n extend FFI::Library\n\n typedef :int, :size_t\n\n enum :msgpack_unpack_return, [\n :success, 2,\n :extra_bytes, 1,\n :...
ruby
chosen
[ { "from": "system", "value": "Add dotenv to development 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 'segurofacil/version'\n\nGem::Specification.new do |spec|\n spec.na...
ruby
chosen
[ { "from": "system", "value": "Use the correct cookbook name for test\n" }, { "from": "human", "value": "#\n# Cookbook Name:: exabgp_service_test\n# Recipe:: default\n#\n# Copyright 2012-2016, DNSimple, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not us...
ruby
chosen
[ { "from": "system", "value": "Return empty string as slug if no url\n" }, { "from": "human", "value": "module Georgia\n class Link < ActiveRecord::Base\n\n include Concerns::Contentable\n\n belongs_to :menu, class_name: Georgia::Menu, touch: true\n\n acts_as_list scope: :menu\n has_...
ruby
chosen
[ { "from": "system", "value": "Fix weird escaping coming from JS plugin\n" }, { "from": "human", "value": "class ProjectFile < ActiveRecord::Base\n belongs_to :project\n belongs_to :uploader, class_name: \"User\"\n\n after_destroy :delete_s3_file\n \n private\n def delete_s3_file\n s3 = ...
ruby
chosen
[ { "from": "system", "value": "Set htmlonly to true for cookie.\n" }, { "from": "human", "value": "class UserSession < Authlogic::Session::Base\n # only session related configuration goes here, see documentation for sub modules of Authlogic::Session\n # other config goes in acts_as block\n log...
ruby
chosen
[ { "from": "system", "value": "Fix for Opsworks undefined method `source_url' error\n\nThis resolves these errors on AWS Opsworks:\n\n[2016-04-22T00:58:36+00:00] ERROR: Could not read\n/opt/aws/opsworks/current/merged-cookbooks/nfs into a Chef object:\nundefined method `source_url' for\n#<Chef::Cookbook::Met...
ruby
chosen
[ { "from": "system", "value": "Bump to 1.0.5 for development\n" }, { "from": "human", "value": "name 'hubot'\nmaintainer 'Tim Smith'\nmaintainer_email 'tsmith84@gmail.com'\nlicense 'Apache 2.0'\ndescription \"Deploys and manages an instance of Github's Hubot.\"\nlo...
ruby
chosen
[ { "from": "system", "value": "Increment version to indicate it has some chance of working\n" }, { "from": "human", "value": "name 'zipfile'\nmaintainer 'Ben Jansen'\nmaintainer_email 'aogail@w007.org'\nlicense 'Apache 2.0'\ndescription 'Provides a resource for ext...
ruby
chosen
[ { "from": "system", "value": "Add a version constraint on logrotate cookbook.\n" }, { "from": "human", "value": "name 'jenkins'\nmaintainer 'Chef Software, Inc.'\nmaintainer_email 'releng@chef.io'\nlicense 'Apache 2.0'\ndescription 'Installs and configures Jenkins...
ruby
chosen
[ { "from": "system", "value": "Refactor queueing for Runner results\n" }, { "from": "human", "value": "require \"rspec-live/concurrent_process\"\nrequire \"json\"\n\nmodule RSpecLive\n class Runner\n def initialize\n @queued_examples = []\n end\n\n def request_inventory\n end\n\...
ruby
chosen
[ { "from": "human", "value": "Add test to track correct escaping.\n" }, { "from": "gpt", "value": "require \"helpers/test_helper\"\n\nclass UnitTestServer < MiniTest::Test\n def setup\n Fog.mock!\n @client = Fog::Storage.new(provider: \"google\",\n google_stor...
ruby
chosen
[ { "from": "system", "value": "Add Addressable gem for IRI\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"epub/parser/version\"\n\nGem::Specification.new do |s|\n s.name = \"epub-parser\"\n s.version = EPUB::Par...
ruby
chosen
[ { "from": "system", "value": "Refactor Base.requires! so it can be used as a class or instance method.\n" }, { "from": "human", "value": "module SportsSouth\n # Holds methods common to all classes.\n class Base\n\n protected\n\n def requires!(hash, *params)\n params.each do |param|\...
ruby
chosen
[ { "from": "system", "value": "Return an empty array on fail\nAdd destroy\n" }, { "from": "human", "value": "module Squall\n class Hypervisor < Client\n\n URI_PREFIX = 'settings/hypervisors'\n\n def settings\n if get(URI_PREFIX)\n @message.collect { |res| res['hypervisor'] }\n ...
ruby
chosen
[ { "from": "system", "value": "Refactor with text method instead of first.content\n" }, { "from": "human", "value": "# encoding: UTF-8\n\nmodule DineroMailIpn\n class Reporter\n\n # Report status list\n VALID_REPORT_STATUS = 1\n MALFORMED_REPORT_STATUS = 2\n INVALID_ACCOUNT_NUMBER_RE...
ruby
chosen
[ { "from": "system", "value": "Use forwardable instead of inheritance for RequestArray\n" }, { "from": "human", "value": "class Turf::RequestArray < Array\n\n def run(slice: nil)\n conn = nil\n prev = nil\n slice ||= self\n slice.each do |r|\n if not conn or not r.same_connectio...
ruby
chosen
[ { "from": "system", "value": "Remove private methods and instance vars\n\nIn order to reduce any possible naming conflicts or namespace pollution\n" }, { "from": "human", "value": "module Fetchable\n def fetch(key, not_found_value = no_default_given, &block)\n if not_found_value != no_defaul...
ruby
chosen
[ { "from": "system", "value": "Add an argument to Reminisce::save\n" }, { "from": "human", "value": "require \"remindice/version\"\nrequire \"thor\"\n\nmodule Remindice\n TASK_FILENAME = File.expand_path(\"~/.reamindice_tasks\")\n\n class << self\n def tasks\n @@tasks.clone\n end\n\n...
ruby
chosen
[ { "from": "system", "value": "Fix typo in Cfg comment\n" }, { "from": "human", "value": "require 'yaml'\n\nmodule Vnehm\n\n ##\n # Cfg module manipulates with nehm's config file (~/.vnehmconfig)\n\n module Cfg\n\n FILE_PATH = File.join(ENV['HOME'], '.vnehmconfig')\n\n def self.[](key)\n...
ruby
chosen
[ { "from": "system", "value": "Handle no debug user in config file when no login option used\n" }, { "from": "human", "value": "module LabWiki\n class Authentication\n class None < Authentication\n register_type :none\n\n def initialize(opts)\n super\n @identity_url = ...
ruby
chosen
[ { "from": "system", "value": "Add after_build hook during after_commit hook\n\nFixes #29\n" }, { "from": "human", "value": "require 'middleman-core'\nrequire 'map'\n\nmodule Middleman\n module S3Sync\n class << self\n def registered(app, options_hash = {}, &block)\n options = Opt...
ruby
chosen
[ { "from": "system", "value": "Fix missed name=>path parameter rename symbols\n\nWhen the name parameter was renamed path (which became the namevar),\nthese explicit references to the parameter were missed. This commit\nchanges the :name references to :path. This is necessary to prevent\ninconsistent behavio...
ruby
chosen
[ { "from": "system", "value": "Fix logging when exiting stale workers\n" }, { "from": "human", "value": "module Transferatu\n module TransferSupervisor\n def self.run\n started_at = Time.now\n status = Transferatu::WorkerStatus.create\n worker = TransferWorker.new(status)\n ...
ruby
chosen
[ { "from": "system", "value": "Update hatchet spec to account for new getting-started app\n" }, { "from": "human", "value": "require_relative 'spec_helper'\n\ndescribe \"Gradle\" do\n\n before(:each) do\n init_app(app)\n end\n\n context \"on JDK 8\" do\n let(:app) { Hatchet::Runner.new(\...
ruby
chosen
[ { "from": "system", "value": "Add require for code coverage libraries\n\nMake sure we load `simplecov` and `codecov` when we find the right environment variables are present\n" }, { "from": "human", "value": "require \"bundler/setup\"\nrequire \"database_cleaner-core\"\nrequire \"byebug\"\n\nRSp...
ruby
chosen
[ { "from": "system", "value": "Add configuration values to spec helper so tests can run out of the box\n\nNormally config values are loaded from config/config.yml, which would\nrequire this to be checked in. But, we manage that file with chef.\nThis change allows the spec tests to be automated and those new ...
ruby
chosen
[ { "from": "system", "value": "Set rspec to use random order\n" }, { "from": "human", "value": "require 'simplecov'\nSimpleCov.start\n\nENV['RORY_ENV'] = 'test'\n$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))\n$LOAD_PATH.unshift(File.dirname(__FILE__))\nrequire 'rspec'\nrequir...
ruby
chosen
[ { "from": "system", "value": "Add stubs required by the main application\n" }, { "from": "human", "value": "# Configure Rails Envinronment\nENV[\"RAILS_ENV\"] = \"test\"\n\nrequire File.expand_path(\"../dummy/config/environment.rb\", __FILE__)\nrequire 'rspec/rails'\nrequire 'factories'\n\nENGI...
ruby
chosen
[ { "from": "system", "value": "Remove requires for all adapter files\n\nClient code should require the needed adapters.\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'rom'\n\ninclude ROM\n\nif defined? JRUBY_VERSION\n USING_JRUBY = true\nelse\n USING_JRUBY = false\nend\n\nif U...
ruby
chosen
[ { "from": "system", "value": "Add code climate test reporter\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\nrequire 'oh_my_embed'\n" }, { "from": "gpt", "value": "require 'codeclimate-test-reporter'\nCodeClimate::TestReporter.start\n\n$...
ruby
chosen
[ { "from": "system", "value": "Enforce the use of the rspec expect syntax\n" }, { "from": "human", "value": "# encoding: utf-8\n\nif ENV['COVERAGE']\n require 'simplecov'\n SimpleCov.start\nend\n\n$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))\n$LOAD_PATH.unshift(File.dirnam...
ruby
chosen
[ { "from": "system", "value": "Remove unused helper and matcher.\n" }, { "from": "human", "value": "ENV[\"RAILS_ENV\"] ||= 'test'\n\nrequire File.expand_path(\"../../config/environment\", __FILE__)\nrequire 'rspec/rails'\n\nDir[\"#{File.dirname(__FILE__)}/support/**/*.rb\"].each do |file|\n requ...
ruby
chosen
[ { "from": "system", "value": "Remove minitest as we use rspec\n" }, { "from": "human", "value": "require 'rubygems' unless defined? Gem\n# require 'minitest' if RUBY_VERSION < \"1.9\"\n\n# we need the actual library file\n# require_relative '../lib/ms_translate'\n# For Ruby < 1.9.3, use this ins...
ruby
chosen
[ { "from": "system", "value": "Include RSpec 3 configuration defaults.\n" }, { "from": "human", "value": "ENV['RAILS_ENV'] ||= 'test'\nrequire File.expand_path(\"../dummy/config/environment.rb\", __FILE__)\nrequire 'rspec/rails'\nrequire 'pry'\n\nRails.backtrace_cleaner.remove_silencers!\n\nDir[...
ruby
chosen
[ { "from": "system", "value": "Change to limit ruby version\n" }, { "from": "human", "value": "# encoding: utf-8\n\nif ENV['COVERAGE'] || ENV['TRAVIS']\n require 'simplecov'\n require 'coveralls'\n\n SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([\n SimpleCov::Formatter::HT...
ruby
chosen
[ { "from": "system", "value": "Fix the content type issue\n" }, { "from": "human", "value": "module Rack\n module DevMark\n class Middleware\n include Rack::Utils\n include Rack::DevMark::Utils\n\n def initialize(app, themes = [:title, :github_fork_ribbon])\n @app = app\...
ruby
chosen
[ { "from": "system", "value": "Update gemspec to get bundle install working\n" }, { "from": "human", "value": "# encoding: UTF-8\nGem::Specification.new do |s|\n s.platform = Gem::Platform::RUBY\n s.name = 'spree_prize'\n s.version = '2.2.2'\n s.summary = 'Giveaways for Spre...
ruby
chosen
[ { "from": "system", "value": "Update version in podspec to 0.6.0\n" }, { "from": "human", "value": "# coding: utf-8\nPod::Spec.new do |s|\n url = \"https://github.com/kumabook/FeedlyKit\"\n source_url = \"#{url}.git\"\n s.name = \"FeedlyKit\"\...
ruby
chosen
[ { "from": "system", "value": "Use twilio demo app for twilio client\n" }, { "from": "human", "value": "require_dependency \"telephony/application_controller\"\n\nmodule Telephony\n class TwilioClientController < ApplicationController\n before_filter :validate_params, only: :token\n\n def ...
ruby
chosen
[ { "from": "system", "value": "Check for SSL a different way\n\nCheck for SSL by checking if in production, since this method needs to\nwork in testing environment as well.\n" }, { "from": "human", "value": "module Blog\n class Admin::ApplicationController < ActionController::Base\n layout \"...
ruby
chosen
[ { "from": "system", "value": "Add specs for creating questions\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe QuestionsController do\n fixtures :users\n\n context \"when I am not logged in\" do\n it \"should require an authenticated user\" do\n get :index \n ...
ruby
chosen
[ { "from": "system", "value": "Fix test to reflect actual database relations\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Genome::Groupers::InteractionGrouper do\n\n it 'should not group two distinct interaction claims' do\n (1..2).map do\n drug = Fabricate(:drug)...
ruby
chosen
[ { "from": "human", "value": "Add mailer previews for appointments\n" }, { "from": "gpt", "value": "class AppointmentsPreview < ActionMailer::Preview\n def customer\n Appointments.customer(\n FactoryGirl.create(:appointment),\n BookingLocations.find('ac7112c3-e3cf-45cd-a8ff-9ba827b8...
ruby
chosen
[ { "from": "system", "value": "Add categories api to deployment url.\n" }, { "from": "human", "value": "require 'rails_zero/drivers/poltergeist'\n\nRailsZero.configure do |c|\n c.backend.url = 'http://cocoa-tree-seeds.herokuapp.com' if Rails.env.production?\n c.deployment.git_remote_ref = 'gh-p...
ruby
chosen
[ { "from": "system", "value": "Package version is increase from 0.1.1 to 0.1.2\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'subst_attr'\n s.version = '0.1.1'\n s.summary = 'Declare attributes that have default implementations that are ...
ruby
chosen
[ { "from": "system", "value": "Revert line delete from previous commit and fix\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n\ts.name = 'tankulator'\n\ts.version = '0.0.1'\n\ts.default_executable = \"tankulator\"\n\ts.date = %q{2014-04-24}\n\ts.summary = 'Simple splitting of t...
ruby
chosen
[ { "from": "system", "value": "Make sure api client id is the right format when adding one\n" }, { "from": "human", "value": "module Brightbox\n desc 'Add new api client details to config'\n arg_name 'client-id secret [api_url, auth_url]'\n command [:client_add] do |c|\n\n c.desc \"api clie...
ruby
chosen
[ { "from": "human", "value": "Add tests for `Comable::Importable` module\n" }, { "from": "gpt", "value": "class DummyProduct\n include Comable::Importable\n\n comma do\n foo\n bar\n end\nend\n\ndescribe Comable::Importable do\n subject { DummyProduct }\n\n describe '.open_spreadsheet' ...
ruby
chosen
[ { "from": "human", "value": "Rename \"Macedonia\" to \"North Macedonia\"\n" }, { "from": "gpt", "value": "macedonia = WorldLocation.find_by(slug: \"macedonia\")\nif macedonia\n macedonia.update!(slug: \"north-macedonia\")\n macedonia.translation.update!(name: \"North Macedonia\")\nend\n" } ]
ruby
chosen
[ { "from": "system", "value": "Allow domain administrators to sign in\n" }, { "from": "human", "value": "require 'contexts/get_oauth_user'\nrequire 'contexts/get_google_apps_domain'\n\nclass DomainsController < ApplicationController\n\n # Endpoint for configuring a domain.\n #\n # GET /domains...
ruby
chosen
[ { "from": "system", "value": "Add recipes for registering components as systemd services.\n" }, { "from": "human", "value": "#\n# Cookbook Name:: dmon\n# Recipe:: default\n#\n# Copyright (c) 2016 Bogdan-Constantin Irimie, All Rights Reserved.\n\ninclude_recipe 'dmon::rabbitmq'\ninclude_recipe 'd...
ruby
chosen
[ { "from": "human", "value": "Add spec, model mixin module\n" }, { "from": "gpt", "value": "describe ActiveRecordSharding::Model do\n let!(:model) do\n Class.new(ActiveRecord::Base) do\n def self.name\n 'User'\n end\n\n def self.sequence_id\n @sequence_id ||= 0\n ...
ruby
chosen
[ { "from": "system", "value": "Add specs for sidebar item types\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe 'Course Modules', type: :controller do\n EXPECTED_SIDEBAR_ITEM = {\n title: 'DummyCourseModule',\n unread: -1\n }\n\n EXPECTED_SETTINGS_ITEM = {\n ...
ruby
chosen
[ { "from": "system", "value": "Fix order serializer spec: change from id to number\n" }, { "from": "human", "value": "#require 'spec_helper'\n\ndescribe Api::OrderSerializer do\n let(:serializer) { Api::OrderSerializer.new order }\n let(:order) { create(:completed_order_with_totals) }\n\n\n it...
ruby
chosen
[ { "from": "system", "value": "Remove dependency on Rubygems 1.3.6, this blocks Heroku deploy.\n" }, { "from": "human", "value": "require \"lib/friendly_id/version\"\n\nspec = Gem::Specification.new do |s|\n s.name = \"friendly_id\"\n s.rubyforge_project = \"friendly-id\"\n s.vers...
ruby
chosen
[ { "from": "system", "value": "Fix to migration to remove orcid_id and use name_identifier instead.\n" }, { "from": "human", "value": "class DropOrcidIdFromDcsCreators < ActiveRecord::Migration\n def change\n Creator.where(\"orcid_id IS NOT NULL\").each do |c|\n name_id = NameIdentifier....
ruby
chosen
[ { "from": "system", "value": "Make requires rely on load path being setup correctly\n" }, { "from": "human", "value": "require 'buildr'\nrequire File.expand_path(File.dirname(__FILE__) + '/buildr/ipojo/version')\nrequire File.expand_path(File.dirname(__FILE__) + '/buildr/ipojo/core')\nrequire Fi...
ruby
chosen
[ { "from": "system", "value": "Revert \"Change FFI::Library::LIBC call to FFI::Platform::LIBC\"\n\nThis reverts commit 3f33f94131a25a4ac47e7f487d48e421756d35a1.\n" }, { "from": "human", "value": "# encoding: utf-8\n\nmodule LibC\n extend FFI::Library\n # figures out the correct libc for each pl...
ruby
chosen
[ { "from": "system", "value": "Command: Refactor method stubs a bit.\n" }, { "from": "human", "value": "module MGit\n class Command\n @@commands = {}\n @@aliases = {}\n\n def self.execute(name, args)\n cmd = self.create(name)\n\n arity_min, arity_max = cmd.arity\n raise T...
ruby
chosen
[ { "from": "system", "value": "Add retry on exception to mattermost login\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule QA\n context 'Manage', :orchestrated, :mattermost do\n describe 'Mattermost login' do\n it 'user logs into Mattermost using GitLab OAuth' d...
ruby
chosen
[ { "from": "human", "value": "Add unit tests for openldap_database\n" }, { "from": "gpt", "value": "#!/usr/bin/env rspec\n\nrequire 'spec_helper'\n\ndescribe Puppet::Type.type(:openldap_database) do\n describe 'without parameters' do\n resource = Puppet::Type.type(:openldap_database).new :tit...
ruby
chosen
[ { "from": "system", "value": "Use picture_path in ATOM feed, for now.\n" }, { "from": "human", "value": "cache [@gallery, :feed] do\n atom_feed language: 'en-US' do |feed|\n feed.title @gallery.to_s + ' (IMGSHR)'\n feed.updated @gallery.last_update\n\n @feed_pictures.each do |picture|\...
ruby
chosen
[ { "from": "system", "value": "Add comments with context about new privacy enums" }, { "from": "human", "value": "module Concealable\n extend ActiveSupport::Concern\n\n included do\n enum privacy: {\n public: 0,\n private: 1,\n access_list: 2,\n full_accounts: 3,\n r...
ruby
chosen
[ { "from": "system", "value": "Use ActiveSupport::TestCase instead of ActiveModel\n\nThe unused ActiveModel::TestCase class was removed in Rails 5.1.0.beta1\n\nRef: ccfa785535d912c3529b0562d9f2e7a2dc4b7ed7@4f8d86c822b5ceebbd1616f3329fbdf40d3f8431" }, { "from": "human", "value": "require 'active_m...
ruby
chosen
[ { "from": "human", "value": "Add integration test for site layout\n" }, { "from": "gpt", "value": "require 'test_helper'\n\nclass SiteLayoutTest < ActionDispatch::IntegrationTest\n\n test \"layout links\" do\n get root_path\n assert_template \"static_pages/home\"\n # the question mark ...
ruby
chosen
[ { "from": "system", "value": "Add rake as a development dependency\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\n\nrequire 'cross_validation'\n\nGem::Specification.new do |gem|\n ...
ruby
chosen
[ { "from": "system", "value": "Change activerecord dependency to handle new flavors of rails 7\n" }, { "from": "human", "value": "$LOAD_PATH.push File.expand_path('../lib', __FILE__)\n\n# Maintain your gem's version:\nrequire 'pg_ltree/version'\n\n# Describe your gem and declare its dependencies:...
ruby
chosen
[ { "from": "system", "value": "Use non-dev version of msgpack gem\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path(\"../lib\", __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire \"neovim/version\"\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Rename variable lbs to firewall_policies\n" }, { "from": "human", "value": "module Brightbox\n desc 'List Firewall Policies'\n arg_name '[firewall-policy-id...]'\n command [:list] do |c|\n c.action do |global_options,options,args|\n\n if args.empty?\n ...
ruby
chosen
[ { "from": "system", "value": "Remove scope that shouldn't be there\n" }, { "from": "human", "value": "module KnowledgeBase::Concerns::Models::Category\n extend ActiveSupport::Concern\n\n included do\n extend FriendlyId\n\n publishable on: :published_at\n\n friendly_id :title, use: :sl...
ruby
chosen
[ { "from": "system", "value": "Remove setup from Test::Unit generator\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass <%= class_name %>DecoratorTest < ActiveSupport::TestCase\n def setup\n ApplicationController.new.view_context\n end\nend\n" }, { "from": "gpt", ...
ruby
chosen
[ { "from": "system", "value": "ENHANCE: Add unique validations for activity type\n" }, { "from": "human", "value": "class ActivityType < ActiveRecord::Base\n # Relationships\n has_many :unit_activity_sets\n\n before_destroy :can_destroy?\n\n validates :name, presence: true\n validate...
ruby
chosen
[ { "from": "system", "value": "Fix get_threadsafe_attribute method attributes count\n" }, { "from": "human", "value": "# Fix bug when trying to call #dup method on symbol value\nif Rails::VERSION::MAJOR <= 4\n module ThreadsafeAttributes\n private\n\n def get_threadsafe_attribute(name, mai...
ruby
chosen
[ { "from": "human", "value": "Add commit counter classifier, very bare bones\n" }, { "from": "gpt", "value": "class CommitCountClassifier\n include Frisky::Classifier\n\n commit :update_commit_count, if: lambda {|commit| commit.files_type('Ruby').any? }\n\n class << self\n def update_commit...
ruby
chosen
[ { "from": "system", "value": "Use USE_BINARY_GEOS instead of USE_BINARY_GEM.\n" }, { "from": "human", "value": "\nrequire 'rubygems'\nrequire 'test/unit'\n\nif ENV['USE_BINARY_GEM']\n require 'geos'\nelse\n require 'ffi-geos'\nend\n\nmodule TestHelper\n TOLERANCE = 0.0000000000001\n\n def se...
ruby
chosen
[ { "from": "system", "value": "Update vcr match requests on\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\nrequire 'frinkiac'\n\nrequire 'minitest/autorun'\nrequire 'webmock/minitest'\nrequire 'vcr'\n\nVCR.configure do |c|\n c.cassette_library_dir ...
ruby
chosen
[ { "from": "system", "value": "Prepare git repository by copying fixture files\n" }, { "from": "human", "value": "unless ENV['ANCHOR_TASK']\n require 'coveralls'\n Coveralls.wear!\nend\n\n$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\nrequire 'ttnt'\n\nrequire 'minitest/autorun'\n\...
ruby
chosen
[ { "from": "system", "value": "Test Helper\n - added assert_template_result_matches\n - fixed indentation / white spacing\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\nextras_path = File.join File.dirname(__FILE__), 'extra'\n$LOAD_PATH.unshift(extras_path) unless $LOAD_PATH.include? e...
ruby
chosen
[ { "from": "system", "value": "Bump yard dependency to ~> 0.8.5" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire File.expand_path('../lib/yardstick/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.name = 'yardstick'\n gem.version = Yardstick::VERSION.dup\n g...
ruby
chosen
[ { "from": "human", "value": "Add rspec tests for ceilometer::db::mysql\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe 'ceilometer::db::mysql' do\n\n let :pre_condition do\n 'include mysql::server'\n end\n\n let :params do\n { :password => 's3cr3t',\n :dbname ...
ruby
chosen
[ { "from": "system", "value": "Add command line tools for babushka recipe" }, { "from": "human", "value": "dep 'postgres.app' do\n source 'https://github.com/PostgresApp/PostgresApp/releases/download/9.4.1.0/Postgres-9.4.1.0.zip'\n\n provides 'Postgres.app'\nend\n" }, { "from": "gpt", ...
ruby
chosen
[ { "from": "human", "value": "Add inspec test for mongos\n" }, { "from": "gpt", "value": "# Mongos service\ndescribe service('mongos') do\n it { should be_installed }\n it { should be_enabled }\n it { should be_running }\nend\n\n# Mongos process\ndescribe port(27017) do\n it { should be_liste...
ruby
chosen
[ { "from": "system", "value": "Refactor base controller with new rspec syntax\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe BaseController, :type => :controller do\n let(:oc) { instance_double(OrderCycle, id: 1) }\n let(:order) { instance_double(Spree::Order) }\n cont...
ruby
chosen
[ { "from": "system", "value": "Check for a .git directory\n" }, { "from": "human", "value": "require 'fileutils'\n\npulled, skipped, failed = [], [], []\n\nroot = ARGF.argv[0]\n\nraise ArgumentError.new(\"Please pass a root directoy!\") if root.nil?\n\nDir.foreach(root) do |directory|\n if File....
ruby
chosen
[ { "from": "system", "value": "Add rake task to install hooks locally\n" }, { "from": "human", "value": "require 'rake/testtask'\n\nRake::TestTask.new do |t|\n t.test_files = FileList['**/*_test.rb']\n t.verbose = true\nend\n\ntask :default => [:test]\n" }, { "from": "gpt", "value":...
ruby
chosen
[ { "from": "system", "value": "Upgrade release version of civicpy package to upcoming second release candidate" }, { "from": "human", "value": "namespace :dependencies do\n desc 'Install python dependencies'\n task :python do\n on roles(:all) do\n execute \"sudo apt-get -y install pytho...
ruby
chosen
[ { "from": "system", "value": "Support all endpoint in Singleplatform::Client::Locations\n" }, { "from": "human", "value": "module Singleplatform\n class Client\n module Locations\n # Fetch information about a specific location\n #\n # @param id [String]\n # @param options...
ruby
chosen
[ { "from": "system", "value": "Fix Font Awesome asset problem\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\n# Version of your assets, change this if you want to expire all your assets.\nRails.application.config.assets.version = '1.0'\n\n# Add ad...
ruby
chosen