diff --git a/Gemfile b/Gemfile index a11b9aa86ab13d827b3bae470966b2358fb7a7fe..ae6b610a0c5abc7c09129afcd5373c795a884178 100644 --- a/Gemfile +++ b/Gemfile @@ -236,7 +236,7 @@ group :development do # Preloading environment - gem "spring", "1.4.0" + gem "spring", "1.5.0" gem "spring-commands-rspec", "1.0.4" gem "spring-commands-cucumber", "1.0.1" diff --git a/Gemfile.lock b/Gemfile.lock index f2bcf3436c6d17343328ee27f7faaf6945fb67b2..7300dd1b6454349c1a6dcb133991ad380fb9e620 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -701,7 +701,7 @@ GEM sinon-rails (1.15.0) railties (>= 3.1) slop (3.6.0) - spring (1.4.0) + spring (1.5.0) spring-commands-cucumber (1.0.1) spring (>= 0.9.1) spring-commands-rspec (1.0.4) @@ -887,7 +887,7 @@ DEPENDENCIES simplecov (= 0.11.1) sinatra (= 1.4.6) sinon-rails (= 1.15.0) - spring (= 1.4.0) + spring (= 1.5.0) spring-commands-cucumber (= 1.0.1) spring-commands-rspec (= 1.0.4) test_after_commit (= 0.4.1) diff --git a/bin/cucumber b/bin/cucumber index 12971cdce0714915147a00c00322425e1384676e..f135a756480524e552075cd7e6d612bab025a70c 100755 --- a/bin/cucumber +++ b/bin/cucumber @@ -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 'bundler/setup' load Gem.bin_path('cucumber', 'cucumber') diff --git a/bin/rails b/bin/rails index 7feb6a30e696bf9b94f204c6abb5c4d75f965046..0af1c3bafdf88d9b6cfbcf75403dae89b24fa5ef 100755 --- a/bin/rails +++ b/bin/rails @@ -1,8 +1,11 @@ #!/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 +# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. + APP_PATH = File.expand_path('../../config/application', __FILE__) -require_relative '../config/boot' +require File.expand_path('../../config/boot', __FILE__) require 'rails/commands' diff --git a/bin/rake b/bin/rake index 8017a0271d2130252500c4ef0f5bdf3b39582480..d87d5f578104597c1d1b951b55942e37f8af1277 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/rspec b/bin/rspec index 20060ebd79c0ec217596c425ddc66ea58b4a02d1..6e6709219af4b84b143079e7d7b6493080c743f9 100755 --- a/bin/rspec +++ b/bin/rspec @@ -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 'bundler/setup' load Gem.bin_path('rspec-core', 'rspec') diff --git a/bin/spring b/bin/spring index de6070b2a252227bad5b85e338f3af9017c72eba..62ec28f8c21004302e7bffd12c549cf7d599c789 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"] = nil - 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 } + gem 'spring', match[1] + require 'spring/binstub' end end