conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Use latest RC of bosh_cli\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/bosh/gen/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Dr Nic Williams\"]\n gem.email = [\"drnicwilli...
ruby
chosen
[ { "from": "system", "value": "Remove 'rails' gem dependency to avoid needing extra Rails libs (especially ActiveRecord)\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path(\"../lib/haml-rails/version\", __FILE__)\n\nGem::Specification.new do |s|\n s.name ...
ruby
chosen
[ { "from": "system", "value": "Add boot_twilio to new page.\n" }, { "from": "human", "value": "require 'twilio-ruby'\n\nclass MessagesController < ApplicationController\n skip_before_filter :verify_authenticity_token\n # If using Devise gem for authorization\n #skip_before_filter :authenticate...
ruby
chosen
[ { "from": "system", "value": "Add logic for choosing layout\n" }, { "from": "human", "value": "class TutorialController < UIViewController\n\tdef loadView\n\t\t@layout = TutorialLayout.new\n\n\t\tself.view = @layout.view\n\tend\n\n\tdef viewDidLoad\n\t\t# @button.when(UIControlEventTouchUpInside...
ruby
chosen
[ { "from": "system", "value": "Remove fake Rails module hack for jquery-rails\n" }, { "from": "human", "value": "require \"middleman-core\"\nrequire \"middleman-more\"\n\nmodule Rails\n def self.env \n Class.new do\n def test?\n false\n end\n end.new\n end\n\n class Engi...
ruby
chosen
[ { "from": "system", "value": "Move the expectations out of the implementation. Whoops!\n" }, { "from": "human", "value": "module Capybara\n module Angular\n module Material\n module Node\n module Actions\n def md_check(locator)\n find(:xpath, \"//md-checkbox/*...
ruby
chosen
[ { "from": "system", "value": "Add user Auth to exisiting Question routes\n" }, { "from": "human", "value": "get '/questions' do\n @questions = Question.all\n\n erb :'questions/index'\nend\n\nget '/questions/new' do\n if session[:user]\n erb :'questions/new'\n else\n erb :'_404'\n end\...
ruby
chosen
[ { "from": "system", "value": "Add destroy, update and edit route logic\n" }, { "from": "human", "value": "class QuestionsController < ApplicationController\n\n\n def index\n @questions = Question.last(10)\n end\n\n def new\n end\n\n def create\n end\n\n def show\n @question = Questi...
ruby
chosen
[ { "from": "system", "value": "Add render votes count which returns a string of the updated vote count for the corresponding response.\n" }, { "from": "human", "value": "class ResponsesController < ApplicationController\n\n before_action :set_response, only: [:edit, :update, :destroy]\n\n def n...
ruby
chosen
[ { "from": "human", "value": "Add start of DTrace reporter.\n" }, { "from": "gpt", "value": "module QED\nmodule Reporter #:nodoc:\n\n require 'qed/reporter/abstract'\n\n # Deep trace reporter\n #\n class DTrace < Abstract\n\n #\n def before_session(session)\n @start_time = Time.no...
ruby
chosen
[ { "from": "system", "value": "Make changes to @fallback stick.\n" }, { "from": "human", "value": "module Rack\n class Offline\n class Config\n attr_reader :cached, :network, :fallback\n\n def initialize(root, &block)\n @cached = []\n @network = []\n @fallback =...
ruby
chosen
[ { "from": "system", "value": "Use query params for non-bodied requests.\n" }, { "from": "human", "value": "class Sliver::Rails::Action\n include Sliver::Action\n\n def self.expose(name, options = {}, &block)\n define_method \"#{name}_without_caching\", &block\n define_method(name) do\n ...
ruby
chosen
[ { "from": "human", "value": "Add an interactive build command\n" }, { "from": "gpt", "value": "formula = Coresys::Formula.find(ARGV[0])\nCoresys::Installer.new(formula).install do\n system(ENV['SHELL'], '-l')\n raise StandardError, \"Interactive build canceled\" unless $/.success?\nend\nCoresy...
ruby
chosen
[ { "from": "system", "value": "Call eager_loading in rails before_initialize\n\nSince configure resets, we need to call configure afterward again in\nbefore_initialize. I believe this problem would only occur within tests\nwhen calling configure multiple times.\n" }, { "from": "human", "value": "...
ruby
chosen
[ { "from": "system", "value": "Update Android Studio Canary to 2.2.0.2,145.2949926\n" }, { "from": "human", "value": "cask 'android-studio-canary' do\n version '2.2.0.1,145.2915834'\n sha256 '80c4277262743c2eed23a61a7d491d10ee46553cbe3207e1e369f1e1455d8a33'\n\n url \"https://dl.google.com/dl/a...
ruby
chosen
[ { "from": "human", "value": "Add Beyond Compare 4 Beta\n" }, { "from": "gpt", "value": "class BeyondCompare4Beta < Cask\n url 'http://www.scootersoftware.com/BCompareOSX-4.0.0.17451.zip'\n homepage 'http://www.scootersoftware.com/beta.php'\n version '4.0.0.17451'\n sha1 'ae61d7c9e555d05cce3f...
ruby
chosen
[ { "from": "system", "value": "Add accessor for raw_settings in Wyatt::Configuration\n" }, { "from": "human", "value": "require 'yaml'\n\nmodule Wyatt\n\n module Configuration\n extend self\n\n CORE_SETTINGS = :core\n\n def load!(file_path)\n @file_path = file_path\n @raw_...
ruby
chosen
[ { "from": "system", "value": "Replace `extend self` with `module_function`\n\nhttps://github.com/rubocop-hq/ruby-style-guide/issues/556#issuecomment-782922501\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'logger'\n\nbegin\n require 'pry-byebug'\nrescue LoadError\n...
ruby
chosen
[ { "from": "system", "value": "Disable rpath usage in Rust builds\n\nThe rpaths end up being setup incorrectly, which causes strange issues\nlike mozilla/rust#12178.\n\nCloses #26686.\n\nSigned-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>\n" }, { "from": "human", "...
ruby
chosen
[ { "from": "system", "value": "Include native.rb in the build\n" }, { "from": "human", "value": "require 'opal/runtime'\nrequire 'opal/class'\nrequire 'opal/basic_object'\nrequire 'opal/kernel'\nrequire 'opal/nil_class'\nrequire 'opal/boolean'\nrequire 'opal/error'\nrequire 'opal/regexp'\nrequire...
ruby
chosen
[ { "from": "system", "value": "Remove unneeded line (replaced by init_lights)" }, { "from": "human", "value": "#! /usr/bin/env ruby\nrequire 'sinatra'\nrequire 'haml'\n\nclass TrafficLightPiServer < Sinatra::Base\n def self.init_lights\n @@lines = Hash.new\n @@line_map.each_key do |line|\n...
ruby
chosen
[ { "from": "system", "value": "Update gemspec with description and summary\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'olson/version'\n\nGem::Specification.new do |gem|\...
ruby
chosen
[ { "from": "system", "value": "Reset column information before running Team update\n" }, { "from": "human", "value": "class AddDescriptionToTeams < ActiveRecord::Migration\n def up\n add_column :teams, :description, :text\n Team.update_all(['description = ?', 'Most powerful users with full...
ruby
chosen
[ { "from": "system", "value": "Revert \"fix half-done migration by removing fields already gone\"\n\nThis reverts commit 5ef165d253da53c190c3ec610f2e15dba763289f.\n" }, { "from": "human", "value": "class RemoveIndividualFields < ActiveRecord::Migration\n def change\n # remove_column :members,...
ruby
chosen
[ { "from": "system", "value": "Add model tests for a removed medical condition funder.\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass RemovedMedicalFundingTest < ActiveSupport::TestCase\n # test \"the truth\" do\n # assert true\n # end\nend\n" }, { "from": "gpt", ...
ruby
chosen
[ { "from": "system", "value": "Extend the default_wait_time in cucumber tests\n\nTravis is failing on what looks like a timeout issue waiting for a page\nto load. It doesn't fail locally so might be due to Travis machines\nbeing more contended. Bumping the wait time to see if it will build.\n" }, { "...
ruby
chosen
[ { "from": "system", "value": "Debug way too loud with this on...\n\nWe can turn it on for debugging.\n" }, { "from": "human", "value": "unless `bundle exec vagrant box list`.include?('precise64')\n fail 'Box is not added! Run \"bundle exec rake features:bootstrap\".'\nend\n\nrequire 'aruba/cucu...
ruby
chosen
[ { "from": "system", "value": "Update gemspec with new lowest supported Ruby version\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nGem::Specification.new do |s|\n s.name = \"gir_ffi-gtk\"\n s.version = \"0.12.1\"\n s.required_ruby_version = %q{>= 2.1.0}\n\n s.summary = \"Gir...
ruby
chosen
[ { "from": "system", "value": "Destroy all CheddarGetter customers before suite\n" }, { "from": "human", "value": "require File.expand_path('../../../lib/mousetrap', __FILE__)\n\nrequire 'spec'\nrequire 'spec/autorun'\nrequire 'factory_girl'\nrequire 'active_support'\nrequire 'yaml'\n\nDir[\"#{Fi...
ruby
chosen
[ { "from": "system", "value": "Add of spec for correct formatting of keys and update of example such that\neach scope is in a different line of the string\n" }, { "from": "human", "value": "require 'jruby-visualizer/ir_scope_registry'\nrequire 'jruby_visualizer_test_utils'\n\ndescribe IRScopeRegi...
ruby
chosen
[ { "from": "system", "value": "Add rspec to the dependencies.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/gmail-utils/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Ollivier Robert\"]\n gem.email = [\"ro...
ruby
chosen
[ { "from": "human", "value": "Add spec for products API endpoint\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\nRSpec.describe 'Products', type: :request do\n describe 'GET /products' do\n it 'successful request' do\n get '/api/products'\n expect(response).to have_http_s...
ruby
chosen
[ { "from": "system", "value": "Fix typo in factory name\n\nMSP-12429\n" }, { "from": "human", "value": "FactoryGirl.define do\n #\n # Factories\n #\n\n factory :metasploit_cache_auxiliary_action,\n class: Metasploit::Cache::Actionable::Action,\n traits: [:metasploit_cache_ac...
ruby
chosen
[ { "from": "system", "value": "Rename raw_data control to data\n" }, { "from": "human", "value": "module EventStore\n module Messaging\n module Controls\n module EventData\n module Read\n def self.raw_data(number=nil, time: nil, stream_name: nil, metadata: nil, type: nil,...
ruby
chosen
[ { "from": "system", "value": "Create Namespace to hold mappers\n" }, { "from": "human", "value": "require 'spec_helper'\n\nmodule SteppingStone\n describe TextMapper do\n def build_mapper(name)\n from = :\"from_#{name}\"\n to = :\"to_#{name}\"\n\n Module.new do\n exte...
ruby
chosen
[ { "from": "human", "value": "Update tag_id primary and foreign keys to bigint\n" }, { "from": "gpt", "value": "class ChangeTagIdToBigint < ActiveRecord::Migration[6.0]\n def up\n change_column :tags, :id, :bigint\n\n change_column :agreement_event_tags, :tag_id, :bigint\n change_column...
ruby
chosen
[ { "from": "human", "value": "Add NIO detailed guidance categories\n\nhttps://www.pivotaltracker.com/story/show/45587649\n" }, { "from": "gpt", "value": "categories = [\n {\n title: \"Gun and weapon controls in Northern Ireland\",\n description: \"Administration of firearm licensing and au...
ruby
chosen
[ { "from": "human", "value": "Enable JSON root element, for API consistency\n" }, { "from": "gpt", "value": "# Be sure to restart your server when you modify this file.\n#\n# This file contains settings for ActionController::ParamsWrapper which\n# is enabled by default.\n\n# Enable parameter wrap...
ruby
chosen
[ { "from": "system", "value": "Fix compass dependencies when more gems are installed\n" }, { "from": "human", "value": "require 'bootstrap-sass'\nrequire 'font-awesome-sass'\n\nfonts_dir = \"viaduct/static/font\"\nhttp_fonts_path = \"/static/font\"\nhttp_fonts_dir = \"/static/font\"\nenvironment ...
ruby
chosen
[ { "from": "system", "value": "Make sure that the tests can run on all platforms, do not use 1.9 hash syntax." }, { "from": "human", "value": "class Post < ActiveRecord::Base\n has_many :comments\n has_many :admin_comments, class_name: \"Comment\", :conditions => { :author => \"Admin\" }\n has...
ruby
chosen
[ { "from": "human", "value": "Add feature spec to test login via twitter\n" }, { "from": "gpt", "value": "require \"spec_helper\"\n\nfeature \"Sign In\" do\n include OmniAuthHelper\n\n before(:each) do\n mock_omni_auth\n end\n\n scenario \"as a first-time user\" do\n visit root_path\n\n...
ruby
chosen
[ { "from": "human", "value": "Add a unit test to Trello::Card.path_name\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\nRSpec.describe Trello::Card do\n\n describe '.path_name' do\n specify { expect(Trello::Card.path_name).to eq('card') }\n end\n\nend\n" } ]
ruby
chosen
[ { "from": "system", "value": "Add homepage to the gemspec" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'angerfist/version'\n\nGem::Specification.new do |spec|\n spec.name =...
ruby
chosen
[ { "from": "system", "value": "Update nested resources route with shallow nesting\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n\n devise_for :users, :controllers => { :omniauth_callbacks => \"users/omniauth_callbacks\", :registrations => \"registrations\" }\n\n resources...
ruby
chosen
[ { "from": "system", "value": "Change route name to index\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n root to: 'pages#home'\n\n devise_for :developers,\n skip: [:sessions, :passwords, :confirmations, :registrations],\n controllers: { omniauth_ca...
ruby
chosen
[ { "from": "system", "value": "Switch to rails 3 routing api\n" }, { "from": "human", "value": "Rails.application.routes.draw do |map|\n map.resources :editor_images, :controller => 'rich_text/images', :only => [:new, :create]\nend" }, { "from": "gpt", "value": "Rails.application.rou...
ruby
chosen
[ { "from": "system", "value": "Allow routing to fixtures that are in subfolders (e.g. spec/fixtures/subfolder/fixture.html.haml)\n" }, { "from": "human", "value": "Jasminerice::Engine.routes.draw do\n resources :spec, :controller => 'spec', :only => [:index] do\n get \"fixtures/:filename\", :...
ruby
chosen
[ { "from": "system", "value": "Update date of latest version...\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = 'capistrano-deploytags'\n s.license = 'BSD-2-Clause'\n s.version = '1.0.1'\n s.date = '2014-06-14'\n s.summary = 'Add dated, e...
ruby
chosen
[ { "from": "system", "value": "Use symbolize_names option to parse JSON faster\n" }, { "from": "human", "value": "require \"json\"\nrequire \"yaml\"\nrequire \"ajw2/util\"\n\nmodule Ajw2\n # Model source\n class Source\n include Ajw2::Util\n\n attr_reader :application, :interface, :databa...
ruby
chosen
[ { "from": "system", "value": "Update rubocop requirement to ~> 0.57.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/rubocop/blob/mas...
ruby
chosen
[ { "from": "system", "value": "Add retryable as a dependency\n" }, { "from": "human", "value": "$:.unshift(File.dirname(__FILE__) + '/lib')\nrequire 'chef/provisioning/fog_driver/version'\n\nGem::Specification.new do |s|\n s.name = 'chef-provisioning-fog'\n s.version = Chef::Provisioning::FogDr...
ruby
chosen
[ { "from": "system", "value": "Remove unused binary definitions from 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 'paperclip-optimizer/version'\n\nGem::Specification.new do ...
ruby
chosen
[ { "from": "system", "value": "Change discontinued services migration to fail noisily\n\n+ Good improvement opportunity that @kevinrobinson spotted -- if any of the services in this migration fail to save, they'll fail silently and we'd never know. Switching to use the bang version of save so that the migrat...
ruby
chosen
[ { "from": "system", "value": "Update asset version to generate new fingerprints\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\n# Version of your assets, change this if you want to expire all your assets.\nRails.application.config.assets.version ...
ruby
chosen
[ { "from": "system", "value": "Fix error that prevents tests from running on Rails 5.1:\n\n`resolve_symbol_connection': 'unittest' database is not configured\n\nIt works with older version of Rails\n" }, { "from": "human", "value": "require 'logger'\n\nActiveRecord::Base.logger = Logger.new(\"deb...
ruby
chosen
[ { "from": "human", "value": "Add data to podspec for future usage\n" }, { "from": "gpt", "value": "Pod::Spec.new do |spec|\n spec.name\t\t= \"SuperLogger\"\n spec.platform\t= :ios, \"7.0\"\n spec.version\t= \"0.1.0\"\n spec.license\t= { :type => \"New BSD\", :file => 'LICENSE' }\n spec.home...
ruby
chosen
[ { "from": "system", "value": "Use sudo to restart passenger\n" }, { "from": "human", "value": "# config valid only for current version of Capistrano\nlock '~> 3.14'\n\nset :application, 'jobapps'\nset :repo_url, 'https://github.com/umts/jobapps.git'\nset :branch, :master\nset :deploy_to, \"/srv...
ruby
chosen
[ { "from": "system", "value": "Support POST when managing notebook as resource\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n root \"home#index\"\n\n devise_for :users\n\n resources :notebooks, only: [:new]\nend\n" }, { "from": "gpt", "value": "Rails.applicat...
ruby
chosen
[ { "from": "system", "value": "Clarify intended behavior for :delete\n" }, { "from": "human", "value": "require 'serverspec'\n\n# Required by serverspec under test-kitchen\nset :backend, :exec\n\n# See recipes/test_publisher\nfixtures = {\n :deleted => 'ms.omniti.com',\n :created => 'perl.omnit...
ruby
chosen
[ { "from": "system", "value": "Add Commander dependendancy to gemspec\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'ascii_art/version'\n\nGem::Specification.new do |spec|\n spec.na...
ruby
chosen
[ { "from": "human", "value": "Add missing specs for crypto helper class\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Gitlab::CryptoHelper do\n describe '.sha256' do\n it 'generates SHA256 digest Base46 encoded' do\n digest = described_class.sha256('some-value')\n\n ...
ruby
chosen
[ { "from": "human", "value": "Add spec for go-import middleware\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Gitlab::Middleware::Go, lib: true do\n let(:app) { double(:app) }\n let(:middleware) { described_class.new(app) }\n\n describe '#call' do\n describe 'when go-ge...
ruby
chosen
[ { "from": "system", "value": "Fix named group support in Rails 5\n\nRails 5 made `belongs_to` associations required by default. When using named groups, the group association is expected to be empty. This fixes the issue in a Rails 4 compatible way by adding `required: false`\n\nFixes https://github.com/dwb...
ruby
chosen
[ { "from": "system", "value": "ENHANCE: Validate the presence of unit in unit activity set\n" }, { "from": "human", "value": "class UnitActivitySet < ActiveRecord::Base\n belongs_to :unit\n belongs_to :activity_type\n\n validates :activity_type, presence: true\n validates :unit_id, presence: ...
ruby
chosen
[ { "from": "system", "value": "Load version.rb only into gemspec file\n" }, { "from": "human", "value": "lib = File.expand_path(\"../lib\", __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\n\nrequire \"qiita_team_services\"\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Add a specific minimum ruby version to the spec\n" }, { "from": "human", "value": "require 'yaml'\n\nversion_yaml = YAML.load(File.open('VERSION.yml').read)\nversion = \"#{version_yaml['major']}.#{version_yaml['minor']}.#{version_yaml['patch']}\"\ngem_name = \"json-...
ruby
chosen
[ { "from": "system", "value": "Add options argument for definition list for.\n" }, { "from": "human", "value": "module Toolsmith\n module ViewHelpers\n module DefinitionListForHelpers\n def definition_list_for(object, &block)\n definition_list = Toolsmith::Views::DefinitionListFor...
ruby
chosen
[ { "from": "system", "value": "Use Kernel.raise (needed for BasicObject on 1.9)." }, { "from": "human", "value": "module VCR\n module HttpStubbingAdapters\n class MultiObjectProxy < defined?(::BasicObject) ? ::BasicObject : VCR::BasicObject\n attr_reader :proxied_objects\n\n def ini...
ruby
chosen
[ { "from": "system", "value": "Sort guest participants in the end\n" }, { "from": "human", "value": "MwebEvents::ParticipantsController.class_eval do\n before_filter :block_if_events_disabled\n before_filter :custom_loading, :only => [:index]\n\n after_filter :only => [:create] do\n @partic...
ruby
chosen
[ { "from": "human", "value": "Add epix timestamps and created/updated by to shipments\n" }, { "from": "gpt", "value": "class AddEpixUserFieldsToShipments < ActiveRecord::Migration\n def up\n change_column_null :trade_shipments, :created_at, true\n change_column_null :trade_shipments, :upda...
ruby
chosen
[ { "from": "system", "value": "Fix the attribute driven recipe so that attributes other than config are passed through\n" }, { "from": "human", "value": "#\n# Copyright Peter Donald\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in comp...
ruby
chosen
[ { "from": "human", "value": "Add migration for industry CCS slider\n" }, { "from": "gpt", "value": "require 'etengine/scenario_migration'\n\nclass CcsSlider < ActiveRecord::Migration[5.2]\n include ETEngine::ScenarioMigration\n NEW_INDUSTRY_INPUTS = %w[\n share_of_industry_chemicals_ferti...
ruby
chosen
[ { "from": "system", "value": "Store current location in session\n" }, { "from": "human", "value": "class RegionsController < ApplicationController\n\n def index\n # load a map of chicago\n # @regions = Region.areas_to_display([41.905585, -87.631297], 100)\n end\n\n def current_position\...
ruby
chosen
[ { "from": "system", "value": "Raise exception with the accessibility results\n\n- This error should be captures by the host applications exception handler.\n" }, { "from": "human", "value": "module AccessLint\n module Rails\n class ErrorsController < AccessLint::Rails::ApplicationController\...
ruby
chosen
[ { "from": "system", "value": "Send the whole exception instance to the view" }, { "from": "human", "value": "module Bonsai\n class StaticPassThrough < Rack::Static\n def call(env)\n result = super\n return result unless result[0] == 404 || result[0] == \"404\"\n @app.call(env)...
ruby
chosen
[ { "from": "system", "value": "Set :id_str only if not set\n" }, { "from": "human", "value": "require 'croudia/base'\n\nmodule Croudia\n class Identity < Croudia::Base\n def initialize(*)\n super\n raise ArgumentError, 'argument must have an :id key' unless id\n @attrs[:id_str]...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary config for merge conflict spec\n\nThis configuration is no longer necessary now that most hooks are\ndisabled by default.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'resolving merge conflicts' do\n subject { shell(%w[git...
ruby
chosen
[ { "from": "system", "value": "Add image methods back into serializer\n" }, { "from": "human", "value": "class ProjectSerializer < ApplicationSerializer\n has_many :goals\n has_many :municipalities\n has_many :subregions\n\n # attribute :image do\n # object.image_small\n # end\n attribut...
ruby
chosen
[ { "from": "system", "value": "Revert \"don't queue up updates in staging\"\n\nThis reverts commit 3789c8b8231d97c2375d05b82018f7dca1cbaeb3.\n" }, { "from": "human", "value": "desc \"This task is called by the Heroku cron add-on\"\ntask :cron => :environment do\n if RAILS_ENV == 'production' \n ...
ruby
chosen
[ { "from": "system", "value": "Delete locally stored access token if it is invalid\n" }, { "from": "human", "value": "Warden::Manager.after_set_user only: :fetch do |record, warden, options|\n if Devise.g5_strict_token_validation\n scope = options[:scope]\n\n auth_client = G5Authentication...
ruby
chosen
[ { "from": "system", "value": "Split the some methods of TrySailBlogNotification::Parser::User::SoraAmamiya\n" }, { "from": "human", "value": "module TrySailBlogNotification::Parser::User\n class SoraAmamiya < TrySailBlogNotification::Parser::BaseParser\n\n # Start parse.\n #\n # @param...
ruby
chosen
[ { "from": "system", "value": "Set $rails_rake_task = true so models get preloaded for db:migrate\n" }, { "from": "human", "value": "require File.expand_path(File.dirname(__FILE__) + '/../lib/also_migrate')" }, { "from": "gpt", "value": "require File.expand_path(File.dirname(__FILE__)...
ruby
chosen
[ { "from": "system", "value": "Make pathname available across all features\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\n$: << File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'lib'))\n\nrequire 'yajl'\nrequire 'beanstalk-client'\n\n#require 'flapjack/inifile'\n#require ...
ruby
chosen
[ { "from": "system", "value": "Increase Aruba's timeout to compensate for JVM startup\n\n- Closes #344.\n" }, { "from": "human", "value": "require 'aruba/cucumber'\n\nBefore do\n @aruba_timeout_seconds = 15\nend\n" }, { "from": "gpt", "value": "require 'aruba/cucumber'\n\nBefore do\n...
ruby
chosen
[ { "from": "system", "value": "Use configure for specification target.\n" }, { "from": "human", "value": "require \"goq/cinch_plugin/version\"\n\nmodule Goq\n class CinchPlugin\n include Cinch::Plugin\n\n match(/^goq (.+)/, method: :query, use_prefix: false)\n match(/^goq list/, method:...
ruby
chosen
[ { "from": "system", "value": "Improve token handling; add support for GHE endpoints\n\n- uses GITHUB_TOKEN and GITHUB_HOSTNAME environment variables\r\n- improved argument argument & error handling" }, { "from": "human", "value": "require 'octokit.rb'\n\nif ARGV.length != 1\n $stderr.puts \"Pas...
ruby
chosen
[ { "from": "system", "value": "Add documentation comments; support github.com endpoint\n\n- I realized that by using the friendly hostname environment variable, we no longer supported github.com auditing. Changed this to more easily support both .com & GHE" }, { "from": "human", "value": "requir...
ruby
chosen
[ { "from": "system", "value": "Remove Rails version constraint so apps can manage rails themselves.\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"nail_polish/version\"\n\n# Describe your gem and declare its dependenc...
ruby
chosen
[ { "from": "system", "value": "Check if the uploaded file really is an image.\n\nvia http://breakthebit.org/post/77478059324/fixing-missingrequiredvalidatorerror-when\n\n\nFormer-commit-id: 3cfe15733fd2d3334a73650831381d2523e4f2ed" }, { "from": "human", "value": "class Drink < ActiveRecord::Base\...
ruby
chosen
[ { "from": "system", "value": "Add set_refreshed_at method to be called before saving of new records\n" }, { "from": "human", "value": "class Skill < ActiveRecord::Base\n belongs_to :user\n validates :title, presence: true\nend" }, { "from": "gpt", "value": "class Skill < ActiveReco...
ruby
chosen
[ { "from": "system", "value": "Add sort to the test_all_the_todos method\n" }, { "from": "human", "value": "require './test/app_helper'\nrequire './test/vcr_helper'\n\nclass AppRoutesTracksTest < Minitest::Test\n include Rack::Test::Methods\n\n def app\n Xapi::App\n end\n\n # More of a smo...
ruby
chosen
[ { "from": "system", "value": "Update test given subsequent label additions.\n" }, { "from": "human", "value": "require_relative 'helper'\nrequire 'label_definitions'\n\nclass LabelDefinitionsTest < TestCase\n\n def setup\n LabelDefinitions.instance_variable_set '@labels', nil\n end\n\n tes...
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 a couple of indexes for layers\n" }, { "from": "gpt", "value": "Sequel.migration do\n up do\n\n Rails::Sequel.connection.run(%Q{\n CREATE INDEX layers_maps_map_id_idx ON layers_maps (map_id)\n })\n\n Rails::Sequel.connection.run(%Q{\n CREATE I...
ruby
chosen
[ { "from": "system", "value": "Fix spec on Ruby 2.3\n" }, { "from": "human", "value": "# -*- encoding: us-ascii -*-\n\nrequire_relative '../../../spec_helper'\n\ndescribe \"Enumerator::Lazy\" do\n it \"is a subclass of Enumerator\" do\n Enumerator::Lazy.superclass.should equal(Enumerator)\n ...
ruby
chosen
[ { "from": "system", "value": "Fix dependency configuration in podspec.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"SwinjectPropertyLoader\"\n s.version = \"1.0.0\"\n s.summary = \"Swinject extension to load property values from resources\...
ruby
chosen
[ { "from": "system", "value": "Allow prescription termination on the same day as creation\n\nFixes bug #1146\n" }, { "from": "human", "value": "require_dependency \"renalware/medications\"\n\nmodule Renalware\n module Medications\n class PrescriptionTermination < ApplicationRecord\n incl...
ruby
chosen
[ { "from": "system", "value": "Fix call Module.prepend for ruby-2.0\n" }, { "from": "human", "value": "module ActiveModel::Associations\n module Hooks\n def self.init\n ActiveSupport.on_load(:active_record) do\n require 'active_model/associations/association_scope_extension'\n ...
ruby
chosen
[ { "from": "system", "value": "Add .py3 extension to python file patterns\n\nOur Python parser already supports both Python 2 and Python 3 source\ncode. While most Python 3 files share the same `.py` file extension used\nfor Python 2 files, some projects use the `.py3` file extension.\n" }, { "from":...
ruby
chosen
[ { "from": "system", "value": "Remove unused `object_type?` and `object_type` ivar\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule ActiveRecord\n module ConnectionAdapters #:nodoc:\n module OracleEnhanced\n class Column < ActiveRecord::ConnectionAdapters::Colum...
ruby
chosen