diff --git a/Gemfile b/Gemfile index 1d116b4214..d26f7102f0 100644 --- a/Gemfile +++ b/Gemfile @@ -106,7 +106,7 @@ group :development, :test do gem 'rspec-rails', '~> 3.0.1' gem 'rspec-html-matchers', '~> 0.6.1' gem 'shoulda-matchers' - gem 'spring' + gem 'spring', '~> 1.3.2' gem 'spring-commands-rspec' gem 'vcr' gem 'webmock', '~> 1.17.4', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 78d4ad7120..bf32bd0447 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -364,7 +364,7 @@ GEM slop (3.6.0) spectrum-rails (1.3.4) railties (>= 3.1) - spring (1.1.3) + spring (1.3.2) spring-commands-rspec (1.0.2) spring (>= 0.9.1) sprockets (2.11.0) @@ -517,7 +517,7 @@ DEPENDENCIES shoulda-matchers slack-notifier (~> 1.0.0) spectrum-rails - spring + spring (~> 1.3.2) spring-commands-rspec string-scrub therubyracer (~> 0.12.1) diff --git a/bin/spring b/bin/spring index 6862bdd351..e09182495f 100755 --- a/bin/spring +++ b/bin/spring @@ -1,20 +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" - case lockfile = Bundler.default_lockfile.read - when /^GEM$.*?^ spring \((.*?)\)$.*?^$/m - version = $1 - ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR) - ENV["GEM_HOME"] = "" unless /^GIT$/ === lockfile - Gem.paths = ENV - - gem "spring", version + if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m) + Gem.paths = { "GEM_PATH" => Bundler.bundle_path.to_s } + gem "spring", match[1] require "spring/binstub" end end