conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Use multipackage from Chef 12\n" }, { "from": "human", "value": "#\n# Cookbook Name:: smith-packages\n# Recipe:: default\n#\n# Copyright 2013-2015, Tim Smith\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except ...
ruby
chosen
[ { "from": "human", "value": "Add rake task to populate topic taxons with legacy taxons.\n" }, { "from": "gpt", "value": "desc \"Populate legacy_taxons links for each topic taxon according to a CSV\"\ntask :load_legacy_mappings, [:csv_path] => :environment do |_t, args|\n mapping = Hash.new { |h...
ruby
chosen
[ { "from": "system", "value": "Simplify and add some things\n" }, { "from": "human", "value": "require 'i18n-backoffice/version.rb'\nrequire 'i18n'\nrequire 'redis'\nrequire 'i18n-backoffice/hash'\n\nmodule I18n\n module Backoffice\n autoload :Config, 'i18n-backoffice/config'\n\n extend(Mo...
ruby
chosen
[ { "from": "system", "value": "Move PlaylistHandler up a module level.\n" }, { "from": "human", "value": "require 'bra/driver_common/requests/url_hash_handler'\n\nmodule Bra\n module DriverCommon\n module Requests\n module Handlers\n # Base class for handlers that handle requests ...
ruby
chosen
[ { "from": "system", "value": "Make sure SpecController is not loaded before trying to load\n" }, { "from": "human", "value": "module Ember::Appkit::Rails::Teaspoon::SpecController\n def self.prepended(mod)\n mod.send(:before_filter, :extend_view_path)\n end\n\n def extend_view_path\n ap...
ruby
chosen
[ { "from": "human", "value": "Add RStudio daily build cask\n\nThe RStudio daily build is the fresher, more dangerous version of rstudio-preview\n" }, { "from": "gpt", "value": "cask :v1 => 'rstudio-daily' do\n version :latest\n sha256 :no_check\n\n url 'http://www.rstudio.org/download/latest/d...
ruby
chosen
[ { "from": "system", "value": "Add OS X support to Podfile, bump version to 1.0.1\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"DANCurlRequest\"\n s.version = \"1.0.0\"\n s.summary = \"Easily log NSURLRequest's as curl commands\"\n\ts.homepa...
ruby
chosen
[ { "from": "system", "value": "Make gem spec so it will build\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'omniauth/jobrocket/version'\n\nGem::Specification.new do |spec|\n spec.n...
ruby
chosen
[ { "from": "system", "value": "Copy updated_at to original_updated_at for existing records\n" }, { "from": "human", "value": "class AddPostsOriginalUpdatedAt < ActiveRecord::Migration\n def change\n add_column :posts, :original_updated_at, :datetime\n end\nend\n" }, { "from": "gpt", ...
ruby
chosen
[ { "from": "system", "value": "Fix a bug where it would always say \"Logged in successfully\" even when\nthey weren't logged in successfully.\n\nSomewhat confusingly, UserSession.create is not the same as\nUserSession.new.save. UserSession.create will return a UserSession\nobject (such #<UserSession: no cred...
ruby
chosen
[ { "from": "system", "value": "Revert \"Provide relative config path.\"\n\nThis reverts commit 24b7c8cd314213319c04b8b6064ecf2e0ee0b504.\n" }, { "from": "human", "value": "Capistrano::Configuration.instance(:must_exist).load do\n def unicorn_conf\n fetch(:unicorn_conf, 'config/unicorn.rb')\n ...
ruby
chosen
[ { "from": "system", "value": "Add option to control name of env vars\n" }, { "from": "human", "value": "require \"stairs\"\n\nmodule Stairs\n module Steps\n class S3 < Stairs::Step\n title \"S3\"\n description \"Setup AWS and S3 bucket access\"\n\n def run\n env \"AWS_A...
ruby
chosen
[ { "from": "system", "value": "Fix fetching times for sessions\n" }, { "from": "human", "value": "namespace :woo_api do\n task load_spots: :environment do\n WooApi::ExploreApi::Spot.all.each do |api_spot|\n Spot.find_or_initialize_by_api_data(api_spot).save\n end\n end\n\n task load...
ruby
chosen
[ { "from": "system", "value": "Add rate_limit attribute to Twitter::Request\n\nReferences https://github.com/sferik/twitter/pull/626.\n" }, { "from": "human", "value": "require 'twitter/cursor'\n\nmodule Twitter\n class Request\n attr_accessor :client, :request_method, :path, :options\n al...
ruby
chosen
[ { "from": "system", "value": "Refactor { mode: :board } into an options hash." }, { "from": "human", "value": "module Ctrlo\n class RefreshAll\n def initialize\n end\n\n def self.perform\n new.perform\n end\n\n def perform\n external_board_ids.map do |id|\n Exter...
ruby
chosen
[ { "from": "system", "value": "Check ActiveRecord version and use name\n" }, { "from": "human", "value": "require \"active_record/base\"\n\nmodule DocumentNumber\n class Numerator\n def self.next_number(object, options)\n DocumentNumber.transaction do\n if ::Rails.version < \"4.0\...
ruby
chosen
[ { "from": "system", "value": "Use IPAddr to convert integer to IPAddr, instead of some hack.\n" }, { "from": "human", "value": "IPAddr.class_eval do\n # hack so == doesn't blow up when passed false\n def ==(other)\n return false if other.kind_of?(TrueClass) || other.kind_of?(FalseClass)\n\n...
ruby
chosen
[ { "from": "system", "value": "Use the method body as a begin/end block\n\nThis one saves the need of explicit begin/enusure/end in the\nnew_uninitialized_app test helper.\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass WebConsoleTest < ActiveSupport::TestCase\n test 'different...
ruby
chosen
[ { "from": "system", "value": "Fix for Mongoid 2.0 support\n" }, { "from": "human", "value": "module Mongoid\n class Counter\n include Components\n end\n \n class Identity \n def generate_id\n table_name = @document.class.to_s.tableize\n o = Counter.collection.find_and_...
ruby
chosen
[ { "from": "system", "value": "Use `mkdir_p` since tmp dir may not exist" }, { "from": "human", "value": "module Npm\n module Rails\n class PackageManager\n\n def self.build(root_path, package_file, env)\n package_file_path = \"#{ root_path }/#{ package_file }\"\n packages ...
ruby
chosen
[ { "from": "system", "value": "Update column name on percentages table\n" }, { "from": "human", "value": "class CreatePercentages < ActiveRecord::Migration\n def change\n create_table :percentages do |t|\n t.integer :percentage\n\n t.timestamps null: false\n end\n end\nend\n" ...
ruby
chosen
[ { "from": "system", "value": "Remove unused commented code from example app\n" }, { "from": "human", "value": "## Test app for Framework\nclass MyApp < Flame::Application\n\t# get '/' do\n\t# \tview :index\n\t# end\n\t#\n\t# get '/users' do\n\t# \tview 'users/index'\n\t# end\n\t#\n\t# post '/use...
ruby
chosen
[ { "from": "system", "value": "Convert remaining github tarball URLs to archive URLs\n" }, { "from": "human", "value": "require 'formula'\n\nclass Openmeeg < Formula\n homepage 'http://www-sop.inria.fr/athena/software/OpenMEEG/'\n url 'https://github.com/openmeeg/openmeeg/tarball/release-2.1'\n...
ruby
chosen
[ { "from": "system", "value": "Handle documents without SVG root elements\n" }, { "from": "human", "value": "module InlineSvg::TransformPipeline::Transformations\n class Title < Transformation\n def transform(doc)\n doc = Nokogiri::XML::Document.parse(doc.to_html)\n node = Nokogiri:...
ruby
chosen
[ { "from": "system", "value": "Use a more random port\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe LIFX::Transport::UDP do\n subject do\n LIFX::Transport::UDP.new('localhost', 22222)\n end\n\n describe '#write' do\n let(:message) { double }\n let(:payload) { do...
ruby
chosen
[ { "from": "system", "value": "Improve support for calling the function from templates and/or manifests\n" }, { "from": "human", "value": "Puppet::Parser::Functions::newfunction(\n :always_array,\n :type => :rvalue,\n :doc => '\nMakes sure the value is always an array, unless its nil.\n\nIf th...
ruby
chosen
[ { "from": "system", "value": "Use shared examples for array-like behavior\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Verso::EmphasisList do\n use_vcr_cassette :record => :new_episodes\n\n before do\n @emphases = Verso::EmphasisList.new\n end\n\n describe 'array-l...
ruby
chosen
[ { "from": "system", "value": "Load local seed data without checkin\n" }, { "from": "human", "value": "path = File.dirname(__FILE__)\nconnection = ActiveRecord::Base.connection\nstatements = IO.read(path + '/seeds.sql').split(';').map(&:strip).reject(&:empty?)\n\nActiveRecord::Base.transaction do...
ruby
chosen
[ { "from": "system", "value": "Correct name of method empty to string\n\nSigned-off-by: Gustavo Toshi Komura <4cad6e13d165ce6dbdcf3458fc5cbc27ddef2a34@gmail.com>\n" }, { "from": "human", "value": "module Gemtranslatetoenglish\n class Translatetoenglish\n\n def translate( phrase)\n\n ...
ruby
chosen
[ { "from": "system", "value": "Update ajax call on locations to contain latlng coordinates\n" }, { "from": "human", "value": "get '/projects' do\n @projects = Project.all.shuffle\n erb :'projects/explore', layout: :map_layout\nend\n\nget '/projects/new' do\n erb :'projects/new_project'\nend\n\...
ruby
chosen
[ { "from": "system", "value": "Fix incorrect hash key for Anki type\n" }, { "from": "human", "value": "class WanikaniApi\n def self.fetch_critical(params)\n percentage = params[:argument] || 75\n critical_items = Wanikani::CriticalItems.critical(percentage.to_i)\n end\n\n def self.fetch_...
ruby
chosen
[ { "from": "system", "value": "Print access and secret token\n" }, { "from": "human", "value": "require 'flickraw'\n\n# This is how to authenticate on flickr website.\n# You need an API key for that, see http://www.flickr.com/services/api/keys/\nAPI_KEY=''\nSHARED_SECRET=''\n\nFlickRaw.api_key=AP...
ruby
chosen
[ { "from": "system", "value": "Remove linefeed from og:description for post\n" }, { "from": "human", "value": "module PostDecorator\n def to_meta_description\n plain_text_body.first(140)\n end\n\n def to_og_params\n {\n locale: 'ja_JP',\n type: 'article',\n title: title,\n...
ruby
chosen
[ { "from": "system", "value": "Expand category header on articles\n" }, { "from": "human", "value": "module CategoriesHelper\n def active?(category)\n current_category\n current_page?(category_path(category)) || (category.is_homepage && current_page?(root_path)) ||\n (defined?(@curren...
ruby
chosen
[ { "from": "system", "value": "Fix abilities to see the draft publication section\n" }, { "from": "human", "value": "module Abilities\n class Everyone\n include CanCan::Ability\n\n def initialize(user)\n can [:read, :map], Debate\n can [:read, :map, :summary], Proposal\n can...
ruby
chosen
[ { "from": "system", "value": "Fix versioned options bug for instrument version model\n" }, { "from": "human", "value": "class InstrumentVersion\n attr_accessor :instrument, :version\n\n def method_missing(method, *args, &block)\n if Instrument.method_defined?(method) \n if @version\n ...
ruby
chosen
[ { "from": "system", "value": "Fix - Redundant self detected.\n" }, { "from": "human", "value": "module Spree\n class Subscription < ActiveRecord::Base\n belongs_to :user\n belongs_to :address\n belongs_to :subscription_product\n has_and_belongs_to_many :shipped_products, class_name:...
ruby
chosen
[ { "from": "system", "value": "Add specs for cloud instance display in explorer.\n" }, { "from": "human", "value": "describe VmCloudController do\n render_views\n before :each do\n set_user_privileges\n EvmSpecHelper.create_guid_miq_server_zone\n end\n\n context \"#tree_select\" do\n ...
ruby
chosen
[ { "from": "system", "value": "Fix specs to work with Infinity change to singleton object\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'spec_helper'\nrequire File.expand_path('../fixtures/classes', __FILE__)\n\ndescribe Attribute::Comparable, '#range' do\n subject { object.ran...
ruby
chosen
[ { "from": "system", "value": "Use organization name on welcome message\n" }, { "from": "human", "value": "class UserMailer < ApplicationMailer\n def welcome_email(user, organization)\n build_email user, :welcome, { inline: organization.welcome_email_template }, organization\n end\n\n def w...
ruby
chosen
[ { "from": "human", "value": "Comment out the user test, doesn't seem to be working at all yet\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nrequire(\"test_helper\")\n\nclass Mutations::UserTest < IntegrationTestCase # ActionDispatch::IntegrationTest # ActiveSupport::TestCase\...
ruby
chosen
[ { "from": "system", "value": "Change EntryAccess back to its natural state.\n" }, { "from": "human", "value": "class Entry < ActiveRecord::Base\n self.inheritance_column = nil\n\n Sharing = {\n private: 0,\n anonymous: 50,\n users: 100,\n friends...
ruby
chosen
[ { "from": "system", "value": "Add nested attributes for location in log location\n" }, { "from": "human", "value": "class LogLocation < ActiveRecord::Base\n self.table_name = \"logs_locations\"\n\n belongs_to :log\n belongs_to :location, polymorphic: true\nend\n\n" }, { "from": "gpt",...
ruby
chosen
[ { "from": "system", "value": "Fix acceptance tests with new UI values\n\nSigned-off-by: Mark Huang <222d07b3281cbd31b38f93d23c330586c713e995@pivotal.io>\n" }, { "from": "human", "value": "module Dash\n def dash_route(path = '')\n URI.join ATC_URL, path\n end\n\n def dash_login\n visit d...
ruby
chosen
[ { "from": "system", "value": "Remove the uniqueness validation from the Language model (although it makes sense) to avoid the need to update the entire test suite.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n# == Schema Information\n#\n# Table name: languages\n#\n# id ...
ruby
chosen
[ { "from": "system", "value": "Fix avalara_entity_use_code being required for Spree::User\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule SolidusAvataxCertified\n module Spree\n module UserDecorator\n def self.prepended(base)\n base.belongs_to :avalara_e...
ruby
chosen
[ { "from": "system", "value": "Change pronto dependency version from 0.0.2 to 0.0.3\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path('../lib', __FILE__)\n\nrequire 'pronto/rubocop/version'\n\nGem::Specification.new do |s|\n s.name = 'pronto-rubocop'\n...
ruby
chosen
[ { "from": "system", "value": "Test abstract controller's localize method." }, { "from": "human", "value": "require 'abstract_unit'\n\n# class TranslatingController < ActionController::Base\n# end\n\nclass TranslationControllerTest < ActiveSupport::TestCase\n def setup\n @controller = ActionC...
ruby
chosen
[ { "from": "human", "value": "Add bestkill vs eval game\n" }, { "from": "gpt", "value": "#/usr/bin/env ruby\nrequire './state'\nrequire 'debugger'\n\ngame = State.new\n\ngame.initBoard\n\ngame.printBoard\n\nputs \"bestKillbot (W) vs evalBot(B)\"\n\nwhile not game.gameOver? do\n game.chooseBestKi...
ruby
chosen
[ { "from": "system", "value": "Fix track_inventory on big variant rabl template.\n\nFixes #6149\n" }, { "from": "human", "value": "object @variant\nattributes *variant_attributes\n\ncache [I18n.locale, @current_user_roles.include?('admin'), 'big_variant', root_object]\n\nextends \"spree/api/varia...
ruby
chosen
[ { "from": "human", "value": "Add Facter fact that provides information about file descriptors on the system.\n\nThis fact provides information about file descriptors currently available on\nthe system as follows: total allocated file descriptors since system power-up,\ntotal free file descriptors available ...
ruby
chosen
[ { "from": "system", "value": "Remove assignment for gems Mash.new\n" }, { "from": "human", "value": "gem_server = Mash.new unless attribute?(\"gem_server\")\n\ngem_server[:virtual_hostname] = \"gems.#{domain}\" unless gem_server.has_key?(\"virtual_host\")\ngem_server[:virtual_alias] = \"gems\...
ruby
chosen
[ { "from": "system", "value": "Make access token an option\n" }, { "from": "human", "value": "class DeterminationsController < ApplicationController\n include ActionController::MimeResponds\n include ActionController::HttpAuthentication::Token::ControllerMethods\n\n before_filter :restrict_acc...
ruby
chosen
[ { "from": "system", "value": "Add most_recent_product_slug to user analytics\n" }, { "from": "human", "value": "class UserAnalyticsSerializer < ActiveModel::Serializer\n attributes :created_at, :email, :location, :username, :last_sign_in_at, :last_request_at\n attributes :facebook_uid, :userna...
ruby
chosen
[ { "from": "system", "value": "Add title, presenter, description info back to time slots\n" }, { "from": "human", "value": "\njson.rooms current_event.rooms, :id, :name\njson.days (1..current_event.days).to_a\njson.slots current_event.time_slots, :conference_day, :id, :update_path, :start_time, :...
ruby
chosen
[ { "from": "system", "value": "Add amazon to the gemspec summary for SEO\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$LOAD_PATH.push File.expand_path(\"../lib\", __FILE__)\nrequire \"knife-ec2/version...
ruby
chosen
[ { "from": "system", "value": "Improve application before chain syntax\n" }, { "from": "human", "value": "require 'minitest/autorun'\nrequire_relative '../../../lib/Sandbox/Application'\n\ndescribe Sandbox::Application do\n\n before do\n @application = Sandbox::Application.new\n end\n\n it ...
ruby
chosen
[ { "from": "system", "value": "Create local variable for readability\n" }, { "from": "human", "value": "require 'active_record'\n\nmodule Temping\n ModelAlreadyDefined = Class.new(StandardError)\n\n def self.included(base)\n ActiveRecord::Base.configurations['temping'] = { :adapter => 'sqli...
ruby
chosen
[ { "from": "system", "value": "Fix attributes in fixtures and exemplars\n" }, { "from": "human", "value": "module Terraforming\n\n def exist?(file)\n File.exist?(destination_path(file))\n end\n\n def exemplar?\n options[:exemplar] != false && exist?('spec/exemplars')\n end\n\n def attr...
ruby
chosen
[ { "from": "system", "value": "Fix indentation and add vi/vim markers\n" }, { "from": "human", "value": "require 'thor'\nrequire 'niman/recipe'\nrequire 'niman/provisioner'\n\nmodule Niman\n module CLI\n class Application < Thor\n desc \"apply\", \"Applies a Nimanfile\"\n def apply\...
ruby
chosen
[ { "from": "system", "value": "FIX: Change get tests for group_sets_api\n" }, { "from": "human", "value": "require 'test_helper'\nrequire 'user'\n\nclass GroupSetsApiTest < ActiveSupport::TestCase\n include Rack::Test::Methods\n include TestHelpers::AuthHelper\n include TestHelpers::JsonHelper...
ruby
chosen
[ { "from": "human", "value": "TEST: Add tests for tasks awaiting feedback\n" }, { "from": "gpt", "value": "require 'test_helper'\n\nclass FeedbackTest < ActiveSupport::TestCase\n include Rack::Test::Methods\n include TestHelpers::AuthHelper\n include TestHelpers::JsonHelper\n\n def app\n R...
ruby
chosen
[ { "from": "system", "value": "Fix to support nested accessor on User\n" }, { "from": "human", "value": "require \"ostruct\"\n\nrequire \"faraday\"\nrequire 'faraday_middleware'\n\nrequire \"random_user_generator/configuration\"\nrequire \"random_user_generator/client\"\nrequire \"random_user_gen...
ruby
chosen
[ { "from": "system", "value": "Add indexable_content to the registered fields.\n\nIncluding this field means Panopticon has all the data it needs to\npost the artefact to Rummager directly, rather than having to post an\namendment, which will fail if the item is not already in Rummager's\nindex.\n" }, { ...
ruby
chosen
[ { "from": "system", "value": "Revert \"Try skipping Slimmer in the integration tests.\"\n\nThis reverts commit c9039612ba7e85c8c5b0253bce8cc39853e3ee51.\n" }, { "from": "human", "value": "require 'test_helper'\nrequire 'capybara/rails'\n\nclass ActionController::Base\n before_filter do\n res...
ruby
chosen
[ { "from": "system", "value": "Update test as we will have the client object combine password and token values into password field.\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass TestInitialization < Test::Unit::TestCase\n \n test \"should return initialized client object\" d...
ruby
chosen
[ { "from": "system", "value": "Update Scenario to pass tests\n" }, { "from": "human", "value": "require \"gitmethere/version\"\n\nrequire 'git'\n\nmodule GitMeThere\n\n class Scenario\n\n # All scenarios are automatically generated as a fresh repositorywith a README.md file\n # and an init...
ruby
chosen
[ { "from": "system", "value": "Add streaming classes Support streaming of zip, gzip, encrypted files, user define-able formats etc.\n" }, { "from": "human", "value": "# encoding: UTF-8\nrequire 'mongo'\nrequire 'mongo_ha'\nrequire 'mongo_mapper'\nrequire 'semantic_logger'\nrequire 'rocket_job/ver...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.2.1.0 to 0.3.0.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'messaging'\n s.version = '0.2.1.0'\n s.summary = 'Messaging primitives for Eventide'\n s.description = ' ...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 1.0.0.0 to 1.1.0.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'evt-messaging'\n s.version = '1.0.0.0'\n s.summary = 'Common primitives for platform-specific messaging im...
ruby
chosen
[ { "from": "system", "value": "11992: Handle option sets created at the same second\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass RenameOptionSetNameWhereDuplicates < ActiveRecord::Migration[6.1]\n def up\n OptionSet.find_each do |os|\n sets = OptionSet.where(...
ruby
chosen
[ { "from": "system", "value": "Raise an exception if database.yml does not exist\n" }, { "from": "human", "value": "require 'sinatra/base'\nrequire 'erb'\n\nclass CapTalk < Sinatra::Base\n set :raise_errors, true\n\n get '/' do\n redirect to('/steps/1')\n end\n\n get '/steps/:step' do\n ...
ruby
chosen
[ { "from": "system", "value": "Enhance InMemory::Model in the no AR example app\n" }, { "from": "human", "value": "# Rails 4.0.x seems to be the only version that does not autoload `ActiveModel`\nrequire 'active_model'\n\nraise \"ActiveRecord is defined but should not be!\" if defined?(::ActiveRe...
ruby
chosen
[ { "from": "system", "value": "Add provides line to crazy spec\n\nThis is actually a heavy-resource spec and it needs a provides\nline.\n\nSigned-off-by: Lamont Granquist <0ab8dc438f73addc98d9ad5925ec8f2b97991703@scriptkiddie.org>\n" }, { "from": "human", "value": "require 'chef/resource/service'...
ruby
chosen
[ { "from": "system", "value": "Update ruby_version requirement to allow ruby 3.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\n\nrequire 'holidays/version'\n\nGem::Specification.ne...
ruby
chosen
[ { "from": "system", "value": "Use redirect_back to suppress deprecation warning\n\n> DEPRECATION WARNING: `redirect_to :back` is deprecated and will be\n> removed from Rails 5.1. Please use `redirect_back(fallback_location:\n> fallback_location)` where `fallback_location` represents the location\n> to use i...
ruby
chosen
[ { "from": "system", "value": "Fix \"live\" reloading of inputs and gqueries\n\nResolves quintel/etmodel#1500\n" }, { "from": "human", "value": "module Etsource\n # Watches for changes to ETsource files. Changes made to dataset, gquery,\n # input, or topology files will clear out the caches, fo...
ruby
chosen
[ { "from": "system", "value": "Define methods for action and controller\n" }, { "from": "human", "value": "require 'mongoid'\n\nmodule Railitics\n class Request\n include Mongoid::Document\n field :uuid, type: String\n field :user_id\n end\nend\n" }, { "from": "gpt", "value...
ruby
chosen
[ { "from": "human", "value": "Add acceptance test for fact retrieval / inventory service\n" }, { "from": "gpt", "value": "require 'json'\n\ntest_name \"facts should be available through facts terminus\" do\n\n with_master_running_on master, \"--autosign true\", :preserve_ssl => true do\n\n st...
ruby
chosen
[ { "from": "human", "value": "Add specs for error raising\n" }, { "from": "gpt", "value": "require \"spec_helper\"\n\nRSpec.describe Escobar::Heroku::Client do\n let(:client) { Escobar::Heroku::Client.new(\"123\") }\n it \"should rescue timeout errors\" do\n expect(client.client).to receive(...
ruby
chosen
[ { "from": "system", "value": "Include provider taxonomy information when loading organizations\n" }, { "from": "human", "value": "module Api\n module V1\n\n class OrganizationsController < ApplicationController\n SERIALIZATION_INCLUDES = [:mailing_address, :practice_location_address, :o...
ruby
chosen
[ { "from": "system", "value": "Fix email sending class name\n" }, { "from": "human", "value": "=begin rdoc\n=Description\nScaffolding for EmailConfiguration Model\n=end\nclass EmailConfigurationsController < ApplicationController\n before_filter :super_authenticate\n before_filter :get_cart\n\n...
ruby
chosen
[ { "from": "system", "value": "cli: Convert rbld status implementation to Ruby\n\nSigned-off-by: Dmitry Fleytman <a8cf97adadec4e1b734a39bc5aea71b5741cfca1@daynix.com>\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\nrequire_relative 'rbld_envmgr'\n\nmodule Rebuild\n class RbldStatusComm...
ruby
chosen
[ { "from": "human", "value": "Add 'Tex Live Utility.app' v1.17\n" }, { "from": "gpt", "value": "class TexLiveUtility < Cask\n url 'https://mactlmgr.googlecode.com/files/TeX%20Live%20Utility.app-1.17.tar.gz'\n homepage 'https://code.google.com/p/mactlmgr/'\n version '1.17'\n sha256 '9a913cbf0e...
ruby
chosen
[ { "from": "system", "value": "Update Tunnelblick to latest beta 24" }, { "from": "human", "value": "class TunnelblickBeta < Cask\n url 'http://downloads.sourceforge.net/project/tunnelblick/All%20files/Tunnelblick_3.4beta22.dmg'\n homepage 'https://code.google.com/p/tunnelblick/'\n version '3....
ruby
chosen
[ { "from": "system", "value": "Fix error where genre attribute can't define value\n" }, { "from": "human", "value": "class Book < ActiveRecord::Base\n has_many :book_collections, :dependent => :destroy\n has_many :collections, :through => :book_collections\n has_many :book_genres\n has_many :...
ruby
chosen
[ { "from": "system", "value": "Add modules to precompile path in before_init\n" }, { "from": "human", "value": "require 'pathname'\n\n# This will fail when initializing assets, but we don't need\n# generators for asset initialization anyway. Let it fail\n# silently\n#\nbegin; require \"generators...
ruby
chosen
[ { "from": "human", "value": "Add Keystone API check to sensu-plugins.\n" }, { "from": "gpt", "value": "#!/usr/bin/env ruby\n#\n# Keystone API monitoring script for Sensu\n#\n# Copyright © 2014 Christopher Eckhardt\n#\n# Author: Christopher Eckhardt <djbkd@dreamsofelectricsheep.net>\n#\n# Release...
ruby
chosen
[ { "from": "system", "value": "Remove chapter expiry from Note\n\ni_have_no_idea_what_im_doing.jpg\n" }, { "from": "human", "value": "class Note < ActiveRecord::Base\n belongs_to :element\n has_many :comments\n\n accepts_nested_attributes_for :comments\n\n delegate :chapter, to: :element\n\n ...
ruby
chosen
[ { "from": "system", "value": "Add AliasNames and Network on search results\n" }, { "from": "human", "value": "module TheTvDB\n class Series::Collection\n include Model\n\n ATTRS_MAP = {\n :id => \"seriesid\",\n :api_id => \"id\",\n :banner => \"banner\",\...
ruby
chosen
[ { "from": "system", "value": "Remove old attributes from attr_accessible\n\nThe old twitter, github and beard attributes aren't part of this app so let's not reference them in the code\n" }, { "from": "human", "value": "require 'digest/md5'\n\nclass User < ActiveRecord::Base\n self.include_root...
ruby
chosen
[ { "from": "system", "value": "Use the standard gem author for chef\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.include?(l...
ruby
chosen
[ { "from": "system", "value": "Include \"gmail/tag\" here for completeness.\n" }, { "from": "human", "value": "# tags.rb\n#\n# @author Ollivier Robert <roberto@keltia.net> \n#\n# $Id: tags.rb,v 7f48d095873f 2012/12/06 10:04:19 roberto $\n\nmodule GMail\n# Represent a bag of tags backed by a TC db...
ruby
chosen
[ { "from": "system", "value": "Define some missing \"Restaurants\" properties on Page" }, { "from": "human", "value": "module Mogli\n class Page < Profile\n set_search_type\n\n define_properties :id, :name, :category, :username, :access_token\n\n # General\n define_properties :likes,...
ruby
chosen
[ { "from": "system", "value": "Fix detection of artist in title name of song\n" }, { "from": "human", "value": "module Nehm\n class Track\n attr_reader :hash\n\n def initialize(hash)\n @hash = hash\n end\n\n def artist\n if @hash['title'].include?('-')\n title = @has...
ruby
chosen
[ { "from": "system", "value": "Split getting the model fields into a separate method so we can call that externally if we want to.\n" }, { "from": "human", "value": "require \"the_merger/version\"\n\nmodule TheMerger\n #\n # Default settings for TheMerger\n # \n # - merge_model: User\n #\n...
ruby
chosen
[ { "from": "system", "value": "Ruby: Add barrier guards test involving captured variables\n" }, { "from": "human", "value": "foo = \"foo\"\n\nif foo == \"foo\"\n foo\nelse\n foo\nend\n\nif [\"foo\"].include?(foo)\n foo\nelse\n foo\nend\n\nif foo != \"foo\"\n foo\nelse\n foo\nend...
ruby
chosen
[ { "from": "system", "value": "Patch `which file` command in windows\n\nIt returns nil. Should provide a better solution\n" }, { "from": "human", "value": "# Monkey patches to Ruby on Rails\n#\n# Use unix file util to prove the content type sent by the browser\nclass ActionDispatch::Http::Uploade...
ruby
chosen
[ { "from": "system", "value": "Test for not finding class or test results and marking them yellow\n" }, { "from": "human", "value": "require_relative '../lib/abcing/colour_alphabet_result.rb'\n\ndescribe ABCing::ColourAlphabetResult do\n it 'finds tested class letters' do\n params = {\n ...
ruby
chosen
[ { "from": "system", "value": "Use NL as default locale.\n" }, { "from": "human", "value": "require File.expand_path('../boot', __FILE__)\n\n# Pick the frameworks you want:\nrequire \"active_record/railtie\"\nrequire \"action_controller/railtie\"\nrequire \"action_mailer/railtie\"\nrequire \"acti...
ruby
chosen