conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Reduce deployment targets for OS X and iOS\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"Contentful\"\n s.version = \"0.1.0\"\n s.summary = \"Swift SDK for Contentful's Content Delivery API.\"\n s.homepage ...
ruby
chosen
[ { "from": "system", "value": "Add upsertList action to work orders\n" }, { "from": "human", "value": "module NetSuite\n module Records\n class WorkOrder\n include Support::Fields\n include Support::RecordRefs\n include Support::Records\n include Support::Actions\n in...
ruby
chosen
[ { "from": "system", "value": "Update class to reflect name change\n" }, { "from": "human", "value": "class Pycharm < Cask\n url 'http://download-ln.jetbrains.com/python/pycharm-professional-3.0.dmg'\n homepage 'http://www.jetbrains.com/pycharm/'\n version '3.0.0'\n sha1 'd8a03ada2e6400d4b4b1...
ruby
chosen
[ { "from": "system", "value": "Change spec helper to explicit auto-migrate all models in a repository\n\n* Models can be bound to specific repositories, but we want for the tests to\n always auto-migrate the models within the specified repository.\n" }, { "from": "human", "value": "module DataMa...
ruby
chosen
[ { "from": "system", "value": "Update short description in podspec\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"castaway\"\n s.version = \"0.1.0\"\n s.summary = \"Safely cast objects\"\n s.homepage = \"https://github.com/dbachrach/...
ruby
chosen
[ { "from": "system", "value": "Add support for rolling back transaction for all open database connections.\n" }, { "from": "human", "value": "if defined?(ActiveRecord::Base)\n Before do\n $__cucumber_global_use_txn = !!Cucumber::Rails::World.use_transactional_fixtures if $__cucumber_global_us...
ruby
chosen
[ { "from": "system", "value": "Support preparing test environment for non-installation test on Windows.\n\n* subversion/bindings/swig/ruby/test/run-test.rb: Use copy instead of\n symbolic link on Windows.\n\nSuggested by: Joe Swatosh\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\nrequ...
ruby
chosen
[ { "from": "system", "value": "Rename \"children\" in MultiSelectHash to \"kv_pairs\"\n" }, { "from": "human", "value": "module JMESPath\n # @api private\n module Nodes\n class MultiSelectHash < Node\n def initialize(children)\n @children = children\n end\n\n def visit(...
ruby
chosen
[ { "from": "system", "value": "Fix a LocalJumpError caused by return statement in a block\n" }, { "from": "human", "value": "require 'twterm/tab/statuses/base'\n\nmodule Twterm\n module Tab\n module Statuses\n class Conversation < Base\n include Dumpable\n\n attr_reader :st...
ruby
chosen
[ { "from": "system", "value": "Move setting of the environment variable in the cap call\n" }, { "from": "human", "value": "require 'capistrano/ext/multistage'\n\nset :stages, %w(production ent)\nset :default_stage, \"ent\"\n\ndefault_run_options[:pty] = true\n\nset :application, 'submarine'\nset ...
ruby
chosen
[ { "from": "system", "value": "Add responders as a dependency\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'panther/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Return 406 status for unsupported formats\n" }, { "from": "human", "value": "ManualsFrontend::Application.routes.draw do\n with_options(constraints: { prefix: /(guidance|hmrc-internal-manuals)/ }) do |r|\n r.get '/:prefix/:manual_id', to: 'manuals#index'\n r....
ruby
chosen
[ { "from": "system", "value": "Use activerecord-import in ReceiveLocalBatch. The default behavior of it is to do an On Duplicate Key Update updated_at = Time.now, but we have a test for that case anyway.\n" }, { "from": "human", "value": "# Copyright (c) 2010, Diaspora Inc. This file is\n# ...
ruby
chosen
[ { "from": "system", "value": "Add original_data to Event JSON representation.\n" }, { "from": "human", "value": "require 'roar/json/json_api'\n\nclass EventsRepresenter < Roar::Decorator\n include Roar::JSON::JSONAPI\n type :events\n\n property :id, render_nil: true\n property :name, render_...
ruby
chosen
[ { "from": "system", "value": "Add default values to report config\n" }, { "from": "human", "value": "class Bidu::House::ErrorReport\n include ConcernBuilder::OptionsParser\n\n delegate :period, :threshold, :scope, :clazz, :external_key, :id, to: :options_object\n\n def initialize(options)\n ...
ruby
chosen
[ { "from": "system", "value": "Fix typo on instance variable.\n" }, { "from": "human", "value": "require 'yajl'\n\nmodule Catcher\n module Service\n module EM\n class Http\n\n def initialize(url)\n @url = url\n end\n\n def parsed_api_response\n Yajl...
ruby
chosen
[ { "from": "system", "value": "Return self after updating attributes from payload\n" }, { "from": "human", "value": "class BaseResource\n attr_writer :client\n\n class << self\n attr_reader :endpoint\n\n def resource(name)\n @endpoint = name\n end\n\n def client\n Clubhous...
ruby
chosen
[ { "from": "system", "value": "Revert \"Remove bindir & executables; we won’t have any\"\n\nThis reverts commit 8495ee49560f90062937d5e5a5001c341856865f.\n" }, { "from": "human", "value": "lib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire...
ruby
chosen
[ { "from": "system", "value": "Use SystemTimer if possible in Ruby 1.8" }, { "from": "human", "value": "module Faraday\n class Request::Timeout < Faraday::Middleware\n dependency \"timeout\"\n\n def initialize(app, timeout = 2)\n @timeout = timeout\n super(app)\n end\n\n de...
ruby
chosen
[ { "from": "system", "value": "Fix instance variable @class not initialized warning\n" }, { "from": "human", "value": "require 'fivemat/elapsed_time'\n\nmodule Minitest\n class FivematReporter < Reporter\n include ElapsedTime\n\n def record(result)\n if @class != result.class\n ...
ruby
chosen
[ { "from": "system", "value": "Use StatisticsReporter so we place nice with rg\n" }, { "from": "human", "value": "require \"minitest/test\"\nrequire \"growl\"\n\nmodule Minitest\n\n def self.plugin_growler_options(opts, options)\n end\n\n def self.plugin_growler_init(options)\n if Growler.g...
ruby
chosen
[ { "from": "system", "value": "Fix deprecation warning: DEPRECATION WARNING: Accessing mime types via constants is deprecated. Please change `Mime::MPAC` to `Mime[:mpac]`\n" }, { "from": "human", "value": "Mime::Type.register \"application/x-mpac\", :mpac\n\n# Let's action_dispatch parse the para...
ruby
chosen
[ { "from": "human", "value": "Add Rake task to parse COSA Boundary Shapefile\n" }, { "from": "gpt", "value": "require 'rgeo/shapefile'\n\nnamespace :cosa_boundaries do\n desc \"Load COSA Boundary into database\"\n task :load => :environment do\n\n CosaBoundary.destroy_all\n shpfile = \"#{...
ruby
chosen
[ { "from": "system", "value": "Convert 'for' loop to use '.each' instead\n" }, { "from": "human", "value": "module Thrust\n class ExecutionHelper\n def capture_status_from_command(command, env = {})\n system(env, command)\n end\n\n def capture_status_and_output_from_command(command...
ruby
chosen
[ { "from": "system", "value": "Make WaterMeasurementStore.get not crash if no value is stored yet.\n" }, { "from": "human", "value": "require 'date'\nrequire 'redis'\n\nclass WaterMeasurementStore\n def initialize(redis_host:, measurements_redis_key: \"water_meter_water_count\")\n @redis_host...
ruby
chosen
[ { "from": "system", "value": "Make podspec point to commit since we don't have any tags yet.\n" }, { "from": "human", "value": "Pod::Spec.new do |spec|\n spec.name = 'objc-geohash'\n spec.version = '0.1'\n spec.author = { 'Lyo Kato' => 'lyo.kato@gmail.com' }\n spec.source ...
ruby
chosen
[ { "from": "system", "value": "Upgrade Chromium.app to v40.0.2214.94 (64-bit)\n\nIt's the latest version from Freesmug but 2 things have changed:\n- like Chrome, it's now only 64 bit\n- it no longer have Sparkle because Freesmug have problem compiling Sparkle in 64 bit.\n\nChange appcast to the one on Source...
ruby
chosen
[ { "from": "system", "value": "Include created_at timestamp in messages\n" }, { "from": "human", "value": "json_messages = []\n@messages.each do |message|\n if message.sender_id == current_user.id\n new_message = message.as_json(only: [:id, :word_count, :time_saved]).merge(disposition: 'sent'...
ruby
chosen
[ { "from": "human", "value": "Create unit test to ensure backend parser coverage\n" }, { "from": "gpt", "value": "require 'test_helper'\n\nclass TestImageBackend\n def tested\n Parsers::ImageBackend.new\n end\n\n def test_vips_formats\n assert_includes tested.vips_formats, 'vips'\n end\...
ruby
chosen
[ { "from": "system", "value": "Set up suhosin for Debian 6\n" }, { "from": "human", "value": "require 'spec_helper_acceptance'\n\ndescribe 'with Apache + SQLite' do\n let(:manifest) { <<-EOS\n $required_directories = [\n '/opt',\n '/var/cache/puppet',\n '/var/cache/pupp...
ruby
chosen
[ { "from": "system", "value": "Remove spec looking for old wrangle guidelines" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe \"crops/wrangle\" do\n before do\n @member = FactoryBot.create(:crop_wrangling_member)\n controller.stub(:current_user) { @member }\n page = ...
ruby
chosen
[ { "from": "system", "value": "Add pronto, preparing for CI auto-checking\n" }, { "from": "human", "value": "lib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire \"rolodex/version\"\n\nGem::Specification.new do |spec|\n spec.name =...
ruby
chosen
[ { "from": "system", "value": "Upgrade Plex Media Server to v0.9.9.14.531\n" }, { "from": "human", "value": "class PlexMediaServer < Cask\n version '0.9.9.12.504'\n sha256 '493adc1e7617143c70718798febc15606f361d8072fae970f70070dee7d8ed45'\n\n url 'http://downloads.plexapp.com/plex-media-server...
ruby
chosen
[ { "from": "system", "value": "Fix homepage to use SSL in SpriteIlluminator Cask\n\nThe HTTP URL is already getting redirected to HTTPS. Using the HTTPS URL directly\nmakes it more secure and saves a HTTP round-trip.\n" }, { "from": "human", "value": "cask :v1 => 'spriteilluminator' do\n version...
ruby
chosen
[ { "from": "human", "value": "Create asset sync initialiser to set Rackspace configuration\n" }, { "from": "gpt", "value": "AssetSync.configure do |config|\n config.fog_provider = ENV['FOG_PROVIDER']\n config.rackspace_username = ENV['RACKSPACE_USERNAME']\n config.rackspace_api_key = ENV['RACK...
ruby
chosen
[ { "from": "human", "value": "Fix error with params hash returning inconsistent results.\n" }, { "from": "gpt", "value": "# This is a monkey-patch of\n# actionpack/lib/action_dispatch/http/parameters.rb\n\n# The env key action_dispatch.request.parameters is being set earlier\n# than expected (by ...
ruby
chosen
[ { "from": "system", "value": "Improve browser cache handling of attachments to prevent queries.\n" }, { "from": "human", "value": "class AttachmentsController < ApplicationController\n def download\n set_rack_response ApplicationUploader.download_response(request.env)\n end\n\n private\n\n...
ruby
chosen
[ { "from": "system", "value": "Replace handcrafted sql with a defined association\n" }, { "from": "human", "value": "class Document < ActiveRecord::Base\n has_many :editions\n\n def self.published\n where %{\n EXISTS (\n SELECT 1 FROM editions AS published_editions\n WHERE...
ruby
chosen
[ { "from": "system", "value": "Clean up implementations test suite\n" }, { "from": "human", "value": "require_relative '../test_helper'\nrequire 'trackler/implementations'\n\nclass ImplementationsTest < Minitest::Test\n def test_collection\n track = Trackler::Track.new('fake', FIXTURE_PATH)\n...
ruby
chosen
[ { "from": "system", "value": "Add in reverse relationship to InsuranceProvider to keep mongoid happy\n" }, { "from": "human", "value": "class InsuranceProvider\n include Mongoid::Document\n \n embeds_one :payer, class_name: \"Organization\"\n embeds_many :guarantors, class_name: \"Guarantor\...
ruby
chosen
[ { "from": "system", "value": "Add action to destroy a unit\n" }, { "from": "human", "value": "class Api::V1::UnitsController < ApplicationController\n\n #TODO spec\n def create\n unit = Unit.new(create_params)\n unit.save!\n render json: { unit: unit.attributes }\n end\n\n #TODO spe...
ruby
chosen
[ { "from": "system", "value": "Move multistage to be before default_attributes and reorder the rest\n" }, { "from": "human", "value": "require 'formaggio/capistrano/default_attributes'\nrequire 'formaggio/capistrano/figs'\nrequire 'formaggio/capistrano/config'\nrequire 'formaggio/capistrano/asset...
ruby
chosen
[ { "from": "system", "value": "Update Gemspec to add Dependencies\n\nWe depend on `listen`, `terminfo` and `colored`.\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'snooper'\n s.version = '0.0.1'\n s.date = '2013-03-17'\n s.summary = \"Spyin...
ruby
chosen
[ { "from": "system", "value": "Allow rails versions greater than 3.1 (ie: rails 3.2)\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"jasmine_rails/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Sp...
ruby
chosen
[ { "from": "system", "value": "Add redirect for a step page to /resources/search page\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n\n devise_for :users, controllers: {\n passwords: 'users/passwords'\n }\n ActiveAdmin.routes(self)\n root 'static#home'\n\n get '/surv...
ruby
chosen
[ { "from": "system", "value": "Update e-mail and URL constants for staging server\n" }, { "from": "human", "value": "EMAIL_URI = 'lets.gopushcart.com'\nSITE_NAME = 'pushcart'\nSITE_URL = 'gopushcart.com'\nSECRET_KEY = Rails.application.secrets.aes_secret_ke...
ruby
chosen
[ { "from": "system", "value": "Fix name spacing of api\n" }, { "from": "human", "value": "Kuhsaft::Engine.routes.draw do\n\n namespace :cms do\n resources :pages, except: :show do\n post :sort, on: :collection\n end\n\n resources :bricks, except: [:edit, :index] do\n post :sor...
ruby
chosen
[ { "from": "system", "value": "Use slimmer to set Google Analytics custom vars" }, { "from": "human", "value": "require 'api_entity'\n\nclass ApplicationController < ActionController::Base\n protect_from_forgery\n\n before_filter :initialize_modules\n before_filter :set_cache\n layout :set_la...
ruby
chosen
[ { "from": "system", "value": "Fix N+1 query in conferences controller\n" }, { "from": "human", "value": "class ConferencesController < ApplicationController\n def index\n @conferences = policy_scope(Conference).map { |c| ConferencePresenter.new(c) }\n end\n\n def show\n authorize curren...
ruby
chosen
[ { "from": "system", "value": "Fix end of speedrun condition\n" }, { "from": "human", "value": "class MyProfilesController < ApplicationController\n before_action :authenticate_user!\n\n def show\n end\n\n def edit\n end\n\n def update\n if current_user.update_attributes(user_params)\n ...
ruby
chosen
[ { "from": "system", "value": "Fix rubocop warnings in PrivilegeCheckerService\n" }, { "from": "human", "value": "class PrivilegeCheckerService\n\n def valid_session?(session, current_user)\n user_signed_in?(current_user) && session_active?(session) && server_ready?(current_user)\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Use ActiveRecord::Schema to define tables for tests\n" }, { "from": "human", "value": "ActiveRecord::Base.establish_connection(\n :adapter => \"sqlite3\",\n :database => \":memory:\"\n)\n\nActiveRecord::Base.connection.create_table :products do |t|\n t.string ...
ruby
chosen
[ { "from": "system", "value": "Add no-cache to cache control\n" }, { "from": "human", "value": "require 'open-uri'\nrequire 'sinatra'\n\nconfigure do\n # [Redis To Go | Heroku Dev Center](https://devcenter.heroku.com/articles/redistogo)\n require 'redis'\n uri = URI.parse(ENV['REDISTOGO_URL'])...
ruby
chosen
[ { "from": "system", "value": "Use 'signon' as the root URL\n\nThe 'authentication' label was used back in the days of sign-on-tron\nv1. This is now deprecated, so expect to search for 'signon' instead.\n" }, { "from": "human", "value": "GDS::SSO.config do |config|\n config.user_model = \"User...
ruby
chosen
[ { "from": "system", "value": "Load OAuth and basic auth details from ENV\n" }, { "from": "human", "value": "GDS::SSO.config do |config|\n config.user_model = \"User\"\n config.oauth_id = 'abcdefgh12345678pan'\n config.oauth_secret = 'secret'\n config.oauth_root_url = Plek.current.find(...
ruby
chosen
[ { "from": "system", "value": "[tests] Allow passing a custom evaluator.\n" }, { "from": "human", "value": "module Expectations\n def expect_code_with_result(string)\n code, result = string.split('#=>').map(&:strip)\n\n expect(eval_in_page(code)).to eq eval(result)\n end\nend\n\nWorld Exp...
ruby
chosen
[ { "from": "system", "value": "Remove a method that is not used\n" }, { "from": "human", "value": "module Shopify\n class ProductAttributes\n include Spree::Retail::PresenterHelper\n\n def initialize(spree_product, product_converter: Shopify::ProductConverter,\n image_att...
ruby
chosen
[ { "from": "system", "value": "Change deplayment_target of the pod spec to support 7.1\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"Popsicle\"\n s.version = \"1.1.1\"\n s.summary = \"Simple, extensible value interpolation fra...
ruby
chosen
[ { "from": "system", "value": "Switch back to 62 for the nut rules\n\n=\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "#\n# Cookbook Name:: smith-hardware\n# Recipe:: default\n#\n# Copyright 2015, Tim Smith\n#\n# Licensed under the ...
ruby
chosen
[ { "from": "system", "value": "Add redirect and rest in peace\n" }, { "from": "human", "value": "Ready4rails4::Application.routes.draw do\n resources :rubygems, except: :destroy, path: \"gems\"\n resource :gemfile_check, only: [:new, :create]\n\n root to: \"rubygems#index\"\nend\n" }, { ...
ruby
chosen
[ { "from": "system", "value": "Add show route for events\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n resources :events, only: [:new, :index, :create]\n\n root 'pages#home'\n ActiveAdmin.routes(self)\n devise_for :users, controllers: {\n confirmations: 'users/confi...
ruby
chosen
[ { "from": "system", "value": "Add rspec ~>1.3.0 as development dependency" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"r2/version\"\n\nGem::Specification.new do |s|\n s.name = \"r2\"\n s.version = R2::VERSION\n...
ruby
chosen
[ { "from": "system", "value": "Migrate project documents controller to pundit\n" }, { "from": "human", "value": "class Projects::TermsController < ApplicationController\n inherit_resources\n defaults resource_class: ProjectDocument, collection_name: :project_documents\n load_and_authorize_reso...
ruby
chosen
[ { "from": "human", "value": "Include affiliate URL in product output for API\n" }, { "from": "gpt", "value": "object @product\ncache [I18n.locale, @current_user_roles.include?('admin'), current_currency, root_object]\n\nattributes *product_attributes\n\nnode(:display_price) { |p| p.display_price...
ruby
chosen
[ { "from": "system", "value": "Remove logging from faye extension.\n" }, { "from": "human", "value": "class FayeExtension\n\n def incoming(message, callback)\n p message\n callback.call(message)\n case message[\"channel\"]\n when \"/heartbeat\"\n heartbeat(message[\"data\"])\n ...
ruby
chosen
[ { "from": "system", "value": "Use :allow_nodev option instead of creating dummy Logger object\n" }, { "from": "human", "value": "module MForwd::Logging\n\n # @return [Logger::WithStdout]\n def logger config: nil\n return @logger if @lgger\n\n config ||= MForwd::Config.new.log\n\n # Re...
ruby
chosen
[ { "from": "system", "value": "Fix initialization issue with access_token\n\nThis resolves client initialization issue when specifying access_token\ndirectly instead of giving api_key and api_secret to generate one. The\nfollowing line works now:\nclient = WeiboOAuth2::Client.from_hash(access_token: YOUR_TOK...
ruby
chosen
[ { "from": "system", "value": "Allow pry versions greater than 0.9.x\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nrequire File.expand_path('../lib/pry-debugger/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.name = 'pry-debugger'\n gem.version = Pr...
ruby
chosen
[ { "from": "system", "value": "Remove method implemented in 1600\n" }, { "from": "human", "value": "# (c) Copyright 2020 Hewlett Packard Enterprise Development LP\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the Lic...
ruby
chosen
[ { "from": "system", "value": "Fix migration syntax because Redmine4 uses rails5.2\n" }, { "from": "human", "value": "class CreatePwfmtFormats < ActiveRecord::Migration\n def change\n create_table :pwfmt_formats do |t|\n t.integer :target_id, null: false\n t.string :field, null: fal...
ruby
chosen
[ { "from": "system", "value": "Update deployment target version to 9.0\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\ns.name = 'Soundlinks-iOS-SDK'\ns.version = '1.0.0'\ns.license = 'MIT'\ns.summary = 'Soundlinks-iOS-SDK'\ns.homepage = 'https://github.com/soundlinks/Soundlinks-iOS-SDK.g...
ruby
chosen
[ { "from": "system", "value": "Add nagios user/password creation to the centos package recipe\n\n\nFormer-commit-id: b37041964764feb5f94561cf3950b148cdd220b1 [formerly a441f0ea5965d7b953d3bd4a7703eb004b36338f] [formerly a6d2c1fcf93584a10558d7d110bf06b6fe676485 [formerly b3b32fa9863940481fc8783358fff918dcc865...
ruby
chosen
[ { "from": "system", "value": "Add some explicit dependencies that were hidden during development\n" }, { "from": "human", "value": "#\n# Cookbook Name:: passenger-gem\n# Recipe:: default\n#\n# Copyright 2011, Cyclestreets Ltd\n\ngem_package \"passenger\" do\n gem_binary \"/usr/bin/gem1.9.1\"\n ...
ruby
chosen
[ { "from": "system", "value": "task: Add specs for using build in this context\n" }, { "from": "human", "value": "# typed: false\n# frozen_string_literal: true\n\nrequire \"test_helper\"\n\nclass BuilderBaseServiceTest < ActiveSupport::TestCase\n test \"BuilderBaseService.call\" do\n assert_r...
ruby
chosen
[ { "from": "system", "value": "Remove brackets around conditionals for readability\n" }, { "from": "human", "value": "class NumberGroup\n attr_reader :errors\n attr_reader :items\n\n VALID_NUMBERS = (1..9)\n\n def initialize(items)\n @items = items\n @errors = []\n end\n\n def valid?\...
ruby
chosen
[ { "from": "system", "value": "Load right stream with Show More on mobile\n\n - Load aspects stream if user is on this stream instead of loading the\n activity stream\n" }, { "from": "human", "value": "# Copyright (c) 2010-2011, Diaspora Inc. This file is\n# licensed under the Affero Gen...
ruby
chosen
[ { "from": "system", "value": "Fix pusher notification. Don't use after_commit for it.\n" }, { "from": "human", "value": "class Recommendation < ActiveRecord::Base\n belongs_to :photograph, counter_cache: true\n belongs_to :user, counter_cache: true\n\n validates :photograph_id, :user_id, pres...
ruby
chosen
[ { "from": "system", "value": "Remove stray validation that's no longer needed\n" }, { "from": "human", "value": "class StaffPosition < ApplicationRecord\n belongs_to :convention\n has_and_belongs_to_many :user_con_profiles\n has_many :permissions, dependent: :destroy\n\n validates :name, pre...
ruby
chosen
[ { "from": "system", "value": "Remove poetry mode with function calls.\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\ndef shell(command)\n puts command\n stdout = `#{command}`\n\n error_code = $?.exitstatus\n if error_code != 0\n puts stdout\n raise \"#{command} exit with err...
ruby
chosen
[ { "from": "system", "value": "Use RACK_ENV to check for environment, so thin works\n" }, { "from": "human", "value": "require 'random_gen'\nrequire 'ok_redis'\nrequire 'paperclip_helper.rb'\nrequire 'two_legged_oauth'\n\nmodule ActiveModel\n class Errors\n\n def merge!(errors, options={})\n ...
ruby
chosen
[ { "from": "system", "value": "Revert \"Revert \"better gem description\"\"\n\nThis reverts commit 36c0062b60bfd9b936d5d22394c09d335ac4468c.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"ruby-haml-js/version\"\n\nGem::Speci...
ruby
chosen
[ { "from": "system", "value": "Send all JWT hash data to model finder\n" }, { "from": "human", "value": "require 'devise'\n\nmodule Devise\n module Strategies\n\n class Auth0Authenticatable < Base\n\n TAKE = %w(name email user_id)\n\n def authenticate!\n token = env['HTTP_AUT...
ruby
chosen
[ { "from": "system", "value": "Add documentation for the Status API\n" }, { "from": "human", "value": "module BacklogKit\n class Client\n module Status\n def get_statuses\n get('statuses')\n end\n end\n end\nend\n" }, { "from": "gpt", "value": "module BacklogK...
ruby
chosen
[ { "from": "system", "value": "Set dependency versions for gems\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'vagrant-powder/version'\n\nGem::Specification.new do |spec|\n spec.nam...
ruby
chosen
[ { "from": "system", "value": "Call rubocop -a on all the decorators\n" }, { "from": "human", "value": "class FilesystemDecorator < MiqDecorator\n def fonticon\n convert = {\n \"dll\" => \"fa fa-cogs\",\n \"doc\" => \"fa fa-file-word-o\",\n \"exe\" => \"fa fa-fil...
ruby
chosen
[ { "from": "system", "value": "Fix validate_schema raised validation error\n" }, { "from": "human", "value": "module JsonSchemaRails\n module Helpers\n extend ActiveSupport::Concern\n\n included do\n rescue_from JsonSchemaRails::ValidationError, with: :schema_validation_failed\n en...
ruby
chosen
[ { "from": "system", "value": "Reset the request_context after dj being executed.\n" }, { "from": "human", "value": "require 'delayed_job'\nmodule LogStasher\n module Delayed\n class Plugin < ::Delayed::Plugin\n callbacks do |lifecycle|\n lifecycle.before(:invoke_job) do |job, *ar...
ruby
chosen
[ { "from": "system", "value": "Fix tests because now we don't convert values\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Gitlab::Serialize::Ci::Variables do\n subject do\n described_class.load(described_class.dump(object))\n end\n\n let(:object) do\n [{ key: :key...
ruby
chosen
[ { "from": "system", "value": "Add support for excluding paths from rake task\n" }, { "from": "human", "value": "\nrequire 'puppet-parse'\nrequire 'rake'\nrequire 'rake/tasklib'\n\ndesc 'Run puppet-parse'\ntask :parse do\n matched_files = FileList['**/*.pp']\n run = PuppetParse::Runner.new\n p...
ruby
chosen
[ { "from": "system", "value": "Reset the dummy test db on calling spec\n" }, { "from": "human", "value": "namespace :test do\n namespace :db do\n desc \"Copies the engine migrations into spec/dummy/db/migrate\"\n task :copy_migrations do\n FileUtils.cp_r(\"#{CONTEXT_ROOT}/db/migrate\"...
ruby
chosen
[ { "from": "system", "value": "Update the routing for Rails 3\n" }, { "from": "human", "value": "# Here you can override or add to the pages in the core website\n\nActionController::Routing::Routes.draw do |map|\n # brand new controller example\n map.with_options :controller => 'general' do...
ruby
chosen
[ { "from": "system", "value": "Remove convert_paths_to_urls as its in Govspeak now\n" }, { "from": "human", "value": "require \"govspeak/link_extractor\"\n\nclass EditionLinkExtractor\n def initialize(edition:)\n @edition = edition\n end\n\n def call\n convert_paths_to_urls(find_links_in...
ruby
chosen
[ { "from": "system", "value": "Add username to user migration file\n" }, { "from": "human", "value": "class SorceryCore < ActiveRecord::Migration\n def change\n create_table :users do |t|\n t.string :email, :null => false\n t.string :crypted_password\n t.string :salt...
ruby
chosen
[ { "from": "system", "value": "Check if feed has specified field before assigned to params.\n\nAlso change the order between newsitems build and updating feed attributes.\n" }, { "from": "human", "value": "class EntryNewsitemsContext < BaseContext\n class_attribute :feed, :feed_record\n\n at_ex...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.7.1.3 to 1.0.0.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'evt-schema'\n s.summary = \"Primitives for schema and data structure\"\n s.version = '0.7.1.3'\n s.descri...
ruby
chosen
[ { "from": "system", "value": "Set location for UK tile cache\n" }, { "from": "human", "value": "name \"jump\"\ndescription \"Role applied to all servers at Jump Networks\"\n\ndefault_attributes(\n :networking => {\n :nameservers => [\n \"185.73.44.3\",\n \"2001:ba8:0:2c02::\",\n ...
ruby
chosen
[ { "from": "system", "value": "Update entrypoint to take args in the form 'password', 1,2,3\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\n# Simple helper class to select specific tokens from a longer, pseudorandom password.\nrequire \"pry\"\nclass PasswordTokenizer\n\n # PUBLIC\n # ...
ruby
chosen
[ { "from": "system", "value": "Adjust validation error message on Organization\n" }, { "from": "human", "value": "class Organization < ActiveRecord::Base\n validates :name, presence: true, length: { maximum: 255 }\n validates :login_name,\n presence: true,\n length: { minimum: 3, maximum:...
ruby
chosen
[ { "from": "system", "value": "Use .trim to remove trailing and preceeding whitespace\n\nRemove any unwanted whitespace before we run regular expressions over the date\n" }, { "from": "human", "value": "class DateParser\n def self.parse(date_string)\n # Catches if user inputs just year which ...
ruby
chosen
[ { "from": "system", "value": "Upgrade Unity to version 4.6.0" }, { "from": "human", "value": "cask :v1 => 'unity' do\n version '4.5.5'\n sha256 'e42d3b8e3bc3fbc7448bb06b5210c1c0687ba3f784eb947b4586b9f129c6b0d4'\n\n url \"http://netstorage.unity3d.com/unity/unity-#{version}.dmg\"\n homepage '...
ruby
chosen