From a3595172883ad41f336a37472306b0f15981bb36 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Tue, 6 Feb 2018 01:00:40 +0100 Subject: [PATCH] Regenerate bin stubs These are the new binstubs available in the our current `spring` version, which make specs run much faster :relieved: --- bin/rails | 5 +++++ bin/rake | 5 +++++ bin/rspec | 5 +++++ bin/spring | 26 +++++++++++++------------- 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/bin/rails b/bin/rails index 5191e6927..0138d79b7 100755 --- a/bin/rails +++ b/bin/rails @@ -1,4 +1,9 @@ #!/usr/bin/env ruby +begin + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') +end APP_PATH = File.expand_path('../../config/application', __FILE__) require_relative '../config/boot' require 'rails/commands' diff --git a/bin/rake b/bin/rake index 17240489f..d87d5f578 100755 --- a/bin/rake +++ b/bin/rake @@ -1,4 +1,9 @@ #!/usr/bin/env ruby +begin + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') +end require_relative '../config/boot' require 'rake' Rake.application.run diff --git a/bin/rspec b/bin/rspec index d738b23c0..b207dde29 100755 --- a/bin/rspec +++ b/bin/rspec @@ -1,4 +1,9 @@ #!/usr/bin/env ruby +begin + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') +end # frozen_string_literal: true # # This file was generated by Bundler. diff --git a/bin/spring b/bin/spring index 43731fe82..fb2ec2ebb 100755 --- a/bin/spring +++ b/bin/spring @@ -1,17 +1,17 @@ #!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'spring' is installed as part of a gem, and -# this file is here to facilitate running it. -# -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) +# This file loads spring without using Bundler, in order to be fast. +# It gets overwritten when you run the `spring binstub` command. -require "rubygems" -require "bundler/setup" +unless defined?(Spring) + require 'rubygems' + require 'bundler' -load Gem.bin_path("spring", "spring") + lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read) + spring = lockfile.specs.detect { |spec| spec.name == "spring" } + if spring + Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path + gem 'spring', spring.version + require 'spring/binstub' + end +end