conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Return paratransit services in alphabetic order in the transportation options page.\n" }, { "from": "human", "value": "module Api\n module V2\n class ServicesController < ApiController\n \n # GET api/v2/services\n # Returns all published services;...
ruby
chosen
[ { "from": "system", "value": "Fix Growstuff::OauthSignupAction not found error when connecting flickr account\n" }, { "from": "human", "value": "class AuthenticationsController < ApplicationController\n before_action :authenticate_member!\n load_and_authorize_resource\n\n # POST /authenticati...
ruby
chosen
[ { "from": "system", "value": "Add visual_url to stickies api reposponse\n" }, { "from": "human", "value": "json.array!(@stickies) do |sticky|\n json.extract! sticky,\n :id,\n :uuid,\n :content,\n :color,\n :width, :heigh...
ruby
chosen
[ { "from": "system", "value": "Switch from minutely(5) to hourly.minute_of_hour\n\nWorkaround for tobiassvn/sidetiq#31\n" }, { "from": "human", "value": "class TrendingGroupsRefreshWorker\n include Sidekiq::Worker\n include Sidetiq::Schedulable\n\n recurrence { minutely(5) } \n\n def perform...
ruby
chosen
[ { "from": "system", "value": "Add development dependency on rack-test\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"custodian/version\"\n\nGem::Specification.new do |s|\n s.name = \"custodian\"\n s.version = C...
ruby
chosen
[ { "from": "system", "value": "Send text messages with Twilio to hardcoded phone numbers\n" }, { "from": "human", "value": "require 'twilio-ruby'\n\nclass TextMessagesController < ApplicationController\n def index\n p \"*\" * 20\n p \"In text_messages index\"\n p \"*\" * 20\n @twilio...
ruby
chosen
[ { "from": "system", "value": "Add public headers to podspec.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"Purchases\"\n s.version = \"0.1.0\"\n s.summary = \"Subscription and in-app-purchase backend service.\"\n\n s.description = <<-...
ruby
chosen
[ { "from": "human", "value": "Add tests for cumulus_bond provider\n" }, { "from": "gpt", "value": "require 'serverspec'\n\nset :backend, :exec\nset :path, '/bin:/usr/bin:/sbin/usr/sbin'\n\nintf_dir = File.join('', 'etc', 'network', 'interfaces.d')\n\n# Should have been created by the cumulus_bond...
ruby
chosen
[ { "from": "system", "value": "Set defaults for loaded mocks\n" }, { "from": "human", "value": "require 'active_mocker/loaded_mocks'\nrequire 'active_mocker/rspec'\n\n\nRSpec.configure do |config|\n\n config.include ActiveMocker::Rspec\n\n config.before(:each, active_mocker: true) do\n unles...
ruby
chosen
[ { "from": "system", "value": "Set \"authorization\" header only if status_token is provided\n" }, { "from": "human", "value": "require 'net/http'\n\nmodule Bipbip\n class Plugin::SocketRedis < Plugin\n def metrics_schema\n [\n { name: 'channels_count', type: 'gauge', unit: 'Chann...
ruby
chosen
[ { "from": "system", "value": "Make access limited asset worker easier to follow\n" }, { "from": "human", "value": "class AssetManagerAttachmentAccessLimitedWorker < WorkerBase\n def perform(attachment_data_id)\n attachment_data = AttachmentData.find_by(id: attachment_data_id)\n return unl...
ruby
chosen
[ { "from": "system", "value": "Set github as gemspec homepage\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'unshorten'\n s.version = '0.1.0'\n s.date = '2011-12-10'\n s.summary = 'Unshorten URLs'\n s.description = 'Get original URLs from shortened one...
ruby
chosen
[ { "from": "system", "value": "Refactor warden plugin strategy to be defined as class instead of block\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + '/support_lite'\nload File.dirname(__FILE__) + '/markup_plugin/output_helpers.rb'\nDir[File.dirname(__FILE__) + '/warden_plugi...
ruby
chosen
[ { "from": "system", "value": "Fix a regression when running Foodcritic as a Rake task\n\nThe Output classes' initializers now [require](https://github.com/acrmp/foodcritic/commit/3c057cb857939b6761effb386fe0b30e9270add2)\nan output stream argument.\n\nSigned-off-by: Jonathan Hartman <5c2dd944dde9e08881bef08...
ruby
chosen
[ { "from": "system", "value": "Add rake to runtime deps\n\ncloses #3" }, { "from": "human", "value": "#encoding: utf-8\n\nGem::Specification.new do |gem|\n gem.name = 'devtools'\n gem.version = '0.0.1'\n gem.authors = [ 'Markus Schirp' ]\n gem.email = [ 'mbj@seonic.net' ]...
ruby
chosen
[ { "from": "system", "value": "Fix a few error in average_rating and persons_rating\n" }, { "from": "human", "value": "require 'active_support/concern'\n\nmodule MongoRates\n module Rateable\n extend ActiveSupport::Concern\n\n included do\n def ratings\n ratings_query = MongoRa...
ruby
chosen
[ { "from": "system", "value": "Fix bug with not having any models declared\n" }, { "from": "human", "value": "module Swagger\n module Docs\n module Methods\n def self.included(base)\n base.extend ClassMethods\n end\n\n module ClassMethods\n def swagger_controller(...
ruby
chosen
[ { "from": "system", "value": "Make reverse DNS wording uninform\n" }, { "from": "human", "value": "module Brightbox\n desc 'update Cloud IPs'\n arg_name 'cloudip-id'\n command [:update] do |c|\n c.desc \"Set reverse DNS for this cloud ip\"\n c.flag [:r, \"reverse-dns\"]\n\n c.desc \"...
ruby
chosen
[ { "from": "system", "value": "Allow adding items in SalesOrder\n\nfollowing same pattern as Invoice\n" }, { "from": "human", "value": "module NetSuite\n module Records\n class SalesOrderItemList\n include Namespaces::TranSales\n\n def initialize(attributes = {})\n case attri...
ruby
chosen
[ { "from": "system", "value": "Simplify the code on feching the vm attributes.\n" }, { "from": "human", "value": "\nclass Wakame::Monitor::Agent\n include Wakame::Monitor\n \n def initialize\n @status = STATUS_ONLINE\n end\n\n def send_ping(hash)\n publish_to('ping', Wakame::Packets::P...
ruby
chosen
[ { "from": "system", "value": "Include created message in version history\n" }, { "from": "human", "value": "#encoding: utf-8\n\nmodule VersionsHelper\n def value_or_blank(value)\n value.blank? ? '<blank>' : value\n end\n\n def friendly_changeset_title(version)\n if version.changeset['ht...
ruby
chosen
[ { "from": "system", "value": "Store rotation data in the database\n" }, { "from": "human", "value": "class Server\n module Rotations\n extend ActiveSupport::Concern\n include RequestCacheable\n\n included do\n # {\n # rotation_name => {\n ...
ruby
chosen
[ { "from": "system", "value": "Create a single_access_token for all existing users\n" }, { "from": "human", "value": "class AddSingleAccessTokenToUsers < ActiveRecord::Migration\n def self.up\n add_column :users, :single_access_token, :string, :null => false\n end\n\n def self.down\n re...
ruby
chosen
[ { "from": "system", "value": "Revert \"I don't care about preboot anymore\"\n\nThis reverts commit 314010546a7f07ea6c81710400b0e4f59289aa26.\n" }, { "from": "human", "value": "module Heroku::Deploy::Task\n class UnsafeMigration < Base\n include Heroku::Deploy::UI\n\n def before_deploy\n ...
ruby
chosen
[ { "from": "system", "value": "Switch from around_filter to around_action\n" }, { "from": "human", "value": "require 'digest'\n\nmodule KMZCompressor\n module ControllerExtensions\n\n module ClassMethods\n def defer_until_kmz_cached(*actions)\n around_filter :render_202_while_cach...
ruby
chosen
[ { "from": "system", "value": "Update APT source for builds on GCE\n" }, { "from": "human", "value": "require 'travis/build/appliances/base'\n\nmodule Travis\n module Build\n module Appliances\n class UpdateGlibc < Base\n def apply\n sh.fold \"fix.CVE-2015-7547\" do\n ...
ruby
chosen
[ { "from": "system", "value": "Add app version and environment info to import mailers\n" }, { "from": "human", "value": "class ImportMailer < PQBaseMailer\n default from: Settings.mail_from\n\n def notify_fail(err_msg)\n @err_msg = err_msg\n mail(to: Settings.mail_tech_support, subject: '...
ruby
chosen
[ { "from": "system", "value": "Allow forward slashes within PS literal\n" }, { "from": "human", "value": "module Specinfra\n module Backend\n module PowerShell\n class Command\n attr_reader :import_functions, :script\n def initialize &block\n @import_functions = []...
ruby
chosen
[ { "from": "system", "value": "Use module_function to cast the module patient\n" }, { "from": "human", "value": "module Renalware\n module Letters\n def self.table_name_prefix\n \"letter_\"\n end\n end\nend" }, { "from": "gpt", "value": "module Renalware\n module Letters...
ruby
chosen
[ { "from": "system", "value": "Revert \"Remove extension whitelist, as further heroku debugging effort.\"\n\nThis reverts commit e40d89c3602292230ec43c2b2af29f8d1a70c9cc.\n" }, { "from": "human", "value": "# encoding: utf-8\n\nclass PhotoUploader < CarrierWave::Uploader::Base\n\n # Include RMagi...
ruby
chosen
[ { "from": "system", "value": "Store geojson properties in event records\n" }, { "from": "human", "value": "module Georelevent\n module Workers\n class PublisherUpdate < Struct.new(:features, :publisher)\n include Sidekiq::Worker\n\n def perform(publisher_id)\n publisher = Pu...
ruby
chosen
[ { "from": "system", "value": "Allow up to 5 queries per second\n" }, { "from": "human", "value": "module Couriers\n class Fusionable\n class InvalidFusionTableError < Exception; end \n \n extend Resque::Plugins::HerokuAutoscaler\n \n @queue = 'couriers'\n \n class << self\n ...
ruby
chosen
[ { "from": "system", "value": "Initialize meal time to current time\n" }, { "from": "human", "value": "class MealsController < MyplaceonlineController\n def model\n Meal\n end\n\n def display_obj(obj)\n Myp.display_datetime_short(obj.meal_time, User.current_user)\n end\n\n protected\n ...
ruby
chosen
[ { "from": "system", "value": "Disable all param on controller\n\nref: #472\n" }, { "from": "human", "value": "class PostsController < ApplicationController\n helper_method :current_category\n\n def show\n @post = current_site.posts.published.find_by!(public_id: params[:id])\n\n @pages =\...
ruby
chosen
[ { "from": "system", "value": "Fix query used to filter orders by code used\n" }, { "from": "human", "value": "Spree::Order.class_eval do\n has_many :orders_promotions\n has_many :promotions, through: :orders_promotions\n\n def self.ransackable_scopes(auth_object = nil)\n %w(with_promotion_...
ruby
chosen
[ { "from": "system", "value": "Set explicit version for rake\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'jredshift/version'\n\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Fix sporadic build break when affected by leftover config from other tests\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass ConfigurationTest < Minitest::Test\n def teardown\n ActiveWaiter.configuration = nil\n end\n\n def test_configuration_d...
ruby
chosen
[ { "from": "system", "value": "Remove debugger gem from dependencies." }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'doberman/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Refactor extracting of rooms in FetchExams to be less procedural\n" }, { "from": "human", "value": "require 'interactors/kosapi_interactor'\n\nclass FetchExams < KOSapiInteractor\n\n def perform(faculty_semester:, limit: 100, paginate: true)\n @rooms = {}\n @...
ruby
chosen
[ { "from": "system", "value": "Use specific assertions instead of `assert`.\n" }, { "from": "human", "value": "\nrequire 'test_helper'\nrequire 'webhookr/ostruct_utils'\nrequire 'ostruct'\n\nclass OstructUtilsTest < ActiveSupport::TestCase\n def setup\n @hash = { a: { b: { c: 1 } }, a1: [ { b...
ruby
chosen
[ { "from": "human", "value": "Add import users example to examples/\n" }, { "from": "gpt", "value": "require 'bundler/setup'\nrequire 'honey_format'\n\ncsv_string = <<~CSV\nEmail,Name,Age,Country\njohn@example.com,John Doe,42,Sweden\njane@example.com,Jane Doe,42,Denmark\nCSV\n\nputs '== EXAMPLE: ...
ruby
chosen
[ { "from": "system", "value": "Reduce example capistrano configuration to minimum sprinkle requires\n" }, { "from": "human", "value": "set :application, \"application\"\n\nrole :app, \"yourhost.com\"\nrole :web, \"yourhost.com\"\nrole :db, \"yourhost.com\", :primary => true\n" }, { "from...
ruby
chosen
[ { "from": "system", "value": "Fix social share image URL with external storage\n\nCo-Authored-By: Pierre Mesure <ff019a5748a52b5641624af88a54a2f0e46a9fb5@mesu.re>\n" }, { "from": "human", "value": "module ImagesHelper\n def image_absolute_url(image, version)\n return \"\" unless image\n\n ...
ruby
chosen
[ { "from": "system", "value": "Kill passing ivars as local vars\n\nIssue: #215\n" }, { "from": "human", "value": "module RailsEventStore\n module RSpec\n class HaveApplied\n def initialize(expected, *expecteds, differ:)\n @expected = [expected, *expecteds]\n @matcher = ::R...
ruby
chosen
[ { "from": "system", "value": "Raise an exception if required fields are missing in the drupal node\n" }, { "from": "human", "value": "class DrupalMapper\n\n def self.parse(json)\n json_map = fields.inject({}) do |agg, (k, v)|\n agg[k] = v.inject(json) do |iterator, node|\n iterat...
ruby
chosen
[ { "from": "system", "value": "Make sure addresses are valid IPs\n" }, { "from": "human", "value": "class AddressRecord < Record\n validates :content, presence: true\nend\n" }, { "from": "gpt", "value": "require \"resolv\"\n\nclass AddressRecord < Record\n validates :content, presen...
ruby
chosen
[ { "from": "system", "value": "Add dependent: :destroy to Blog\n" }, { "from": "human", "value": "module Storytime\n class Blog < Page\n has_many :posts\n\n def self.seed(site, user)\n blog = site.blogs.new\n blog.title = \"Blog\"\n blog.slug = \"blog\"\n blog.draft_con...
ruby
chosen
[ { "from": "system", "value": "Set default_external to UTF-8 for GitLab CI\n" }, { "from": "human", "value": "require 'simplecov'\nSimpleCov.start do\n add_filter '/test|deps/'\nend\n\nrequire 'pp'\nrequire 'test/unit'\nrequire 'test/unit/rr'\nrequire 'test/unit/notify'\nrequire 'pry'\nrequire '...
ruby
chosen
[ { "from": "system", "value": "Fix Travis using 1.9.3 to build gems\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$LOAD_PATH.unshift(File.join(__dir__, \"lib\"))\n\nGem::Specification.new do |gem|\n gem.name = \"blinkbox-common_mapping\"\n gem.version = open(\"./V...
ruby
chosen
[ { "from": "system", "value": "Update gemspec summary and description" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'smart_polling/version'\n\nGem::Specification.new do |spec|\n spec....
ruby
chosen
[ { "from": "human", "value": "Add a Runner class to SippyCup\n" }, { "from": "gpt", "value": "require 'yaml'\n\nmodule SippyCup\n class Runner\n def initialize(path)\n @options = YAML.load_file File.expand_path(path)\n end\n\n def prepare_command\n ['scenario', 'source', 'dest...
ruby
chosen
[ { "from": "system", "value": "Remove 'at_exit' from coverage call, since in lib.\n\n'start!' already wraps 'Coverage::report!' with at_exit in ChefSpec.\n" }, { "from": "human", "value": "require 'chefspec'\nrequire 'chefspec/server'\nrequire 'chefspec/berkshelf'\n\nat_exit { ChefSpec::Coverage....
ruby
chosen
[ { "from": "system", "value": "Align text & change font sizes to be more readable\n" }, { "from": "human", "value": "class TimerViewCell < UITableViewCell\n attr_accessor :primaryLabel\n attr_accessor :secondaryLabel\n\n def createLabels\n\n @primaryLabel = UILabel.alloc.init\n @primaryL...
ruby
chosen
[ { "from": "system", "value": "Add JSON dev dependency for webmock\n\nwebmock should require this itself, but doesn't. Sigh.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/customerio/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.auth...
ruby
chosen
[ { "from": "human", "value": "Add a subgroup_creation_level column to the namespaces table\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nclass AddGroupCreationLevelToNamespaces < ActiveRecord::Migration[5.1]\n include Gitlab::Database::MigrationHelpers\n\n DOWNTIME = false\n...
ruby
chosen
[ { "from": "system", "value": "Fix gems to older version\n\nI wanted to find a solution to this that would allow newer Rubies\nto upgrade beyond these older gem versions, but I've already\nsunk too much time here.\n\nSee https://github.com/rubygems/rubygems/issues/722\n" }, { "from": "human", "va...
ruby
chosen
[ { "from": "system", "value": "Switch supports fedora \"21\" to \"21.0\"\n" }, { "from": "human", "value": "name 'firewalldconfig'\nmaintainer 'Johnathan Kuprerer'\nmaintainer_email 'jtk@uic.edu'\nlicense 'Apache v2.0'\ndescription 'Installs/Configures firewalld us...
ruby
chosen
[ { "from": "system", "value": "Tweak comments; adjust default reservoir size.\n" }, { "from": "human", "value": "require \"hetchy/version\"\n\nclass Hetchy\n\n attr_reader :count, # number of samples processed\n :pool, # current pool data\n :size # size o...
ruby
chosen
[ { "from": "system", "value": "Remove env check as we can do this in puppet now\n" }, { "from": "human", "value": "Bugsnag.configure do |config|\n config.api_key = ENV[\"RESPONSIVE_BUG_SNAG_KEY\"] unless (ENV['MAS_ENVIRONMENT'] == 'qa')\nend\n" }, { "from": "gpt", "value": "Bugsnag.c...
ruby
chosen
[ { "from": "system", "value": "Fix spec failure for seed 23311\n" }, { "from": "human", "value": "require 'shoes/spec_helper'\n\ndescribe Shoes::Sound do\n let(:gui_container) { double(\"gui container\") }\n let(:filepath) { \"../../samples/sounds/61847__simon-rue__boink-v3.wav\" }\n subject {...
ruby
chosen
[ { "from": "system", "value": "Refactor: Remove case/when covered by open/closed code\n" }, { "from": "human", "value": "require 'markdo/commands'\n\nmodule Markdo\n class CLI\n def initialize(stdout, stderr, full_env)\n @stdout = stdout\n @stderr = stderr\n @full_env = full_en...
ruby
chosen
[ { "from": "system", "value": "Cut bot response if length greater than 75 characters\n" }, { "from": "human", "value": "require 'nokogiri'\nrequire 'open-uri'\n\nclass Wa\n include Cinch::Plugin\n\n match /(wa) (.+)/, prefix: /^(\\.)/\n match /(help wa)$/, method: :help, prefix: /^(\\.)/\n\n ...
ruby
chosen
[ { "from": "system", "value": "Add a missing autoload declaration\n" }, { "from": "human", "value": "require 'bundler/setup'\nrequire 'vim-flavor/enumerableextension'\n\nmodule Vim\n module Flavor\n [\n :CLI,\n :Facade,\n :Flavor,\n :FlavorFile,\n :LockFile,\n :L...
ruby
chosen
[ { "from": "system", "value": "Add some basic ChefSpec tests.\n" }, { "from": "human", "value": "# Encoding: utf-8\n\nrequire_relative 'spec_helper'\n\ndescribe 'system::default' do\n before { stub_resources }\n describe 'ubuntu' do\n let(:chef_run) { ChefSpec::Runner.new.converge(described_...
ruby
chosen
[ { "from": "system", "value": "Update dor-services dependency to ~> 6.0" }, { "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 = 'etd_model'\n...
ruby
chosen
[ { "from": "system", "value": "Test accessing /account with basic auth\n" }, { "from": "human", "value": "require \"spec_helper\"\n\nRSpec.describe CheckfrontAPI do\n it \"has a version number\" do\n expect(CheckfrontAPI::VERSION).not_to be nil\n end\n\n it \"can reach the server\" do\n ...
ruby
chosen
[ { "from": "system", "value": "Fix failing test by enforcing unique section names\n" }, { "from": "human", "value": "require 'faker'\n\nFactoryGirl.define do\n factory :section do\n name { Faker::Lorem.word }\n end\nend\n" }, { "from": "gpt", "value": "require 'faker'\n\nFactoryG...
ruby
chosen
[ { "from": "human", "value": "Add tests for --help, -h, --version, and -v.\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\nHOW_IS_EXE = File.expand_path('../../exe/how_is', __dir__)\n\ndescribe 'Integration Tests' do\n context '--help and -h flags' do\n it 'outputs usage information...
ruby
chosen
[ { "from": "system", "value": "Maintain BC, do not start the service\n" }, { "from": "human", "value": "# recipes/default.rb\n#\n# Author: Simple Finance <ops@simple.com>\n# License: Apache License, Version 2.0\n#\n# Copyright 2013 Simple Finance Technology Corporation\n#\n# Licensed under the Ap...
ruby
chosen
[ { "from": "system", "value": "Include SQLite 3 development files on debian platforms" }, { "from": "human", "value": "#\n# Cookbook Name:: sqlite\n# Recipe:: default\n#\n# Copyright 2009-2012, Opscode, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not us...
ruby
chosen
[ { "from": "system", "value": "Use namespaces in UDP spec\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe LIFX::Transport::UDP, integration: true do\n subject(:udp) { LIFX::Transport::UDP.new(host, port) }\n\n let(:host) { 'localhost' }\n let(:message) { double }\n let(:p...
ruby
chosen
[ { "from": "system", "value": "Add Rubygems link to changelog\n" }, { "from": "human", "value": "\nGem::Specification.new do |s|\n\n s.name = 'fugit'\n\n s.version = File.read(\n File.expand_path('../lib/fugit.rb', __FILE__)\n ).match(/ VERSION *= *['\"]([^'\"]+)/)[1]\n\n s.platform = Gem:...
ruby
chosen
[ { "from": "system", "value": "Update dependencies to allow Rake 11\n\nResolves #756\n" }, { "from": "human", "value": "$LOAD_PATH << File.expand_path('../lib', __FILE__)\nrequire 'scss_lint/constants'\nrequire 'scss_lint/version'\n\nGem::Specification.new do |s|\n s.name = 'scss_lin...
ruby
chosen
[ { "from": "system", "value": "Handle rake tasks in cron jobs with bundle exec.\n" }, { "from": "human", "value": "# Use this file to easily define all of your cron jobs.\n\nset :output, File.join(File.expand_path(File.dirname(__FILE__)), \"log\", \"cron_log.log\")\n\njob_type :rake, \"cd...
ruby
chosen
[ { "from": "system", "value": "Make the not-TNA validator check a parsed URL's host, not just a string\n\n- This makes it consistent with how NationalArchivesURLValidator checks\n for a TNA host.\n" }, { "from": "human", "value": "class NotANationalArchivesURLValidator < ActiveModel::EachValidat...
ruby
chosen
[ { "from": "system", "value": "Change back to example PSD\n" }, { "from": "human", "value": "require './lib/psd'\n\npsd = PSD.new('/Users/ryanlefevre/LayerVault/Turtleworks/Conversation.psd')\npsd.parse!\n\npp psd.tree.to_hash" }, { "from": "gpt", "value": "require './lib/psd'\n\npsd ...
ruby
chosen
[ { "from": "system", "value": "Use type helper methods instead of custom method\n" }, { "from": "human", "value": "def get_bool(name)\r\n value = send \"field_#{name}\"\r\n\r\n begin\r\n value.to_s.to_bool\r\n rescue ArgumentError\r\n raise InvalidRequestError, \"#{name} must be a boolea...
ruby
chosen
[ { "from": "system", "value": "Remove require to removed file\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire \"i18n/workflow/version\"\nrequire \"i18n/workflow/always_cascade\"\nrequire \"i18n/workflow/exception_handler\"\nrequire \"i18n/workflow/explicit_scope_key\"\...
ruby
chosen
[ { "from": "system", "value": "Update methods should respond itself\n" }, { "from": "human", "value": "module WebPay\n class Entity\n class << self\n include Operations\n\n def convert(hash)\n converter = ResponseConverter.new\n converter.convert(hash)\n end\n ...
ruby
chosen
[ { "from": "system", "value": "Add specific argument error types.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nrequire 'tty/version'\n\nrequire 'tty/support/utils'\nrequire 'tty/support/delegatable'\nrequire 'tty/support/conversion'\nrequire 'tty/support/coercion'\nrequire 'tty...
ruby
chosen
[ { "from": "system", "value": "Sort the results by table name before printing\n" }, { "from": "human", "value": "namespace :db do\n namespace :indexes do\n desc \"Prints a list of unindexed foreign keys so you can index them\" \n task :missing => :environment do\n indexes = {}\n ...
ruby
chosen
[ { "from": "system", "value": "Make gemspec valid with somewhat real descriptions\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'yardstick-client/version'\n\nGem::Specifica...
ruby
chosen
[ { "from": "system", "value": "Remove spec dir what is rejected in .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 'deviantart/version'\n\nGem::Specification.new do |spec|\n ...
ruby
chosen
[ { "from": "system", "value": "Add TODO for session state checking\n" }, { "from": "human", "value": "# frozen_string_literal: true\nRails.application.config.middleware.use OmniAuth::Builder do\n oauth_config = OpenWebslides::Configuration.oauth2\n\n before_callback_phase do |env|\n query_pa...
ruby
chosen
[ { "from": "human", "value": "Add initializer for Sunlight API key\n" }, { "from": "gpt", "value": "if defined?(SETTINGS) && key = SETTINGS[:sunlight_api_key]\n Sunlight.api_key = key\nelse\n warn \"No Sunlight API key found. Check config/settings.yml\"\nend\n" } ]
ruby
chosen
[ { "from": "system", "value": "Add in root page title test\n\nAlso DRY up check posts portion of the tests\n" }, { "from": "human", "value": "describe 'Root page' do\n let(:root_page) { CGTest::RootPage.new(@br) }\n\n before(:each) do\n root_page.goto\n end\n\n it 'should have posts that c...
ruby
chosen
[ { "from": "system", "value": "Remove the rails 3.1 version check.\n\nThere is really no reason to use this gem unless\r\nyou're already on 3.1, so don't bother checking." }, { "from": "human", "value": "module Selectivizr\n module Rails\n class Engine < ::Rails::Engine\n if Rails.versio...
ruby
chosen
[ { "from": "human", "value": "Add rake task for update Platform6\n" }, { "from": "gpt", "value": "namespace :platform6 do\n desc \"Update Platform6 stuff\"\n task :update => :environment do\n require 'rpm'\n require 'open-uri'\n\n branch = Branch.where(:name => 'Platform6', :vendor => ...
ruby
chosen
[ { "from": "human", "value": "Add code wars (7) - parts of a list\n" }, { "from": "gpt", "value": "# http://www.codewars.com/kata/56f3a1e899b386da78000732/ \n# --- iteration 1 ---\ndef partlist(arr)\n (0..arr.size-2).map { |n| [arr[0..n].join(\" \"), arr[(n+1)..-1].join(\" \")] }\nend\n" } ]
ruby
chosen
[ { "from": "system", "value": "Use helper instead of instance variable\n" }, { "from": "human", "value": "module Abilities\n module Extensions\n module ActionController\n module Base\n extend ActiveSupport::Concern\n\n included do\n helper_method :can?, :cannot?\n ...
ruby
chosen
[ { "from": "system", "value": "Revert \"Temporary disable subdomains constraints\"\n\nThis reverts commit 935f76632d774bc9b0ed368948c7b10266bb8397.\n" }, { "from": "human", "value": "# $redis = if Rails.env.test?\n# require Rails.root.join('spec/support/mock_redis')\n# MockRedis.new\n# else\n...
ruby
chosen
[ { "from": "system", "value": "Update the homepage URI [ci skip]\n" }, { "from": "human", "value": "# coding: utf-8\n\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'myaso/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Add [] syntax for JS functions\n" }, { "from": "human", "value": "module MrubyJs\n class JsObject\n def call(name, *args)\n get_func(name).invoke(*args)\n end\n\n def call_constructor(name, *args)\n get_func(name).invoke_constructor(*args)\n e...
ruby
chosen
[ { "from": "system", "value": "Use serialized_event in ActiveJob Dispatcher\n" }, { "from": "human", "value": "require 'active_job'\n\nmodule RailsEventStore\n module AsyncProxyStrategy\n class AfterCommit\n def call(klass, event)\n if ActiveRecord::Base.connection.transaction_ope...
ruby
chosen
[ { "from": "system", "value": "Update the migration that copies ISBNs to attachments.\n\nThis migration has already run in preview but not yet in production,\nwhich is why I'm happy to update it.\n" }, { "from": "human", "value": "class CopyIsbnFromPublicationToAttachment < ActiveRecord::Migratio...
ruby
chosen
[ { "from": "system", "value": "Update rubocop requirement from ~> 0.82.0 to ~> 0.83.0\n\nUpdates the requirements on [rubocop](https://github.com/rubocop-hq/rubocop) to permit the latest version.\n- [Release notes](https://github.com/rubocop-hq/rubocop/releases)\n- [Changelog](https://github.com/rubocop-hq/r...
ruby
chosen
[ { "from": "human", "value": "Add function for check timeout\n" }, { "from": "gpt", "value": "require 'socket'\nrequire 'pp'\n\nclass Common\n # http://hibberttech.blogspot.fr/2013/05/ruby-check-if-port-is-open.html\n def checkPortIsOpen?(ip, port, timeout)\n start_time = Time.now\n curre...
ruby
chosen
[ { "from": "system", "value": "Fix failing test in railties\n\nRelated to the HTML route inspector changes:\nae68fc3864e99ab43c18fd12577744e1583f6b64\n" }, { "from": "human", "value": "require 'abstract_unit'\n\nmodule ActionController\n class Base\n include ActionController::Testing\n end\n...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary uses of return\n" }, { "from": "human", "value": "class Value\n def self.new(*fields)\n return Class.new do\n attr_reader *fields\n\n define_method(:initialize) do |*values|\n raise ArgumentError.new(\"wrong number of argument...
ruby
chosen
[ { "from": "system", "value": "Fix `url` stanza comment for GraphicConverter.\n" }, { "from": "human", "value": "cask 'graphicconverter' do\n version '9.2098'\n sha256 'ae584e3e4d508eb4a6d99e8caa234466d0e88108465486ddd45cd641fc7d24df'\n\n # lemkesoft.org was verified as official when first int...
ruby
chosen