conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add thread ID to api logs\n" }, { "from": "human", "value": "module 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.strft...
ruby
chosen
[ { "from": "system", "value": "Fix config file option in CLI\n" }, { "from": "human", "value": "require 'thor'\nrequire 'apilint'\n\nmodule Apilint\n class CLI < Thor\n def self.exit_on_failure?\n true\n end\n\n desc \"check FILE\", \"Check FILE containing your API requests\"\n ...
ruby
chosen
[ { "from": "system", "value": "Add longer description to 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 'postino/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Fix deprecation warning on newer MultiJson versions\n" }, { "from": "human", "value": "require 'rubygems'\n\nif begin\n Gem::Specification::find_by_name('multi_json')\n rescue Gem::LoadError\n false\n rescue\n Gem.available?('multi_json')\n end\n require ...
ruby
chosen
[ { "from": "system", "value": "Update podspec to use CocoaLumberjack if it's available, and define the minimum deployment targets\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'MagicalRecord'\n s.version = '2.3.0'\n s.license = 'MIT'\n s.summary = 'Super Awesome Ea...
ruby
chosen
[ { "from": "system", "value": "Make sure the folder exists\n" }, { "from": "human", "value": "template \"/etc/sysctl.d/50-tuning.conf\" do\n source \"sysctltuning.erb\"\n owner \"root\"\n group \"root\"\n mode \"0644\"\nend\n\nexecute \"configure kernel parameters\" do\n user \"roo...
ruby
chosen
[ { "from": "system", "value": "Exclude data values for passed tests to trim test result storage size\n" }, { "from": "human", "value": "module Crucible\n module Tests\n class TestResult\n\n attr_accessor :key\n attr_accessor :id\n attr_accessor :description\n attr_accessor...
ruby
chosen
[ { "from": "system", "value": "Enable suggested changes for phenotypes on assertions\n" }, { "from": "human", "value": "class AssertionModerationsController < ModerationsController\n private\n def moderated_object\n Assertion.view_scope.find_by!(id: params[:assertion_id])\n end\n\n def mod...
ruby
chosen
[ { "from": "system", "value": "Improve and fix search helper\n" }, { "from": "human", "value": "module Refinery\n module Elasticsearch\n module SearchHelper\n def result_type(result)\n result.klass.name\n end\n\n def result_icon(result)\n icon = case result.klass....
ruby
chosen
[ { "from": "system", "value": "Remove unneeded ancestors check in Enum.\n\nThis is in the Enum#initialize method, how could this test ever be false?\n\nIn other words, how could any instance that doesn't inherit from Property::Enum execute the Property::Enum#initialize method?\n" }, { "from": "human"...
ruby
chosen
[ { "from": "system", "value": "[Haml] Convert Haml::Template docs to YARD.\n" }, { "from": "human", "value": "require 'haml/engine'\n\nmodule Haml\n module Template\n extend self\n\n @options = {}\n attr_accessor :options\n end\nend\n\n# Decide how we want to load Haml into Rails.\n# P...
ruby
chosen
[ { "from": "system", "value": "Add support to THREADS and GARBAGE on threads_on_fork worker task\n" }, { "from": "human", "value": "# require 'backburner/tasks'\n# will give you the backburner tasks\n\nnamespace :backburner do\n # QUEUE=foo,bar,baz rake backburner:work\n desc \"Start backburner...
ruby
chosen
[ { "from": "system", "value": "Use method_defined? instead of respond_to? since we're in the class, not the instance\n" }, { "from": "human", "value": "require 'logger'\n\nmodule XML\n module Mapping\n module ClassMethods\n def maybe_alias(new_name, old_name)\n return alias_method...
ruby
chosen
[ { "from": "system", "value": "Remove Appointments N+1 for Booking Requests\n\nAppointments need booking requests at all times. This removes the N+1\nquerying on the appointments list and other areas.\n" }, { "from": "human", "value": "# frozen_string_literal: true\nclass User < ActiveRecord::Bas...
ruby
chosen
[ { "from": "system", "value": "Remove the duplicate homepage gemspec config\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path(\"../lib\", __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.in...
ruby
chosen
[ { "from": "system", "value": "Fix a bug on loading locales\n" }, { "from": "human", "value": "I18n.load_path << Dir[File.join(File.dirname(__FILE__), '..', '..', 'locales', '*.{rb,yml}')]\nI18n.default_locale = :fr\n" }, { "from": "gpt", "value": "I18n.load_path += Dir[File.join(File...
ruby
chosen
[ { "from": "system", "value": "Make sure we log everything at once.\n" }, { "from": "human", "value": "module God\n \n class SimpleLogger\n DEBUG = 2\n INFO = 4\n WARN = 8\n ERROR = 16\n FATAL = 32\n \n SEV_LABEL = {DEBUG => 'DEBUG',\n INFO => 'INFO',\n ...
ruby
chosen
[ { "from": "system", "value": "Return a full object in X-Houser-Object\n" }, { "from": "human", "value": "require 'rack'\n\nmodule Houser\n class Middleware\n def initialize(app, options={})\n @options = options\n @options[:class_name] = Object.const_get(@options[:class_name])\n ...
ruby
chosen
[ { "from": "system", "value": "Update gemspec for Lita 3.0 compatibility.\n" }, { "from": "human", "value": "Gem::Specification.new do |spec|\n spec.name = \"lita-memegen\"\n spec.version = \"1.0.3\"\n spec.authors = [\"Mitch Dempsey\"]\n spec.email = [\"mitch@mit...
ruby
chosen
[ { "from": "system", "value": "Add omniauth-oauth2 as a dependency" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'omniauth-spotify/version'\n\nGem::Specification.new do |gem|...
ruby
chosen
[ { "from": "human", "value": "Add specs for unused services\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\n# daemons\n%w(\n auditd\n lvm2-monitor\n postfix\n rpcbind\n rpcgssd\n).each do |name|\n describe service(name) do\n it { should_not be_enabled }\n it { should_not be_...
ruby
chosen
[ { "from": "system", "value": "Fix a syntax error in the phantomjs cookbook.\n" }, { "from": "human", "value": "version = \"1.9.7\"\narch = kernel['machine'] =~ /x86_64/ ? \"x86_64\" : \"i686\"\n\ndefault[:phantomjs] = {\n :version => version,\n :arch => arch,\n :tarball => {\n :url =...
ruby
chosen
[ { "from": "system", "value": "Discard feed filename from URI when prepending\n\nFixes a7cd0f5e\n" }, { "from": "human", "value": "module Feed2Email\n class Entry\n attr_reader :feed\n\n def self.process(data, feed)\n Entry.new(data, feed).process\n end\n\n def initialize(data, ...
ruby
chosen
[ { "from": "system", "value": "Use the same regex that the mongodb provider does when correcting for ObjectID values in the isMaster response.\n" }, { "from": "human", "value": "require 'json';\n\nFacter.add('mongodb_is_master') do\n setcode do\n if Facter::Core::Execution.which('mongo') \n ...
ruby
chosen
[ { "from": "system", "value": "Use regex for fluentd:source-journald json checks\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'fluentd:source-journald' do\n\n describe service('fluentd') do\n it { should be_running }\n end\n\n describe file('/var/lib/fluentd/journald...
ruby
chosen
[ { "from": "system", "value": "Remove unused methods from PublicUploadsController\n\nThese methods are never called and can be removed.\n" }, { "from": "human", "value": "class PublicUploadsController < ApplicationController\n include ActionView::Helpers::AssetTagHelper\n\n def show\n asset_...
ruby
chosen
[ { "from": "human", "value": "Add sidebar to product page.\n" }, { "from": "gpt", "value": "module Spree\n ProductController.class_eval do\n\n def show\n @variants = @product.variants_including.active(current_currency).includes([:option_values, :images])\n @product_properties = @pro...
ruby
chosen
[ { "from": "system", "value": "Add additional attributes to user serializer\n" }, { "from": "human", "value": "class UserAnalyticsSerializer < ActiveModel::Serializer\n attributes :created_at, :email, :location, :customer_id, :last_sign_in_at, :facebook_uid\n\n attributes :comments\n attribute...
ruby
chosen
[ { "from": "system", "value": "Remove garbage code from before refactoring\n" }, { "from": "human", "value": "require 'time'\nmodule Units\n Second = 1\n Minute = Second * 60\n Hour = Minute * 60\n Day = Hour * 24\n Week = Day * 7\n Month = Week *...
ruby
chosen
[ { "from": "human", "value": "Add cask for SQLite Database Browser\n\nCask installation for SQLite Database Browser\nsqlitebrowser.sourceforge.net/\n" }, { "from": "gpt", "value": "class SqliteBrowser < Cask\n url 'http://downloads.sourceforge.net/sourceforge/sqlitebrowser/sqlitebrowser_200_b1_o...
ruby
chosen
[ { "from": "system", "value": "Change mas-templating into a dev dependency\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"mortgage_calculator/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specif...
ruby
chosen
[ { "from": "system", "value": "Add exceptions for primary class\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule RubyRabbitmqJanus\n # Define all error in gem\n module Errors\n # @author VAILLANT Jeremy <jeremy.vaillant@dazzl.tv>\n # Define errors to gems\n cl...
ruby
chosen
[ { "from": "system", "value": "Revert \"Initialize the routes a bit earlier (after_initialize => to_prepare)\"\n\nThis reverts commit 1b0341844bc28293e658e8dfe11ebd6ea1ce4648.\n\nreason: this sometimes causes \"Invalid route name, already in use: 'erd'\"\n" }, { "from": "human", "value": "requi...
ruby
chosen
[ { "from": "system", "value": "Tag cloud does not need an add_tag method as it extends the DSL\n" }, { "from": "human", "value": "module Sodium\n class TagCloud < Node\n attr_accessor :tags\n\n def initialize\n tags = {}\n end\n\n def add_tag\n tag\n end\n end\nend" }...
ruby
chosen
[ { "from": "system", "value": "Simplify block pass-through at module level\n" }, { "from": "human", "value": "require 'hammerspace/version'\nrequire 'hammerspace/backend'\nrequire 'hammerspace/hash'\n\nmodule Hammerspace\n\n def self.new(path, options={})\n if block_given?\n Hash.new(pat...
ruby
chosen
[ { "from": "system", "value": "Revert Transaction for a bit" }, { "from": "human", "value": "\nmodule Rippler\n class Transaction\n def initialize data # data hash\n @data = data\n end\n\n def name account\n Rippler::Addresses[account] || account\n end\n\n def amount mon...
ruby
chosen
[ { "from": "system", "value": "Revert \"Default value for default\"\n\nThis reverts commit 6cbe9da329e996bda09c9f39bffeb479a6bb60a8.\n" }, { "from": "human", "value": "require 'util/namespace'\nrequire 'util/log'\n\nclass Util::ConfigFile\n include Util::Log\n def initialize(filename)\n @fil...
ruby
chosen
[ { "from": "system", "value": "Remove requires in delayed jobs raketask.\n" }, { "from": "human", "value": "require 'delayed_job'\nrequire 'delayed_job_mongo_mapper'\n\nnamespace :jobs do\n desc \"Spawn a temporary worker for 2 minutes.\"\n task :work do\n require_relative '../rstatus.rb'\n\...
ruby
chosen
[ { "from": "system", "value": "Rename force_unlock to deploy:force_unlock. Document deploy:force_unlock.\n" }, { "from": "human", "value": "task :force_unlock do\n queue %{echo \"-----> Unlocking\"}\n queue %{rm -f \"#{deploy_to}/deploy.lock\"}\n queue %{exit 234}\n run!\nend\n\nnamespace :de...
ruby
chosen
[ { "from": "system", "value": "Load README.md a better way\n" }, { "from": "human", "value": "require 'github/markup'\n\nclass Johnhenry::HomeController < Johnhenry::ApplicationController\n before_filter :set_home_meta_tags\n\n def welcome\n title = 'New to Ruby on Rails? Launch a site like ...
ruby
chosen
[ { "from": "system", "value": "Add the last_updated attribute to couch\n" }, { "from": "human", "value": "module Kindle\n class Book\n include Enumerable\n \n attr_accessor :title\n attr_accessor :raw_notes\n attr_accessor :author\n \n def to_s\n \"<Kindle::Book title=#...
ruby
chosen
[ { "from": "system", "value": "Order products by date reversed\n" }, { "from": "human", "value": "module Spree\n class ProductsController < Spree::StoreController\n before_filter :load_product, :only => :show\n rescue_from ActiveRecord::RecordNotFound, :with => :render_404\n helper 'spr...
ruby
chosen
[ { "from": "system", "value": "Refactor for more readable and simple code\n" }, { "from": "human", "value": "require \"nyanko/unit/scope_finder\"\n\nmodule Nyanko\n module Unit\n extend ActiveSupport::Concern\n\n module ClassMethods\n attr_accessor :current_scope\n\n delegate :ac...
ruby
chosen
[ { "from": "system", "value": "Change code smell message level to :info\n" }, { "from": "human", "value": "require 'pronto'\nrequire 'reek'\n\nmodule Pronto\n class Reek < Runner\n def run\n files = ruby_patches.map(&:new_file_full_path)\n\n smells = files.flat_map do |file|\n ...
ruby
chosen
[ { "from": "system", "value": "Remove the frontend files from the linked dirs\n" }, { "from": "human", "value": "# Set some Capistrano defaults\nset :linked_files, []\nset :linked_files, %w(app/config/parameters.yml)\nset :linked_dirs, []\nset :linked_dirs, %w(app/logs app/sessions src/Frontend/...
ruby
chosen
[ { "from": "system", "value": "Add is_lead_investor to Investment model\n" }, { "from": "human", "value": "# encoding: utf-8\n\nmodule Crunchbase::Model\n class Investment < Crunchbase::Model::Entity\n \n RESOURCE_LIST = 'investments'\n\n attr_reader :money_invested, :money_invested_cur...
ruby
chosen
[ { "from": "system", "value": "Update gemspec to require bundler version used by Travis\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'packetgen/version'\n\nGem::Specification.new do...
ruby
chosen
[ { "from": "system", "value": "Revert \"Added failing test for loose files being compiled separately\"\n\nThis reverts commit 660ea3b58857cc43cb26d0ecdd9787880868d24f.\n" }, { "from": "human", "value": "require 'test_helper'\nrequire 'action_controller'\n\nclass ControllersTest < ActionController...
ruby
chosen
[ { "from": "system", "value": "Put requiring others strategies on top of the auto discover class.\n\n* Need to improve this. May create some autoload/require bugs from subclasses." }, { "from": "human", "value": "module InfinityTest\n module Strategy\n class AutoDiscover < Base\n # Find ...
ruby
chosen
[ { "from": "system", "value": "Add headers for no robots. Add logger helper.\n" }, { "from": "human", "value": "# coding: utf-8\nrequire 'chaindrive/api/v1'\n\nmodule Chaindrive\n class API < Grape::API\n default_format :json\n format :json\n\n # Define any helper methods that we want t...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.2.1 to 0.2.2\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'event_store-messaging'\n s.summary = 'Messaging primitives for EventStore using the EventStore Client HTTP libr...
ruby
chosen
[ { "from": "system", "value": "Add Elliot Winkler to authors" }, { "from": "human", "value": "$LOAD_PATH << File.join(File.dirname(__FILE__), 'lib')\nrequire 'shoulda/matchers/version'\n\nGem::Specification.new do |s|\n s.name = \"shoulda-matchers\"\n s.version = Shoulda::Matchers::V...
ruby
chosen
[ { "from": "system", "value": "Update LLVM formula to 2.6\n" }, { "from": "human", "value": "require 'formula'\n\nclass Llvm <Formula\n @url='http://llvm.org/releases/2.5/llvm-2.5.tar.gz'\n @homepage='http://llvm.org/'\n @md5='55df2ea8665c8094ad2ef85187b9fc74'\n\n def install\n ENV.gcc_4_2...
ruby
chosen
[ { "from": "system", "value": "Fix date coersions when using Rails 4 'date' input type.\n" }, { "from": "human", "value": "module Islay\n module Coercion\n def coerce_string(v)\n v.to_s\n end\n\n # Coerces the input into a SpookAndPuff::Money instance\n #\n # @param [String, ...
ruby
chosen
[ { "from": "system", "value": "Use to_s when sorting array elements\n\n[#116178177](https://www.pivotaltracker.com/story/show/116178177)\n" }, { "from": "human", "value": "require 'json'\n\nclass Hash\n def sort_recursive(&block)\n self.keys.sort(&block).reduce({}) do |seed, key|\n seed[...
ruby
chosen
[ { "from": "system", "value": "Hide socket related functionality in MessageBroker\n" }, { "from": "human", "value": "require 'socket'\nrequire 'uri'\nrequire 'dispatcher'\nrequire 'message_queue'\n\nclass MessageBroker\n def initialize(event_port: 9090, client_port: 9099)\n @event_socket = TC...
ruby
chosen
[ { "from": "system", "value": "Enable subtasks for Redmine 0.9.4.devel\n" }, { "from": "human", "value": "require 'redmine_charts/line_data_converter'\nrequire 'redmine_charts/pie_data_converter'\nrequire 'redmine_charts/stack_data_converter'\nrequire 'redmine_charts/utils'\nrequire 'redmine_char...
ruby
chosen
[ { "from": "system", "value": "Fix Info message should execute result only\n" }, { "from": "human", "value": "require 'rundock'\nrequire 'open-uri'\n\nmodule Rundock\n class Runner\n ScenarioNotFoundError = Class.new(StandardError)\n\n class << self\n def run(options)\n Logger....
ruby
chosen
[ { "from": "system", "value": "Return 1 if build fails\n" }, { "from": "human", "value": "module Slinky\n class Builder\n def self.build options, config\n dir = options[:src_dir] || config.src_dir\n build_dir = options[:build_dir] || config.build_dir\n manifest = Manifest.new(d...
ruby
chosen
[ { "from": "system", "value": "Read token appropriately when sent through headers\n" }, { "from": "human", "value": "module Tok\n module Controller \n extend ActiveSupport::Concern\n\n helpers = %w(authenticate! current_user model model_name model_class)\n\n included do\n helper_me...
ruby
chosen
[ { "from": "human", "value": "Add a basic Winnow::Matcher that passes specs.\n" }, { "from": "gpt", "value": "module Winnow\n class Matcher\n class << self\n def find_matches(fingerprints_a, fingerprints_b)\n values_a = value_to_fprint_map(fingerprints_a)\n values_b = value...
ruby
chosen
[ { "from": "human", "value": "Update existing blog permalinks to be all lowercase.\n" }, { "from": "gpt", "value": "class UpdateBlogPermalinks < ActiveRecord::Migration\n def up\n Spree::Blog.all.each do |f|\n f.update_attribute :permalink, f.permalink.downcase\n end\n end\n\n def d...
ruby
chosen
[ { "from": "system", "value": "Fix data column migration for Rails 6.1\n" }, { "from": "human", "value": "class AddDataToPayModels < ActiveRecord::Migration[4.2]\n def change\n add_column :pay_subscriptions, :data, data_column_type\n add_column :pay_charges, :data, data_column_type\n end\...
ruby
chosen
[ { "from": "system", "value": "Add necessary branch to spec\n\nPlaceholder spec was missing an 'it {does}' block\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'placeholder' do\n expect(true).to be_truthy\nend\n" }, { "from": "gpt", "value": "require 'spec_helpe...
ruby
chosen
[ { "from": "system", "value": "Use SPHINX_BIN if it exists for the bin_path.\n" }, { "from": "human", "value": "class SphinxController\n def initialize\n config.searchd.mysql41 = 9307\n end\n\n def setup\n FileUtils.mkdir_p config.indices_location\n config.render_to_file && index\n\n ...
ruby
chosen
[ { "from": "system", "value": "Fix the storable config spec.\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe Concerns::Storable::Config do\n let(:klass) { described_class }\n let(:config) { Concerns::Storable::Config.new }\n\n describe '#fields' do\n it :default do\n ...
ruby
chosen
[ { "from": "system", "value": "Add pending integration test for creating posts\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe \"integration tests\" do\n before(:all) do\n @server = start_wordpress_server\n end\n\n before do\n WebMock.allow_net_connect!\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Set the downloaded image as wallpaper\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\nrequire './downloader.rb'\n\ndl = Downloader.new\ndl.get_top_link\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\n\nrequire './downloader.rb'\n\ndl = Do...
ruby
chosen
[ { "from": "human", "value": "Update alternative URL for MoD Unpublishing\n\nAs per https://govuk.zendesk.com/agent/tickets/1177951 and\nhttps://trello.com/c/rclet4lw/168-november-redirect-requests\n" }, { "from": "gpt", "value": "Unpublishing.find_by(edition_id: 536210).\n update_attribute(:alt...
ruby
chosen
[ { "from": "system", "value": "Add flash messages to indicate successful actions\n" }, { "from": "human", "value": "class RequestsController < ApplicationController\n before_action :require_login\n\n def index\n @requests = Request.all\n end\n\n def new\n @request = Request.new\n end\n...
ruby
chosen
[ { "from": "system", "value": "chore(Session): Delete Session when logged out\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n before_action :check_logged_in, except: [:show, :destroy]\n before_action :check_logged_out, only: [:show, :destroy]\n\n def ...
ruby
chosen
[ { "from": "human", "value": "Add favorite serializer for ember data (id:name)" }, { "from": "gpt", "value": "class FavoriteSerializer < ActiveModel::Serializer\n embed :ids, include: true\n\n attributes :id,\n :user_id,\n :item_id,\n :item_type,\n ...
ruby
chosen
[ { "from": "system", "value": "Use the unnamed resource. Worth testing\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "#\n# Cookbook:: webapp\n# Recipe:: default\n#\n# Copyright:: 2014-2017, Chef Software, Inc.\n#\n\nhostname \"che...
ruby
chosen
[ { "from": "system", "value": "Switch to pdftoppm PDF preview maker\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Paperclip\n class CustomFilePreview < Processor\n def make\n libreoffice_path = ENV['LIBREOFFICE_PATH'] || 'soffice'\n directory = File.dirn...
ruby
chosen
[ { "from": "system", "value": "Fix Spec Syntax for AppManager\n\nUpdate the AppManager spec to ensure that it reads well.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe ManageEngine::AppManager do\n subject { ManageEngine::AppManager }\n\n it \"can create a new instance\" ...
ruby
chosen
[ { "from": "system", "value": "Make transaction look for customer by customer_id.\n" }, { "from": "human", "value": "class Payment::BraintreeTransaction < ActiveRecord::Base\n belongs_to :page\n belongs_to :payment_method, class_name: 'Payment::BraintreePaymentMethod'\n belongs_to :customer, ...
ruby
chosen
[ { "from": "system", "value": "Remove check for user and permission in PO payment authorization\n" }, { "from": "human", "value": "module Spree\n class PurchaseOrderPayments < PaymentMethod\n def payment_source_class\n PurchaseOrderCheckout\n end\n\n def authorize(amount, source, g...
ruby
chosen
[ { "from": "system", "value": "Scale up StudentSupportProgramImage to 275\n" }, { "from": "human", "value": "class StudentSupportProgramImage < ActiveRecord::Base\n \n belongs_to :student_support_program\n\n has_attached_file :image, styles: { medium: '640', thumb: \"250\" }\n validates_attac...
ruby
chosen
[ { "from": "human", "value": "Add specs for hash convinience methods.\n" }, { "from": "gpt", "value": "require 'spec_helper'\ninclude Rosemary\n\ndescribe Hash do\n\n let(:symbolized_hash) { Hash.new(a: :b) }\n let(:stringified_hash) { Hash.new(\"a\" => :b) }\n let(:mixed_hash) { ...
ruby
chosen
[ { "from": "system", "value": "Install ruby for running cookbook tests.\n" }, { "from": "human", "value": "#\n# Cookbook Name:: cooking-with-jenkins\n# Recipe:: default\n#\n# Copyright (C) 2013 Zachary Stevens\n# \n# All rights reserved - Do Not Redistribute\n#\n\n# Install jenkins\ninclude_recip...
ruby
chosen
[ { "from": "system", "value": "Remove ancestry from dev gems(2)\n" }, { "from": "human", "value": "$:.push File.expand_path('../lib', __FILE__)\n\n# Maintain your gem's version:\nrequire 'seo_cms/version'\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |s|\n s.nam...
ruby
chosen
[ { "from": "system", "value": "[BMCDOT-826] Implement assigning attributes from file name in structure documents form.\n" }, { "from": "human", "value": "module TaggableDocument\n extend ActiveSupport::Concern\n\n included do\n belongs_to :document_tag\n singleton_class.prepend ClassOverr...
ruby
chosen
[ { "from": "human", "value": "Add fake slack event service\n" }, { "from": "gpt", "value": "class FakeSlackEventService\n def initialize(team, user_id, channel_id = nil, type = 'message', message = nil)\n @team = team\n @team_id = team.team_id\n @bot_access_token = team.bot_access_token...
ruby
chosen
[ { "from": "system", "value": "Add missing parenthesis in Dir.glob statement\n" }, { "from": "human", "value": "Dir.glob(File.join(File.dirname(__FILE__),\r\n 'validates_constancy',\r\n '*.rb') do |filename|\r\n require filename\r\nend\r\n\r\nActiveRecord::Base.class_eval { inclu...
ruby
chosen
[ { "from": "human", "value": "Add empty test outling plan for traffic-light testing\n" }, { "from": "gpt", "value": "require_relative 'test_base'\n\nclass TrafficLightTest < TestBase\n\n def self.hex_prefix\n '7B7'\n end\n\n # - - - - - - - - - - - - - - - - -\n\n test '9DA', %w( start-poi...
ruby
chosen
[ { "from": "system", "value": "Fix outdated 'Admin area' link label in GitLab QA\n\n[ci skip]\n" }, { "from": "human", "value": "module QA\n module Page\n module Main\n class Menu < Page::Base\n def go_to_groups\n within_global_menu { click_link 'Groups' }\n end\n\...
ruby
chosen
[ { "from": "system", "value": "Revert \"Avoid loading `ActionController::API` constant\"\n" }, { "from": "human", "value": "module Rabl\n class Railtie < Rails::Railtie\n initializer \"rabl.initialize\" do |app|\n # Force Rails to load view templates even in API mode\n # Stolen sham...
ruby
chosen
[ { "from": "system", "value": "Allow ActiveRecord adapter to actually function" }, { "from": "human", "value": "if defined?(ActiveRecord::Base)\n module AttrEncryptor\n module Adapters\n module ActiveRecord\n def self.extended(base) # :nodoc:\n base.class_eval do\n ...
ruby
chosen
[ { "from": "system", "value": "Use wildcard for Elasticsearch indexes\n" }, { "from": "human", "value": "module Blazer\n module Adapters\n class ElasticsearchAdapter < BaseAdapter\n def run_statement(statement, comment)\n columns = []\n rows = []\n error = nil\n\n ...
ruby
chosen
[ { "from": "system", "value": "Fix updating with new paranoid Northstar\n" }, { "from": "human", "value": "class Fastly\n class BelongsToServiceAndVersion < Base\n # Return the Service object this belongs to\n def service\n @service ||= fetcher.get(Fastly::Service, service_id)\n en...
ruby
chosen
[ { "from": "system", "value": "Make sure that rating value is a String\n" }, { "from": "human", "value": "# frozen_string_literal: true\nrequire 'json'\nmodule RubyCritic\n module Turbulence\n def self.data(analysed_modules)\n analysed_modules.map do |analysed_module|\n {\n ...
ruby
chosen
[ { "from": "system", "value": "Make sure pkgutil command always gets returned\n" }, { "from": "human", "value": "class Specinfra::Command::Darwin::Base::Package < Specinfra::Command::Base::Package\n class << self\n def check_is_installed(package, version=nil)\n escaped_package = escape(p...
ruby
chosen
[ { "from": "system", "value": "Correct template reference of EFS\n" }, { "from": "human", "value": "module Terraforming\n module Resource\n class EFSFileSystem\n include Terraforming::Util\n\n def self.tf(client: Aws::EFS::Client.new)\n self.new(client).tf\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Update gemspec path for new github org\n\nWhy?\n`spartansystems` is no more, so the old link will eventually\nbecome stale.\n\nWhat's changed:\n**Refactor gemspec**\n Email and homepage updated.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_...
ruby
chosen
[ { "from": "system", "value": "Add test file for challenge 4.6\n" }, { "from": "human", "value": "require_relative \"my_solution\"\n\ndescribe 'largest_integer' do\n it \"returns nil when the array is empty ([])\" do\n expect(largest_integer([])).to be_nil\n end\n\n it \"returns 0 when that...
ruby
chosen
[ { "from": "system", "value": "Add default_scope ordering Account by code.\n" }, { "from": "human", "value": "class Account < ActiveRecord::Base\n belongs_to :client\n belongs_to :account_type\n \n has_many :credit_bookings, :class_name => \"Booking\", :foreign_key => \"credit_account_id\"\n ...
ruby
chosen
[ { "from": "system", "value": "Add Cucumber and Aruba for testing.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'rock_candy/version'\n\nGem::Specification.new do |spec|\n spec.name...
ruby
chosen
[ { "from": "system", "value": "Add Homepage URL to gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'invalid_utf8_rejector/version'\n\nGem::Specification.new do |spec|...
ruby
chosen
[ { "from": "system", "value": "Update download URL to 2.11.4\n" }, { "from": "human", "value": "default['gerrit']['version'] = \"2.9.4\"\ndefault['gerrit']['war']['download_url'] = \"http://gerrit-releases.storage.googleapis.com/gerrit-2.9.4.war\"\n\ndefault['git']['hostname'] = \"dev.git.typo3.o...
ruby
chosen
[ { "from": "system", "value": "Add Addressable as a dependency to take care of special characters in endpoints\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'battlenet/api/version'\n...
ruby
chosen