conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add :public => true option when creating sitemap.\n" }, { "from": "human", "value": "require 'fog'\n\nmodule SitemapGenerator\n class S3Adapter\n\n # Call with a SitemapLocation and string data\n def write(location, raw_data)\n SitemapGenerator::FileAdap...
ruby
chosen
[ { "from": "system", "value": "Update the dependency of HttpClient to version 2.5.3.3\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\n\nrequire 'authy/version'\n\nGem::Specification.new do |s|\n s.name = \"authy\"\n s.version ...
ruby
chosen
[ { "from": "system", "value": "Fix AssociationLoader Rails 7 Deprecation Warning\n\nCurrently running this example code with rails 7 yields the following warning:\r\n\r\n```\r\nDEPRECATION WARNING: `preload` is deprecated and will be removed in Rails 7.0. Call `Preloader.new(kwargs).call` instead.\r\n```\r\n...
ruby
chosen
[ { "from": "system", "value": "Add links to each volunteer in volunteer table.\n" }, { "from": "human", "value": "class UsersController < ApplicationController\n\n def index\n # @users = User.all\n @users_grid = UsersGrid.new(params[:users_grid]) do |scope|\n scope.page(params[:page])...
ruby
chosen
[ { "from": "system", "value": "Make migration a bit easier to read\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass MoveAllCalculatorsOutsideTheSpreeNamespace < ActiveRecord::Migration\n def up\n convert_calculator(\"Spree::Calculator::DefaultTax\", \"Calculator::Defa...
ruby
chosen
[ { "from": "system", "value": "Update bundler dependency to be more permissive\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path('../lib', __FILE__)\nrequire 'redis-rack-cache/version'\n\nGem::Specification.new do |s|\n s.name = 'redis-rack-cache'\n s...
ruby
chosen
[ { "from": "system", "value": "Switch from user_error! to test_failure!\n" }, { "from": "human", "value": "module Fastlane\n module Actions\n class TrainerAction < Action\n def self.run(params)\n require \"trainer\"\n\n params[:path] = Actions.lane_context[Actions::SharedVa...
ruby
chosen
[ { "from": "system", "value": "Prepend view paths to make our override the Rails default\n" }, { "from": "human", "value": "require \"godmin/helpers/application\"\nrequire \"godmin/helpers/forms\"\nrequire \"godmin/helpers/translations\"\n\nmodule Godmin\n module Application\n extend ActiveSu...
ruby
chosen
[ { "from": "system", "value": "Add test to cover legacy style of >1 incrementation\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass LibratoRailsCounterCacheTest < MiniTest::Unit::TestCase\n \n def test_basic_operations\n cc = Librato::Rails::CounterCache.new\n cc.incremen...
ruby
chosen
[ { "from": "system", "value": "Make url_for helper object aware" }, { "from": "human", "value": "module Niles\n module Helpers\n module Html\n def html_tag(name, options = nil, escape = true, &block)\n \"<#{name} #{html_tag_attributes(options, escape) if options}#{block_given? ? \...
ruby
chosen
[ { "from": "system", "value": "Install bundler only when needed in order to speed up the build\n" }, { "from": "human", "value": "copy_static_file 'Gemfile'\n\nin_root do\n gsub_file 'Gemfile', /RAILS_VERSION/, ::Pah::RAILS_VERSION\n\n # Since the gemset is likely empty, manually install bundle...
ruby
chosen
[ { "from": "human", "value": "Create PhoneNumberClient class with phone_number method.\n" }, { "from": "gpt", "value": "require 'httparty'\n\nmodule PhoneNumberClient\n include HTTParty\n\n base_uri 'http://phonenumber.herokuapp.com'\n\n def self.phone_number number, country_code\n get('/',...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary require in Level\n" }, { "from": "human", "value": "require 'rubiks/nodes/annotated_node'\nrequire 'rubiks/nodes/hierarchy'\n\nmodule ::Rubiks\n\n class Level < ::Rubiks::AnnotatedNode\n def self.new_from_hash(hash={})\n new_instance = ne...
ruby
chosen
[ { "from": "system", "value": "Set session cookie secret (for real this time)\n" }, { "from": "human", "value": "module Schnitzelpress\n class App < Sinatra::Base\n set :views, Schnitzelpress.root.join('lib').join('views')\n\n use Rack::Session::Cookie\n set :session_secret, Random.rand...
ruby
chosen
[ { "from": "system", "value": "Remove the to_h method, add the inspect method.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule UsesThis\n # A class that models a single interview.\n class Interview < Dimples::Post\n attr_accessor :hardware\n attr_accessor :softw...
ruby
chosen
[ { "from": "system", "value": "Add the Payment serialiser to the Serialiser autoloaded-modules\n" }, { "from": "human", "value": "module Xeroid\n module Serialisers\n autoload :Invoice, 'xeroid/serialisers/invoice'\n end\nend\n" }, { "from": "gpt", "value": "module Xeroid\n modu...
ruby
chosen
[ { "from": "system", "value": "Remove html_safe from DownloadButton class\n" }, { "from": "human", "value": "class DownloadButton < LinkButton\n include ActionView::Helpers\n \n def initialize(path)\n client = Aws::S3::Client.new(region: \"us-east-2\")\n s3 = Aws::S3::Resource.new(client...
ruby
chosen
[ { "from": "system", "value": "Determine the role of the currently editing user\n" }, { "from": "human", "value": "class ApplicationForm\n include ActiveModel::Validations\n include ActiveModel::Conversion\n include ActiveModel::Serialization\n\n extend ActiveModel::Naming\n\n delegate :appl...
ruby
chosen
[ { "from": "system", "value": "Send application activity for channel creation as well as deletion.\n" }, { "from": "human", "value": "class ChannelObserver < ActiveRecord::Observer\n def after_destroy(channel)\n broadcast_data = {\n :event => \"channel#delete\",\n :entity => channe...
ruby
chosen
[ { "from": "human", "value": "Add the function for announcing PRs.\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\nrequire 'httparty'\n\n@config = YAML.load_file('settings.yml')\n\ngithub_headers = {\n 'User-Agent' => @config['github']['username'],\n 'Accept' => 'application/vnd.github.bl...
ruby
chosen
[ { "from": "system", "value": "Add assertions into the InstantiateAndSaveAnnotationsCollectionTest\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass InstantiateAndSaveAnnotationsCollectionTest < ActiveSupport::TestCase\n setup do\n @project = projects(:one)\n end\n\n test \"...
ruby
chosen
[ { "from": "system", "value": "Use stale checking for page files\n" }, { "from": "human", "value": "module PagesCore\n module Frontend\n class PageFilesController < ::FrontendController\n before_action :find_page_file, only: %i[show]\n\n def show\n unless modified?(@page_file...
ruby
chosen
[ { "from": "system", "value": "Remove setting supplier which is done by marketplace now.\n" }, { "from": "human", "value": "Spree::Admin::ProductsController.class_eval do\n\n before_filter :get_suppliers, only: [:edit, :update]\n before_filter :supplier_collection, only: [:index]\n create.afte...
ruby
chosen
[ { "from": "human", "value": "Add example vagrantfile override for TestKitchen\n" }, { "from": "gpt", "value": "# -*- mode: ruby -*-\n# # vi: set ft=ruby :\n#\n# This file can be used to modify the behavior of a vagrant box deployed by\n# TestKitchen.Save in 'vagrantfiles/veos.rb' and reference i...
ruby
chosen
[ { "from": "system", "value": "Add link to GitHub as homepage.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'splatter/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Fix parsing of author id\n" }, { "from": "human", "value": "module WpPost\n extend ActiveSupport::Concern\n\n included do\n serialize :acf_fields\n end\n\n def update_post(json)\n self.class.mappable_wordpress_attributes.each do |wp_attribute|\n send(...
ruby
chosen
[ { "from": "system", "value": "11106: Use DJ in development too\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nRaven.configure do |config|\n config.sanitize_fields = Rails.application.config.filter_parameters.map(&:to_s)\n config.release = \"nemo@#{configatron.system_versio...
ruby
chosen
[ { "from": "system", "value": "Exclude gitignore from packaged gem\n" }, { "from": "human", "value": "require File.expand_path('../lib/envb/rails/version', __FILE__)\n\nGem::Specification.new do |g|\n g.name = 'envb-rails'\n g.version = Envb::Rails::VERSION\n g.authors = '...
ruby
chosen
[ { "from": "system", "value": "Make application recipe deploy more than one application.\n" }, { "from": "human", "value": "#\n# Cookbook Name:: application\n# Recipe:: default\n#\n# Copyright 2009, Opscode, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may n...
ruby
chosen
[ { "from": "system", "value": "Allow Sprockets to autoload EJS instead of adding it as a dependency\n\nThis should only happen if the default template is actually used.\n" }, { "from": "human", "value": "require \"active_support/all\"\nrequire \"ejs\"\n\nrequire \"s3direct/version\"\nrequire \"s3...
ruby
chosen
[ { "from": "system", "value": "Test how pluto (un)persists unpersistables, and if simple 'unique' values like 1,2,3 can lead to data corruption if they exist elsewhere.\n" }, { "from": "human", "value": "\nclass CheckLuaSyntax < MiniTest::Test\n\n\n\n def test_sandbox_syntax\n test_syntax('.....
ruby
chosen
[ { "from": "system", "value": "Normalize query strings as json" }, { "from": "human", "value": "module BettyResource\n class Api\n include HTTParty\n\n base_uri \"#{BettyResource.config.host}/api\"\n format :json\n basic_auth BettyResource.config.user, BettyResource.config.password\n...
ruby
chosen
[ { "from": "system", "value": "Fix AbcSize RuboCop offense recently introduced\n" }, { "from": "human", "value": "require 'forwardable'\n\nrequire 'byebug/helpers/reflection'\nrequire 'byebug/command_list'\n\nmodule Byebug\n #\n # Subcommand additions.\n #\n module Subcommands\n def self.i...
ruby
chosen
[ { "from": "system", "value": "Make Reek understand that self.add is a class method.\n" }, { "from": "human", "value": "module GLib\n load_class :PtrArray\n\n # Overrides for GPtrArray, GLib's automatically growing array of\n # pointers.\n class PtrArray\n include Enumerable\n\n attr_ac...
ruby
chosen
[ { "from": "human", "value": "Add Sourcetree git client for mac.\n" }, { "from": "gpt", "value": "dmg_package \"SourceTree\" do\n volumes_dir \"SourceTree\"\n source \"http://downloads.atlassian.com/software/sourcetree/SourceTree_1.5.7.dmg\"\n checksum \"3ee601004b1f7e492428f86b733c6aec\"\n a...
ruby
chosen
[ { "from": "system", "value": "Update miniskirt dependency to minifacture\n\nThe project was renamed, see https://github.com/stephencelis/minifacture/issues/20\r\n\r\nThere should not be any code changes since it's already aliased to `Factory`.\r\n\r\nCheers!" }, { "from": "human", "value": "$LOA...
ruby
chosen
[ { "from": "system", "value": "Add test for case where word == string\n" }, { "from": "human", "value": "require_relative 'spec_helper'\nrequire_relative 'parser'\nrequire 'pry'\n\ndescribe \"word_in_string?\" do\n context \"returns symbols :yes and :no\" do\n it \"should return :no for word_...
ruby
chosen
[ { "from": "system", "value": "Add helpers to set and display time, date, and service\n" }, { "from": "human", "value": "module OrdersHelper\nend\n" }, { "from": "gpt", "value": "module OrdersHelper\n\n def past_cuttoff_time?\n # TODO: change to set endtime variable\n Date.curr...
ruby
chosen
[ { "from": "system", "value": "Add support for optional argument\n" }, { "from": "human", "value": "require 'rest_client'\nrequire 'multi_json'\n\nrequire 'wanikani/user'\nrequire 'wanikani/study_queue'\nrequire 'wanikani/level'\nrequire 'wanikani/srs'\n\nmodule Wanikani\n API_ENDPOINT = \"http:...
ruby
chosen
[ { "from": "system", "value": "Revert \"add global logger attribute\"\n\nThis reverts commit 458eb3061838115e63ce501421732cc437bb8a2c.\n\nConflicts:\n\n\tlib/madvertise-logging.rb\n\tlib/madvertise/logging/version.rb\n" }, { "from": "human", "value": "require 'madvertise/logging/version'\nrequire...
ruby
chosen
[ { "from": "system", "value": "Add dependencies needed by \"LibreOffice Viewer Beta\"\n" }, { "from": "human", "value": "\nuser = node[:settings][:user]\n\nexecute \"apt-get-update\" do\n command \"apt-get update\"\nend\n\n%w{ant ant-contrib autoconf autoconf2.13 autopoint bison cmake expect lib...
ruby
chosen
[ { "from": "system", "value": "Move Perpetuity config to module instance\n\nIt was incorrectly set as a cvar, which put it on the Module class.\nOops.\n" }, { "from": "human", "value": "require \"perpetuity/version\"\nrequire \"perpetuity/retrieval\"\nrequire \"perpetuity/mongodb\"\nrequire \"per...
ruby
chosen
[ { "from": "system", "value": "[TTPLAT-1044] Create super manager role if it doesn't exist.\n" }, { "from": "human", "value": "class UpdateCoreRoleLabels < ActiveRecord::DataMigration\n def up\n Role.where(name: [:user, :manager]).update_all(label: 'Staff')\n Role.find_by(name: :super_mana...
ruby
chosen
[ { "from": "system", "value": "Update podspec so it passes validation\n" }, { "from": "human", "value": "#\n# Be sure to run `pod lib lint NDPhraseParser.podspec' to ensure this is a\n# valid spec before submitting.\n#\n# Any lines starting with a # are optional, but their use is encouraged\n# To...
ruby
chosen
[ { "from": "system", "value": "Update Factory helpers to handle protected attributes\n" }, { "from": "human", "value": "module Factory\n # Build actions for the model\n def self.build(model, &block)\n name = model.to_s.underscore\n \n define_method(\"#{name}_attributes\", block)\n d...
ruby
chosen
[ { "from": "system", "value": "Fix PoliciesControllerTest::NationalApplicabilityTest to use the super behaviour for attributes_for_edition.\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass Admin::PoliciesControllerTest < ActionController::TestCase\n class NationalApplicabilityTe...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 2.5.1.1 to 2.5.1.2\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'evt-messaging'\n s.version = '2.5.1.1'\n s.summary = 'Common primitives for platform-specific messaging im...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.12.1.0 to 0.12.1.1\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'evt-messaging'\n s.version = '0.12.1.0'\n s.summary = 'Messaging primitives for Eventide'\n s.descripti...
ruby
chosen
[ { "from": "system", "value": "Add view task, beware this publishes first!\n" }, { "from": "human", "value": "namespace :doc do\n desc \"Create the API documentation\"\n task :api => :environment do\n Betterdocs::Global.config do |config|\n Betterdocs::Generator::Markdown.new.generate\n...
ruby
chosen
[ { "from": "system", "value": "Add logger metods and delete json parse\n" }, { "from": "human", "value": "require 'rack'\nrequire 'json'\n\nmodule Bitbucket\n class Hooks\n class Server\n attr_reader :event\n\n def initialize(event)\n @event = event\n end\n\n def ca...
ruby
chosen
[ { "from": "system", "value": "Update Opera developer to 29.0.1781.0" }, { "from": "human", "value": "cask :v1 => 'opera-developer' do\n version '28.0.1750.5'\n sha256 '323d8a24b6afd63fba8c0d17a6e810cc4cfd454df488499a395bf0ff70421335'\n\n url \"http://get.geo.opera.com/pub/opera-developer/#{ve...
ruby
chosen
[ { "from": "system", "value": "Validate Attachments with SafeHtml validator\n" }, { "from": "human", "value": "require 'attachable'\n\nclass Attachment\n include Mongoid::Document\n include Mongoid::Timestamps\n include Attachable\n\n field :title\n field :filename\n attaches :file\n\n def...
ruby
chosen
[ { "from": "system", "value": "Fix failing spec and logging. to_param is ActiveModel feature which is not available here.\n" }, { "from": "human", "value": "require 'restclient'\n\nmodule JustDial\n class Search\n def initialize(url, auth_tokens={})\n @url = url\n @auth_tokens = aut...
ruby
chosen
[ { "from": "system", "value": "Update the tag for FC113 to include chef15\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "rule \"FC113\", \"Resource declares deprecated use_inline_resources\" do\n tags %w{deprecation lwrp}\n libr...
ruby
chosen
[ { "from": "system", "value": "Migrate aleph id into user using a hash, not string\n" }, { "from": "human", "value": "class PopulateAlephIdFromUserAttributes < ActiveRecord::Migration\n def up\n say_with_time \"Migrating Aleph ID.\" do\n User.all.each do |user|\n user.update_attri...
ruby
chosen
[ { "from": "system", "value": "Simplify migration as the descriptions used are always `description`\n" }, { "from": "human", "value": "# This migration comes from decidim (originally 20170220110740)\nclass RemoveStepsShortDescription < ActiveRecord::Migration[5.0]\n def change\n Decidim::Part...
ruby
chosen
[ { "from": "system", "value": "Use a heat time that's better for v4 printers.\n" }, { "from": "human", "value": "require \"a2_printer\"\n\nclass PrintProcessor::A2Raw\n def width\n 384\n end\n\n def process(data)\n bytes = []\n rotate_180(data[\"pixels\"]).each_slice(8) { |s| bytes <<...
ruby
chosen
[ { "from": "system", "value": "Drop unnecessary mysql user default\n" }, { "from": "human", "value": "Rails::Application::Configuration.class_eval do\n\n def database_configuration_with_default\n config_file =\n begin\n database_configuration_without_default\n rescue Errno::E...
ruby
chosen
[ { "from": "system", "value": "Update the comments in the Configure class" }, { "from": "human", "value": "class RelatedWord\n def self.config\n yield(Configure) if block_given?\n end\n\n class Configure\n # The service used for find related words\n @service = :semantic\n\n # The t...
ruby
chosen
[ { "from": "system", "value": "Add rake target for CI\n" }, { "from": "human", "value": "namespace :license do\n desc 'write out example config file'\n task :init do\n FileUtils.cp(File.join(File.dirname(__FILE__), '..', '..', 'files', 'license_finder.yml'), './config/license_finder.yml')\n ...
ruby
chosen
[ { "from": "human", "value": "Add WordPress Business Intelligence Lite SQLi Scanner\n" }, { "from": "gpt", "value": "##\n# This module requires Metasploit: http://metasploit.com/download\n# Current source: https://github.com/rapid7/metasploit-framework\n##\n\nrequire 'msf/core'\n\nclass Metasploi...
ruby
chosen
[ { "from": "system", "value": "Revert back to use fix.\n\nActually won't remove this hack but update the comment to reflect the actual\nproblem.\n" }, { "from": "human", "value": "require 'omniauth-oauth2'\n\nmodule OmniAuth\n module Strategies\n class Mojsso < OmniAuth::Strategies::OAuth2\n ...
ruby
chosen
[ { "from": "system", "value": "Remove the load path mambo-jambo from the gemspec\n" }, { "from": "human", "value": "lib = File.expand_path(\"../lib\", __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\n\nGem::Specification.new do |gem|\n gem.name = \"musique\"\n gem.ve...
ruby
chosen
[ { "from": "human", "value": "Add rspecs to displaying eligible adjustments in Admin\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\nmodule Spree\n module Admin\n describe AdjustmentsController, type: :controller do\n stub_authorization!\n\n describe '#index' do\n l...
ruby
chosen
[ { "from": "system", "value": "Update deprecated Net::HTTPServerException with Net::HttpClientException\n\nSigned-off-by: Prajakta Purohit <e0b6074fb36005ab38b637036277c00627bb386c@chef.io>\n" }, { "from": "human", "value": "require 'chef/provider/lwrp_base'\n\nclass Chef\n class Provider\n c...
ruby
chosen
[ { "from": "system", "value": "Fix issues with building the gem.\n" }, { "from": "human", "value": "# coding: utf-8\nrequire './lib/dirby/version'\n\nGem::Specification.new do |spec|\n spec.name = 'dirby'\n spec.version = Dirby::VERSION\n spec.authors = ['Nathan Currier']\...
ruby
chosen
[ { "from": "system", "value": "Remove JSON version dependency cause we don't depend on any special behaviour\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\n\nGem::Specification.new do |spec|\...
ruby
chosen
[ { "from": "system", "value": "Add Tags contract for ELB\n" }, { "from": "human", "value": "require 'aws-sdk'\nrequire 'contracts'\nrequire_relative 'service'\n\nmodule Cloudstrap\n module Amazon\n class ELB < Service\n include ::Contracts::Core\n include ::Contracts::Builtin\n\n ...
ruby
chosen
[ { "from": "human", "value": "Add spec for frontend handling of users with invalid oauth token\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\ndescribe 'a user with invalid oauth credentials', type: :feature do\n before do\n user = create(:user, wiki_token: 'invalid')\n login_as...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.2.1 to 0.0.2.2\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'http-server'\n s.version = '0.2.1'\n s.summary = 'Simple HTTP Server using http-protocol'\n s.description = ' '\n\n s....
ruby
chosen
[ { "from": "system", "value": "Allow more fine-grained filtering on date\n" }, { "from": "human", "value": "class StatisticsController < ApplicationController\n include StatisticsHelper\n\n before_action :authorize!, only: [:show, :graphs, :user_activity, :user_activity_history, :rfc_activity,\...
ruby
chosen
[ { "from": "system", "value": "Fix success method to return false when an error happens\n" }, { "from": "human", "value": "module BraspagRest\n class Response\n attr_reader :gateway_response\n\n def initialize(gateway_response)\n @gateway_response = gateway_response\n end\n\n de...
ruby
chosen
[ { "from": "human", "value": "Create migration test for removing Type / Template/VMs filters\n\nhttps://bugzilla.redhat.com/show_bug.cgi?id=1351210\n\nCreate migration test for removing filters from MiqSearch\nto fix the bug.\n" }, { "from": "gpt", "value": "require_migration\n\ndescribe RemoveTy...
ruby
chosen
[ { "from": "system", "value": "Allow us to specify a file name to output to.\n" }, { "from": "human", "value": "require 'jshint'\nrequire 'jshint/reporters'\n\nnamespace :jshint do\n desc \"Runs JSHint, the JavaScript lint tool over this project's JavaScript assets\"\n task :lint, [:reporter] =...
ruby
chosen
[ { "from": "system", "value": "Add label option to rows\n" }, { "from": "human", "value": "class BaseRow\n attr_reader :icon, :key, :options\n\n def initialize(key, options)\n @key = key\n @options = options\n\n @icon = options.fetch(:icon, nil)\n @value = options.fetch(:value,...
ruby
chosen
[ { "from": "system", "value": "Use of extend Virtual::Macro is replaced with Virtual.activate\n" }, { "from": "human", "value": "module Schema\n module DataStructure\n def self.included(cls)\n cls.class_exec do\n include Schema\n extend Build\n extend Virtual::Macro\...
ruby
chosen
[ { "from": "system", "value": "Return successful even if java is not installed\n" }, { "from": "human", "value": "require_relative 'helpers'\n\nmodule VagrantPlugins\n module CaCertificates\n module Cap\n module Redhat\n # Capability for configuring the certificate bundle on Redha...
ruby
chosen
[ { "from": "system", "value": "Update description of data scrubber rake task\n" }, { "from": "human", "value": "namespace :data do\n desc \"TODO\"\n task scrub_data: :environment do\n ScrubDataForBuildingsAndUsers.exec\n end\nend\n" }, { "from": "gpt", "value": "namespace :data ...
ruby
chosen
[ { "from": "system", "value": "Update authors and emails for gem\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\nrequire 'taperole/version'\n\nGem::Specification.new do |spec|\n spec.name = \"taperole\"\n spec.version = Taperole::VERSION.dup\n spec.authors = ...
ruby
chosen
[ { "from": "system", "value": "Implement happy path for get_installed.\n" }, { "from": "human", "value": "require \"ubuntu_unused_kernels/version\"\nrequire \"open3\"\n\nmodule UbuntuUnusedKernels\n PACKAGE_PREFIXES = %w{linux-image linux-headers}\n KERNEL_VERSION = %r{\\d+\\.\\d+\\.\\d+-\\d+}\...
ruby
chosen
[ { "from": "system", "value": "Use single-quotes per Ruby style guide.\n" }, { "from": "human", "value": "stack = Faraday::Builder.new do |builder|\n builder.use Faraday::HttpCache\n builder.use Ohanakapa::Response::RaiseError\n builder.adapter Faraday.default_adapter\nend\nOhanakapa.configure...
ruby
chosen
[ { "from": "system", "value": "Add summary and 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 'phonetic_alphabet/version'\n\nGem::Specification.new do |spec|\n ...
ruby
chosen
[ { "from": "system", "value": "Check to make sure a reply email is sent by either the ticket's user, the ticket's agent, or an admin." }, { "from": "human", "value": "class MailReceiver\n def add_comment(message, params)\n ticket = Ticket.find_by_token(params[:token])\n user = User.find_by...
ruby
chosen
[ { "from": "system", "value": "Update gemspec to allow for newer versions of mongo\n" }, { "from": "human", "value": "require './lib/mouth/version'\n\nGem::Specification.new do |s|\n s.name = 'mouth'\n s.version = Mouth::VERSION\n s.author = 'Jonathan Novak'\n s.email = 'jnovak@gmail.com'\n ...
ruby
chosen
[ { "from": "system", "value": "Write more detailed method documentation\n" }, { "from": "human", "value": "require 'devise/strategies/authenticatable'\n\nmodule Devise\n module Strategies\n class LdapAuthenticatable < Authenticatable\n def authenticate!\n resource = mapping.to.fin...
ruby
chosen
[ { "from": "system", "value": "Add spec for last commit\n" }, { "from": "human", "value": "require File.expand_path(File.dirname(__FILE__) + '/spec_helper')\n\ndescribe \"Dynamoid\" do\n\n it \"doesn't puke when asked for the assocations of a new record\" do\n User.new.books.should == []\n e...
ruby
chosen
[ { "from": "system", "value": "Use array extract option support in custom fetch\n" }, { "from": "human", "value": "module Perforated\n module Compatibility\n def self.fetch_multi(*names, &block)\n if supports_fetch_multi?\n Perforated.cache.fetch_multi(*names, &block)\n else\...
ruby
chosen
[ { "from": "system", "value": "Support for 'has' operator to check if item is in array\n" }, { "from": "human", "value": "require 'puppet_x/util/wildfly_cli'\n\nPuppet::Type.type(:wildfly_cli).provide(:http_api) do\n\n desc 'Uses JBoss HTTP API to execute a JBoss-CLI command'\n\n def cli\n P...
ruby
chosen
[ { "from": "system", "value": "Make test email come from the default email sender, not the error sender\n" }, { "from": "human", "value": "class TestMailers < ActionMailer::Base\n\n\tdef email()\n\t\tmail(to: EXCEPTION_RECIPIENTS, from: EXCEPTION_SENDER, subject: \"Libra2 Test Email\")\n\tend\nen...
ruby
chosen
[ { "from": "system", "value": "Add the verified status in the response enum\n\nSigned-off-by: Siddharth Kannan <805f056820c7a1cecc4ab591b8a0a604b501a0b7@gmail.com>" }, { "from": "human", "value": "class AlumniStatus < ActiveRecord::Base\n\tbelongs_to :Alumni\n\tenum search: [:ready, :found, :tobe...
ruby
chosen
[ { "from": "system", "value": "Remove guard dependencies from test group\n" }, { "from": "human", "value": "# By placing all of Spree's shared dependencies in this file and then loading\n# it for each component's Gemfile, we can be sure that we're only testing just\n# the one component of Spree.\...
ruby
chosen
[ { "from": "system", "value": "Use private instance method instead\n" }, { "from": "human", "value": "class OauthAccount < ActiveRecord::Base\n belongs_to :user\n\n def self.from_omniauth(auth)\n where(provider: auth.provider, uid: auth.uid).first_or_initialize.tap do |account|\n accoun...
ruby
chosen
[ { "from": "system", "value": "Add missing docs for Metasploit::Credential\n\nMSP-10130\n" }, { "from": "human", "value": "\n#\n# Gems\n#\n# gems must load explicitly any gem declared in gemspec\n# @see https://github.com/bundler/bundler/issues/2018#issuecomment-6819359\n#\n#\n\nrequire 'metasplo...
ruby
chosen
[ { "from": "system", "value": "Add the alt attribute on img with the title.\n\nSigned-off-by: François de Metz <5187da0b934cc25eb2201a3ec9206c24b13cb23b@stormz.me>\n" }, { "from": "human", "value": "module OEmbed\n class Response\n # A Response used for representing static photos.\n class ...
ruby
chosen
[ { "from": "system", "value": "Allow Tag to include base args\n" }, { "from": "human", "value": "module OpenFlashChart\n class OFCTags < Base\n def initialize args={}\n super args\n @type = 'tags'\n @values = []\n end\n\n def font(font, size)\n @font = font\n ...
ruby
chosen
[ { "from": "system", "value": "Set of facts. Don't allow empty :title\n" }, { "from": "human", "value": "class Channel < OurOhm\n \n attribute :title\n attribute :description\n \n collection :facts, Fact\n \n reference :user, GraphUser\n \nend" }, { "from": "gpt", "value": "cl...
ruby
chosen
[ { "from": "system", "value": "Create a better message in the header\n" }, { "from": "human", "value": "class Chef::Mixin::Template::TemplateContext\n def template_header(comment = '#')\n <<-HEADER.gsub(/^ */, \"#{comment} \")\n DO NOT CHANGE THIS FILE MANUALLY!\n\n This file is managed...
ruby
chosen
[ { "from": "human", "value": "Add monkey patch for carrierwave to fix encoding issue\n" }, { "from": "gpt", "value": "# encoding: utf-8\n\nmodule CarrierWave\n module Uploader\n module Url\n def url(options = {})\n if file.respond_to?(:url) and not file.url.blank?\n (file...
ruby
chosen
[ { "from": "system", "value": "Update migration to work with newer constant value\n" }, { "from": "human", "value": "class UpdateOldOrganisationTypeValues < ActiveRecord::Migration\n def up\n organisations_to_update = Organisation.where.not(organisation_type: Organisation::ORGANISATION_TYPES....
ruby
chosen
[ { "from": "system", "value": "Fix `ArgumentError: wrong number of arguments (given 1, expected 2)`\n" }, { "from": "human", "value": "module Certman\n class CLI < Thor\n desc 'request [DOMAIN]', 'Request ACM Certificate with only AWS managed services'\n option :remain_resources, type: :bo...
ruby
chosen