From f05616f8a21ef703f0b568b7cd3019fb4bcb8b52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Heiko=20Bernl=C3=B6hr?= Date: Fri, 12 Jan 2018 10:11:14 +0100 Subject: Update stubs. --- bin/rails | 5 +++-- bin/rake | 5 +++-- bin/spring | 19 ++++++++----------- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/bin/rails b/bin/rails index 7feb6a3..f2b0313 100755 --- a/bin/rails +++ b/bin/rails @@ -1,7 +1,8 @@ #!/usr/bin/env ruby begin - load File.expand_path("../spring", __FILE__) -rescue LoadError + 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' diff --git a/bin/rake b/bin/rake index 8017a02..d87d5f5 100755 --- a/bin/rake +++ b/bin/rake @@ -1,7 +1,8 @@ #!/usr/bin/env ruby begin - load File.expand_path("../spring", __FILE__) -rescue LoadError + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') end require_relative '../config/boot' require 'rake' diff --git a/bin/spring b/bin/spring index 253ec37..7fe232c 100755 --- a/bin/spring +++ b/bin/spring @@ -1,18 +1,15 @@ #!/usr/bin/env ruby -# This file loads spring without using Bundler, in order to be fast -# It gets overwritten when you run the `spring binstub` command +# This file loads spring without using Bundler, in order to be fast. +# It gets overwritten when you run the `spring binstub` command. unless defined?(Spring) - require "rubygems" - require "bundler" + require 'rubygems' + require 'bundler' - if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m) - ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR) - ENV["GEM_HOME"] = "" - Gem.paths = ENV - - gem "spring", match[1] - require "spring/binstub" + if (match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m)) + Gem.paths = { 'GEM_PATH' => [Bundler.bundle_path.to_s, *Gem.path].uniq.join(Gem.path_separator) } + gem 'spring', match[1] + require 'spring/binstub' end end -- cgit v1.2.3