conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix test failure do to missing YAML constant\n" }, { "from": "human", "value": "require 'open-uri'\n\nclass Spice\n\n attr_accessor :name\n\n def initialize(name)\n self.name = name\n end\n\n def ingredients\n recipe = open(\"https://raw.github.com/hashroc...
ruby
chosen
[ { "from": "system", "value": "Change pod spec to include sub-folders\n" }, { "from": "human", "value": "Pod::Spec.new do |spec|\n spec.name = 'SNSServices'\n spec.version = '0.1.0'\n spec.license = { :type => 'BSD' }\n spec.homepage = 'https://github.com/Joohae/SNSServi...
ruby
chosen
[ { "from": "system", "value": "Bump ice_nine dep to ~> 0.5.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nrequire File.expand_path('../lib/equalizer/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.name = 'equalizer'\n gem.version = Equalizer::VERSION.d...
ruby
chosen
[ { "from": "system", "value": "Fix stack level too deep\n" }, { "from": "human", "value": "module RidgepoleRake\n module Bundler\n module Configuration\n def self.prepended(klass)\n klass.class_eval { attr_accessor :bundler }\n end\n\n # @note override\n def initial...
ruby
chosen
[ { "from": "system", "value": "Update Pagy config for version 5\n\nSome variables were renamed.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n# Pagy Variables\n# See https://ddnexus.github.io/pagy/api/pagy#variables\nPagy::VARS[:items] = 100\n\n# Items extra: Allow the clie...
ruby
chosen
[ { "from": "system", "value": "Fix default setting for styles\n" }, { "from": "human", "value": "# encoding: utf-8\n\nmodule Sass::Script::Functions\n def settings_style(setting)\n assert_type setting, :String\n return_value = ActiveRecord::Base.connection.table_exists?('settings') ? Setti...
ruby
chosen
[ { "from": "human", "value": "Test Person class against real data\n\nTests Person against Estonia data\n" }, { "from": "gpt", "value": "require 'test_helper'\n\nclass PersonTest < Minitest::Test\n def persons\n @persons ||= Everypolitician::Popolo.read('test/fixtures/estonia-ep-popolo-v1.0.js...
ruby
chosen
[ { "from": "system", "value": "Add default values to core API configuration [SCI-4098]\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nRails.application.configure do\n config.x.core_api_sign_alg = ENV['CORE_API_SIGN_ALG'] if ENV['CORE_API_SIGN_ALG']\n\n config.x.core_api_tok...
ruby
chosen
[ { "from": "system", "value": "Test for button being called Register\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'registration with invites', :type => :feature do\n before { @onceoff = Invite.create(:description => 'Test') }\n\n it 'should let me register an account wi...
ruby
chosen
[ { "from": "system", "value": "Increase the gem dependency and version to 0.7.0\n" }, { "from": "human", "value": "# Copyright (C) 2014 Continuent, Inc.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. Yo...
ruby
chosen
[ { "from": "system", "value": "Enable auto traversal for full results list\n" }, { "from": "human", "value": "class User < ActiveRecord::Base\n has_many :access_tokens, dependent: :delete_all\n has_many :reminders, dependent: :delete_all\n\n # Public: Find or create user from github payload\n ...
ruby
chosen
[ { "from": "system", "value": "Clean up gross debug logic\n" }, { "from": "human", "value": "module Bonz\n module MatGeneralMixin\n extend self\n\n def included(mod)\n mod.include(InstanceMethods)\n mod.extend(ClassMethods)\n end\n\n module InstanceMethods\n # @see fil...
ruby
chosen
[ { "from": "system", "value": "Stop heartbeat sender on any exception it encounters\n" }, { "from": "human", "value": "require \"thread\"\nrequire \"amq/protocol/client\"\nrequire \"amq/protocol/frame\"\n\nmodule Bunny\n class HeartbeatSender\n\n #\n # API\n #\n\n def initialize(tran...
ruby
chosen
[ { "from": "human", "value": "Add rake task to generate CSV(s) for tagathons\n\nWe've repurposed the rake task that was introduced for the transport\ntagathon. For a given list of organisations, we extract all of the\ncontent that the organisation is the primary publisher and save it to a\nCSV named after th...
ruby
chosen
[ { "from": "system", "value": "Allow for pre-release gem versions.\n" }, { "from": "human", "value": "#######################################################################################################\n# Substantial portions of this code were adapted from the Radiant CMS project (http://radi...
ruby
chosen
[ { "from": "system", "value": "Reset config when Redis URL changes\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Sugar\n class << self\n attr_writer :redis\n\n def aws_s3?\n if config.amazon_aws_key &&\n config.amazon_aws_secret &&\n config...
ruby
chosen
[ { "from": "system", "value": "Order methods of Gaku::Config better\n" }, { "from": "human", "value": "# encoding: utf-8\n\nmodule Gaku\n class Config\n attr_accessor :deck_root, :initial_distance\n attr_writer :monochrome, :utf8\n\n def monochrome?\n !!@monochrome\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Add logging and chnageable browser\n" }, { "from": "human", "value": "require 'selenium-webdriver'\n\nclass GogoDriver\n attr_accessor :driver\n\n def initialize\n @driver = Selenium::WebDriver.for(:chrome)\n end\n\n def go(url)\n @driver.navigate.to(url)\...
ruby
chosen
[ { "from": "human", "value": "Add specs for the RUBYLIB environment variable\n" }, { "from": "gpt", "value": "require_relative '../spec_helper'\n\ndescribe \"The RUBYLIB environment variable\" do\n before (:each) do\n @rubylib, ENV[\"RUBYLIB\"] = ENV[\"RUBYLIB\"], nil\n end\n\n after (:each...
ruby
chosen
[ { "from": "system", "value": "Make category active for article view\n" }, { "from": "human", "value": "class Reader < Base\n helpers Sinatra::Nedry\n\n injected :clock, System::Clock\n\n get \"/\" do\n redirect to(\"/home\")\n end\n\n get \"/home\" do\n flagged! do\n articles = s...
ruby
chosen
[ { "from": "system", "value": "Make sure Capistrano knows about RAILS_RELATIVE_URL_ROOT when it compiles assets\n" }, { "from": "human", "value": "set :branch, 'rails-upgrade'\nset :rvm_ruby_version, '2.2.0@ridepilot'\nset :deploy_to, '/home/deploy/rails/ridepilot'\nset :rails_env, 'staging'\nser...
ruby
chosen
[ { "from": "system", "value": "Apply icons to the main nav entries.\n" }, { "from": "human", "value": "Islay::Engine.extensions.register do |e|\n e.namespace :islay_shop\n\n # Navigation\n e.nav_entry('Products', :catalogue)\n e.nav_entry('Orders', :orders)\nend\n" }, { "from": "gpt",...
ruby
chosen
[ { "from": "system", "value": "Update ActiveMocker Gem Version check\n" }, { "from": "human", "value": "# frozen_string_literal: true\nRSpec.describe \"Gemfile Version Match\" do\n it \"rails_4.0.gemfile.lock\" do\n file = File.join(File.expand_path(\"../../\", __FILE__), \"test_rails_4_app/g...
ruby
chosen
[ { "from": "system", "value": "Add URL to model's JSON output\n" }, { "from": "human", "value": "class Test < ActiveRecord::Base\n after_initialize :default_values\n after_create :create_key\n belongs_to :run\n default_scope { order('created_at ASC') }\n dragonfly_accessor :screenshot\n dra...
ruby
chosen
[ { "from": "system", "value": "Use user_id only when triggering Sidekiq.\n" }, { "from": "human", "value": "module SyncHelper\n def sync_user(user)\n unless user.is_syncing?\n if Travis::Features.enabled_for_all?(:sync_via_sidekiq)\n Travis::Sidekiq::SynchronizeUser.perform_async(...
ruby
chosen
[ { "from": "system", "value": "Fix post mailer class name\n\n[#89850862]\n" }, { "from": "human", "value": "class GameMailer < ActionMailer::Base\n default from: \"uro@fantasygame.pl\"\n\n def notify_user(user, post)\n @user = user\n @post = post\n @game = post.game\n @campaign = ga...
ruby
chosen
[ { "from": "system", "value": "Add pry, because it's awesome\n" }, { "from": "human", "value": "lib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'beans/version'\n\nGem::Specification.new do |spec|\n spec.name = 'beans'\n spec....
ruby
chosen
[ { "from": "system", "value": "Split on null chars not newline\n" }, { "from": "human", "value": "module CC\n module Analyzer\n class Filesystem\n\n def initialize(root)\n @root = root\n end\n\n def exist?(path)\n File.exist?(path_for(path))\n end\n\n de...
ruby
chosen
[ { "from": "system", "value": "Fix incorrect call to prepend\n" }, { "from": "human", "value": "module ApplicationHelper\n def getYear\n if params[:year]\n @choosen_year = params[:year]\n else\n @choosen_year = DateTime.now.year\n end\n end\n\n def format_url(url)\n if ur...
ruby
chosen
[ { "from": "system", "value": "Fix exception in gallery_referer? helper, if referer nil.\n" }, { "from": "human", "value": "module ApplicationHelper\n def absolute_url(relative_url)\n relative_url = url_for(relative_url) unless relative_url.is_a? String\n (URI(request.url) + relative_url)....
ruby
chosen
[ { "from": "system", "value": "Update variable-methods.rb file to include my refleciton and links to exercise solution files\n" }, { "from": "human", "value": "\n# Full name greeting mini-challenge\n\nputs 'What\\'s your first name?'\nfirst_name = gets.chomp\nputs 'What\\'s your middle name?'\nmi...
ruby
chosen
[ { "from": "system", "value": "Fix bad data during migration\n" }, { "from": "human", "value": "class MakeCanPlayConcurrentlyDefaultFalse < ActiveRecord::Migration[5.2]\n def up\n change_column :events, :can_play_concurrently, :boolean, null: false, default: false\n end\n\n def down\n ch...
ruby
chosen
[ { "from": "system", "value": "Remove debug and set class variable include_root_in_json\n" }, { "from": "human", "value": "module Sendvia\n class Base < ActiveResource::Base\n self.include_format_in_path = false\n self.primary_key = :Id\n\n REST_API_ENDPOINT = 'https://www.sendvia.co.uk...
ruby
chosen
[ { "from": "system", "value": "Add 'require \"spring/watcher/abstract\"' to fix isolated unit test.\n" }, { "from": "human", "value": "module Spring\n module Watcher\n class Polling < Abstract\n attr_reader :mtime\n\n def initialize(root, latency)\n super\n @mtime = 0...
ruby
chosen
[ { "from": "system", "value": "Remove default command for individual items.\n" }, { "from": "human", "value": "module Swa\n module CLI\n\n module ItemBehaviour\n\n def self.included(target)\n\n target.default_subcommand = \"summary\"\n\n target.subcommand [\"summary\", \"s\...
ruby
chosen
[ { "from": "system", "value": "Use the home view on the index route\n" }, { "from": "human", "value": "require 'json'\n\nrequire 'tic_tac_toe'\nrequire 'tic_tac_toe/views'\n\nmodule TicTacToe\n\n class RackShell\n\n def self.new_shell\n return RackShell.new\n end\n\n def call(env)\...
ruby
chosen
[ { "from": "system", "value": "Fix `env` deprecated in Rails 5.0\n\nI found it at the very bottom of the `test-consumer-features` CI build\njob. See: https://github.com/rails/rails/issues/23294.\n" }, { "from": "human", "value": "# For the API\nActionController::Metal.class_eval do\n def spree_c...
ruby
chosen
[ { "from": "system", "value": "Add link to github page.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/form_object_model/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Sean Geoghegan\"]\n gem.email = [\"sea...
ruby
chosen
[ { "from": "system", "value": "Fix forgotten ':' for symbol\n" }, { "from": "human", "value": "require 'time'\n\nmodule AmazonDrs\n class Base\n attr_accessor :request_id, :date, :error_type, :error_description_url\n\n def initialize(response)\n @response = response\n parse_heade...
ruby
chosen
[ { "from": "system", "value": "Remove deprecation warning of filter object\n" }, { "from": "human", "value": "require 'rails-observers'\n\nmodule Audited\n class Sweeper < ActiveModel::Observer\n observe Audited.audit_class\n\n def before(controller)\n self.controller = controller\n ...
ruby
chosen
[ { "from": "system", "value": "Handle absolute URIs (happens with Rails)\n" }, { "from": "human", "value": "require 'net/http'\nrequire 'rack'\nrequire 'rack/handler/mongrel'\n\nclass Capybara::Server\n attr_reader :app\n \n def initialize(app)\n @app = app\n end\n \n def port\n 8080\...
ruby
chosen
[ { "from": "human", "value": "Add RSpec DSL for working with a ChefZero server\n" }, { "from": "gpt", "value": "require 'thin'\nrequire 'tempfile'\nrequire 'chef_zero/server'\nrequire 'chef/config'\n\nmodule ChefZero\n module RSpec\n def when_the_chef_server(description, &block)\n contex...
ruby
chosen
[ { "from": "human", "value": "Add multi life downloading example\n" }, { "from": "gpt", "value": "# encoding: utf-8\n\nrequire 'tty-spinner'\nrequire 'pastel'\n\npastel = Pastel.new\nspinners = TTY::Spinner::Multi.new(\"[:spinner] Downloading files...\")\n\n['file1', 'file2', 'file3'].each do |fi...
ruby
chosen
[ { "from": "system", "value": "Use legacy options hash signature\n\nTime to party like it's 2007!\n\n...until we get this working :sob:\n" }, { "from": "human", "value": "module Rbac\n class Authorizer\n include Vmdb::Logging\n\n def self.role_allows(*args)\n new.role_allows(*args)\n ...
ruby
chosen
[ { "from": "system", "value": "Fix up the packet transformation - type is probably still not 100% correct\n" }, { "from": "human", "value": "require 'rbcoremidi.bundle'\n\nmodule CoreMIDI\n module API\n MidiPacket = Struct.new(:timestamp, :data)\n end\n\n # Unused, but left here for documen...
ruby
chosen
[ { "from": "system", "value": "Add comments on find and images methods on Person.\n" }, { "from": "human", "value": "module TMDb\n class Person < Base\n extend Searchable\n\n # Person attributes\n ATTRIBUTES = :id, :adult, :also_known_as, :biography, :birthday, :deathday,\n ...
ruby
chosen
[ { "from": "system", "value": "Update Weatherjp::City for new xml\n" }, { "from": "human", "value": "module WeatherJp\n class City < Struct.new(:name, :area_code)\n alias_method :to_s, :name\n end\nend\n" }, { "from": "gpt", "value": "module WeatherJp\n class City\n attr_read...
ruby
chosen
[ { "from": "system", "value": "Increase aruba timeout to allow for jRuby startup\n" }, { "from": "human", "value": "require 'aruba/cucumber'\n\nBefore do\n @dirs = [\"features/xml\"]\nend\n" }, { "from": "gpt", "value": "require 'aruba/cucumber'\n\nBefore do\n @dirs = [\"features/xm...
ruby
chosen
[ { "from": "system", "value": "[MISC] Move the credits for the timestamp function into its section-header comment\n" }, { "from": "human", "value": "#\n# Ruby functions\n#\n# @author 'Hopper' <http://stackoverflow.com/users/1026353/hopper>\n# @link http://stackoverflow.com/questions/13022461/add-...
ruby
chosen
[ { "from": "system", "value": "Fix the framework naming issue preventing pod install in swift to find the source\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n\n# Root specification\n\ns.name = \"box-ios-browse-sdk\"\ns.version = \"1.0.4\"\ns.summary ...
ruby
chosen
[ { "from": "system", "value": "Delete apps that does not free\n" }, { "from": "human", "value": "mas 'Popclip' { app_id '445189367' }\nmas 'Reeder' { app_id '880001334' }\nmas 'SafariMarkdownLinker' { app_id '1289119450' }\nmas 'bookmarker for pinboard' { app_id '1451400394' }\n" }, { "fr...
ruby
chosen
[ { "from": "system", "value": "Add multi-outcome event to seed data.\n" }, { "from": "human", "value": "# This file should contain all the record creation needed to seed the database with its default values.\n# The data can then be loaded with the rake db:seed (or created alongside the db with db...
ruby
chosen
[ { "from": "system", "value": "Make sure Time is loaded\n" }, { "from": "human", "value": "module Circle\n module CLI\n class Model\n TIME_FORMAT = '%-b %-e, %-l:%M %p'\n\n STATUS_COLORS = {\n green: %w(fixed success),\n yellow: %w(running retried not_run queued schedu...
ruby
chosen
[ { "from": "system", "value": "Fix week for columns other than created_at\n" }, { "from": "human", "value": "module Dateslices\n module Mysql\n\n def self.time_filter(column, field)\n case field\n when :hour_of_day\n \"(EXTRACT(HOUR from #{column}))\"\n when :day_o...
ruby
chosen
[ { "from": "system", "value": "Increase upload file size for audit certificates\n" }, { "from": "human", "value": "class AuditCertificate < ActiveRecord::Base\n include ShortlistedDocument\n include Reviewable\n\n begin :validations\n validates :attachment, presence: true,\n ...
ruby
chosen
[ { "from": "system", "value": "Add most basic critical= specs and guard for 1.9.\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + '/../../spec_helper'\nrequire File.dirname(__FILE__) + '/fixtures/classes'" }, { "from": "gpt", "value": "require File.dirname(__FILE__)...
ruby
chosen
[ { "from": "system", "value": "Hide the implementation of campaign_class\n\nSetting campaign class should be a private affair\n" }, { "from": "human", "value": "class EmergencyBanner\n def initialize\n @redis = Redis.new\n end\n\n def enabled?\n content && has_campaign_class?\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Include published_at in active scope\n" }, { "from": "human", "value": "class Album < ActiveRecord::Base\n has_many :photos, inverse_of: :album\n belongs_to :cover_photo, class_name: 'Photo'\n\n before_create :generate_slug\n\n scope :active, -> { where.not(cove...
ruby
chosen
[ { "from": "system", "value": "Fix GitHub OAuth e2e spec\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'capybara/dsl'\n\nmodule QA\n module Vendor\n module Github\n module Page\n class Login < Page::Base\n def login\n fill_in 'logi...
ruby
chosen
[ { "from": "human", "value": "Add a recipe that cleans up ACLs for those who did the \"add clients to admins group\" thing\n" }, { "from": "gpt", "value": "# Remove clients from the admins group\nchef_group 'admins' do\n remove_groups 'clients'\nend\n\nvalid_nodes = search(:node, '*:*').map { |n...
ruby
chosen
[ { "from": "system", "value": "Convert ruby_block to a true LWRP\n\nSigned-off-by: Tim Smith <tsmith@chef.io>\n\nFormer-commit-id: 2108f4269fdb5f77bb83bc940483a77965617585" }, { "from": "human", "value": "action :create do\n ruby_block \"create / update Rundeck project #{new_resource.name}\" do\...
ruby
chosen
[ { "from": "system", "value": "Exclude an asset file from a gem package.\n\nExclude an asset movie file from a gem package.\nA movie file is too large to include in a gem package file.\n\nSome other properties are changed to more appropriate values.\n" }, { "from": "human", "value": "# coding: ut...
ruby
chosen
[ { "from": "system", "value": "Increase the number of cache refreshes for taxonomy\n\nThis will make it easier to observe the behaviour. Once we're confident\nthis works we can dial down the frequency.\n\nhttps://trello.com/c/fsehBQ7s\n" }, { "from": "human", "value": "# default cron env is \"/us...
ruby
chosen
[ { "from": "system", "value": "Fix elasticsearch connection in dev\n" }, { "from": "human", "value": "Rails.application.configure do\n # Settings specified here will take precedence over those in config/application.rb.\n\n # In the development environment your application's code is reloaded on\...
ruby
chosen
[ { "from": "system", "value": "Make gem installable with fluentd 0.12.x versions as well\n" }, { "from": "human", "value": "# encoding: utf-8\n$:.push File.expand_path('../lib', __FILE__)\n\nGem::Specification.new do |gem|\n gem.name = 'fluent-plugin-graphite'\n gem.version = '0.0.5'...
ruby
chosen
[ { "from": "system", "value": "Raise exception if nested file will never be found\n\nIt is possible to give autoload an invalid path, and that issue will\nnever be found until the associated constant is vivified. This causes\nissues where people forget to remove the require_nested calls when they\nremove th...
ruby
chosen
[ { "from": "system", "value": "Insert the middleware absolutely first in the stack, instead of after Rack::Lock.\n\nThis addresses : https://github.com/Octo-Labs/heroku-request-id/issues/1\n" }, { "from": "human", "value": "module HerokuRequestId\n class Railtie < Rails::Railtie\n initializer...
ruby
chosen
[ { "from": "system", "value": "Add TODO before we forget\n" }, { "from": "human", "value": "require 'openid_connect'\n\nmodule OpenIDTokenProxy\n class Config\n attr_accessor :client_id, :client_secret, :issuer, :redirect_uri, :resource\n attr_accessor :authorization_endpoint, :token_endpo...
ruby
chosen
[ { "from": "system", "value": "Add YARD docs to ClassBuilder support class\n" }, { "from": "human", "value": "module ROM\n class ClassBuilder\n include Options\n\n option :name, type: String, reader: true\n option :parent, type: Class, reader: true, parent: Object\n\n def call\n ...
ruby
chosen
[ { "from": "system", "value": "Add actionpack 3.0.7 to development dependencies\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"bldr/version\"\n\nGem::Specification.new do |s|\n s.name = \"bldr\"\n s.version = Bl...
ruby
chosen
[ { "from": "system", "value": "Use plain Ruby to select files 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 \"lasp/version\"\n\nGem::Specification.new do |spec|\n spec....
ruby
chosen
[ { "from": "system", "value": "Add rake dependency to gemspec\n\nBundler complains when running `bundle exec rake` without rake in\ngemspec/Gemfile.\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'jekyll-asciidoc'\n s.version = '1.0.0'\n s.summary = 'A Jekyll plugi...
ruby
chosen
[ { "from": "system", "value": "Add 10.9 to list of supported OS X releases\n" }, { "from": "human", "value": "require \"boxen/preflight\"\n\nclass Boxen::Preflight::OS < Boxen::Preflight\n def ok?\n `sw_vers -productVersion`.start_with? \"10.8\"\n end\n\n def run\n abort \"You must be ru...
ruby
chosen
[ { "from": "system", "value": "Remove unneeded CloudCostTracker static class method" }, { "from": "human", "value": "require 'active_record'\nrequire 'logger'\n\n# Load all ruby files from 'cloud_cost_tracker' directory\nDir[File.join(File.dirname(__FILE__), \"cloud_cost_tracker/**/*.rb\")].each ...
ruby
chosen
[ { "from": "system", "value": "Update the Post counter caches when adding the counter cache column\n" }, { "from": "human", "value": "class CounterCacheOnPostLikes < ActiveRecord::Migration\n def self.up\n add_column :posts, :likes_count, :integer, :default => 0\n end\n\n def self.down\n ...
ruby
chosen
[ { "from": "human", "value": "Add migration for new heat loss key\n\nCommit message from old key is taken\nDemand is set to zero for all datasets with old key\n" }, { "from": "gpt", "value": "class SetNewHeatLossesToZero < ActiveRecord::Migration[5.0]\n def up\n\n old_key = \"energy_heat_netw...
ruby
chosen
[ { "from": "system", "value": "Update migration to include TaxRate model\n" }, { "from": "human", "value": "class AddIncludedToAdjustments < ActiveRecord::Migration\n class Spree::Adjustment < ActiveRecord::Base\n belongs_to :originator, polymorphic: true\n end\n\n def up\n add_column :s...
ruby
chosen
[ { "from": "system", "value": "Use an Array to store actions\n" }, { "from": "human", "value": "module Deptree\n class Dependency\n\n attr_reader :name\n attr_reader :prerequisites\n attr_reader :actions\n\n def initialize(name, prerequisites = [])\n @name = name\n @prerequ...
ruby
chosen
[ { "from": "system", "value": "Update description of the new_format parameter\n" }, { "from": "human", "value": "class EditionDuplicator\n attr_accessor :existing_edition, :actor, :error_message, :new_edition\n\n # existing_edition: The existing edition to be duplicated\n # actor: T...
ruby
chosen
[ { "from": "system", "value": "Update syntax for middleware.insert_before to support rails 5\n" }, { "from": "human", "value": "require 'eeny-meeny'\nrequire 'eeny-meeny/experiment_helper'\nrequire 'eeny-meeny/middleware'\n\nmodule EenyMeeny\n class Railtie < Rails::Railtie\n config.eeny_meen...
ruby
chosen
[ { "from": "system", "value": "Add top level comments for queue\n" }, { "from": "human", "value": "module Yars\n class AtomicQueue\n attr_reader :size\n\n def initialize\n @head = Node.new pred: @tail\n @tail = Node.new succ: @head\n @size = 0\n end\n\n def <<(data)\n ...
ruby
chosen
[ { "from": "system", "value": "Add YARD docs to Rutty::Runner\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'rutty/actions'\nrequire 'rutty/config'\nrequire 'rutty/consts'\nrequire 'rutty/errors'\nrequire 'rutty/helpers'\nrequire 'rutty/node'\nrequire 'rutty/nodes'\n\nmodule Rutt...
ruby
chosen
[ { "from": "system", "value": "Fix typo in rake task.\n" }, { "from": "human", "value": "module Rapper\n \n # Rake tasks for building / refreshing packages\n class Tasks\n \n # Set up rapper asset packaging Rake tasks.\n # \n # @param [Symbol] namespace The Rake namespace to put th...
ruby
chosen
[ { "from": "system", "value": "Remove explicit namespace from Attribute spec\n\nUnnecessary since the spec itself is wrapped in the namespace.\n" }, { "from": "human", "value": "require 'perpetuity/attribute'\n\nmodule Perpetuity\n describe Attribute do\n subject { Perpetuity::Attribute.new :...
ruby
chosen
[ { "from": "system", "value": "Change comment to be more precise\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'thread_safe'\n\nrequire 'memoizable/instance_methods'\nrequire 'memoizable/module_methods'\nrequire 'memoizable/memory'\nrequire 'memoizable/version'\n\n# Allow method...
ruby
chosen
[ { "from": "system", "value": "Support for multiple options through hash syntax.\n" }, { "from": "human", "value": "require \"shellwords\"\n\nclass Pygmentize\n VERSION = \"0.0.3\"\n\n def self.bin\n \"/usr/bin/env python #{File.expand_path(\"../vendor/pygmentize.py\", File.dirname(__FILE__)...
ruby
chosen
[ { "from": "system", "value": "Fix Payload on Ruby 1.9" }, { "from": "human", "value": "require 'ostruct'\n\nmodule Qu\n class Payload < OpenStruct\n include Logger\n\n undef_method :id\n\n def initialize(options = {})\n super\n self.args ||= []\n end\n\n def klass\n ...
ruby
chosen
[ { "from": "system", "value": "Fix for new SQLite adapter name\n" }, { "from": "human", "value": "# Container module for all SQL:Origin methods.\n\nmodule SQLOrigin\n # Paths or path prefixes that are filtered from the backtrace.\n LIBRARY_PATHS = %w(\n vendor\n )\n\n # @return [Array<Stri...
ruby
chosen
[ { "from": "system", "value": "Upgrade hard_reset for postgres && sqlite" }, { "from": "human", "value": "#coding: utf-8\nnamespace :db do\n desc \"Hard development sqlite3 reset && seed\"\n task :hard_reset do\n file_name = 'db/development.sqlite3'\n print \"[del] #{file_name}\"\n ...
ruby
chosen
[ { "from": "human", "value": "Add Google Play Music Desktop Player.app v3.0.0\n" }, { "from": "gpt", "value": "cask 'google-play-music-desktop-player' do\n version '3.0.0'\n sha256 '7196a2a6e179ec085c33849e735a6f6725b009d0415cf7c19f4f2dfd199ec7a3'\n\n # github.com/MarshallOfSound/Google-Play-M...
ruby
chosen
[ { "from": "system", "value": "Set absolute path for input file.\n" }, { "from": "human", "value": "#!/usr/bin/ruby\n# -*- mode: ruby -*-\n# $Id: wc-ruby.code,v 1.4 2004/11/13 07:43:32 bfulgham Exp $\n# http://www.bagley.org/~doug/shootout/\n# with help from Paul Brannan\n\n500.times do\n\n inpu...
ruby
chosen
[ { "from": "system", "value": "Fix multisite test breakage due to changes in use of flash.\n" }, { "from": "human", "value": "require \"#{File.dirname(__FILE__)}/../test_helper\"\n\nclass MultisiteTest < ActionController::IntegrationTest\n def setup\n Setting.set_global('Features', 'Multisite...
ruby
chosen
[ { "from": "system", "value": "Fix raise error due to order of `require`\n" }, { "from": "human", "value": "require 'gimei/version'\nrequire 'gimei/name'\nrequire 'gimei/address'\nrequire 'yaml'\nrequire 'forwardable'\n\nclass Gimei\n extend Forwardable\n\n NAMES = YAML.load_file(File.expand_pa...
ruby
chosen
[ { "from": "system", "value": "Make RobotsController inherit from ActionController::Base\n" }, { "from": "human", "value": "#\n# == RobotsController\n#\nclass RobotsController < ApplicationController\n layout false\n\n def index\n expires_in 12.hours, public: true\n\n if Rails.env.product...
ruby
chosen
[ { "from": "human", "value": "Add unit tests for sys::nsswitch\n" }, { "from": "gpt", "value": "describe 'sys::nsswitch' do\n\n context \"node['sys']['nsswitch'] is empty\" do\n let(:chef_run) { ChefSpec::SoloRunner.new.converge(described_recipe) }\n\n it 'does nothing' do\n expect(ch...
ruby
chosen
[ { "from": "system", "value": "Change Type.constraint to not accept a nil value\n" }, { "from": "human", "value": "# encoding: utf-8\n\nmodule Axiom\n module Types\n\n # Abstract base class for every type\n class Type\n extend Options, DescendantsTracker\n\n accept_options :const...
ruby
chosen
[ { "from": "system", "value": "Update error message to be more clear\n" }, { "from": "human", "value": "# encoding: utf-8\n\nmodule Axiom\n module Types\n\n # Abstract base class for every type\n class Type\n extend Options, DescendantsTracker\n\n accept_options :constraint\n ...
ruby
chosen
[ { "from": "system", "value": "Switch to using tr rather than gsub\n\nAs gsub isn't necessary.\n" }, { "from": "human", "value": "module Analytics\n class IndexPage\n attr_reader :link_changes\n\n def initialize(params = {link_types: ['taxons']})\n @link_changes = get_link_changes(par...
ruby
chosen
[ { "from": "system", "value": "Fix local file count (exclude directories)." }, { "from": "human", "value": "require 'find'\n\nclass FilesForBackup\n def initialize(backup_folder, backup_folder_excludes)\n @backup_folder = backup_folder\n @backup_folder_excludes = backup_folder_excludes\n ...
ruby
chosen
[ { "from": "system", "value": "Remove append for creating a new service\n" }, { "from": "human", "value": "class App\n get '/' do\n erb :index\n end\n\n get '/servers' do\n @servers = Server.all;\n content_type :json\n @servers.to_json\n end\n\n post '/servers' do\n server_par...
ruby
chosen