From ab79758f72a129ae368d20a37e769297b3f1a97f Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Fri, 20 Jan 2017 00:18:28 +0100 Subject: [PATCH] Update spring binstub closes #7287 --- bin/spring | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/spring b/bin/spring index 62ec28f8c..9bc076b9e 100755 --- a/bin/spring +++ b/bin/spring @@ -7,9 +7,10 @@ unless defined?(Spring) require 'rubygems' require 'bundler' - if (match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m)) - Gem.paths = { 'GEM_PATH' => [Bundler.bundle_path.to_s, *Gem.path].uniq } - gem 'spring', match[1] + lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read) + if spring = lockfile.specs.detect { |spec| spec.name == "spring" } + Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path + gem 'spring', spring.version require 'spring/binstub' end end