Spring updated

This commit is contained in:
Christoph Haas 2017-04-06 12:51:00 +02:00
parent 464fc0de95
commit 43c52d77ab
3 changed files with 14 additions and 10 deletions

View file

@ -1,7 +1,8 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
begin begin
load File.expand_path("../spring", __FILE__) load File.expand_path('../spring', __FILE__)
rescue LoadError rescue LoadError => e
raise unless e.message.include?('spring')
end end
APP_PATH = File.expand_path('../../config/application', __FILE__) APP_PATH = File.expand_path('../../config/application', __FILE__)
require_relative '../config/boot' require_relative '../config/boot'

View file

@ -1,7 +1,8 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
begin begin
load File.expand_path("../spring", __FILE__) load File.expand_path('../spring', __FILE__)
rescue LoadError rescue LoadError => e
raise unless e.message.include?('spring')
end end
require_relative '../config/boot' require_relative '../config/boot'
require 'rake' require 'rake'

View file

@ -4,12 +4,14 @@
# It gets overwritten when you run the `spring binstub` command. # It gets overwritten when you run the `spring binstub` command.
unless defined?(Spring) unless defined?(Spring)
require "rubygems" require 'rubygems'
require "bundler" require 'bundler'
if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m) lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read)
Gem.paths = { "GEM_PATH" => [Bundler.bundle_path.to_s, *Gem.path].uniq } spring = lockfile.specs.detect { |spec| spec.name == "spring" }
gem "spring", match[1] if spring
require "spring/binstub" Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
gem 'spring', spring.version
require 'spring/binstub'
end end
end end