From 53e2c8b4ede09498f8ea692ee0249bc930da6262 Mon Sep 17 00:00:00 2001 From: Akinori MUSHA Date: Tue, 16 Sep 2014 18:20:00 +0900 Subject: [PATCH] Readd Spring fixing a problem with a git-sourced gem. cf. #478 --- Gemfile | 4 ++-- Gemfile.lock | 5 +++++ bin/spring | 8 +++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index d2db6427..5c3912ea 100644 --- a/Gemfile +++ b/Gemfile @@ -108,8 +108,8 @@ group :development, :test do gem 'delorean' gem 'webmock', '~> 1.17.4', require: false gem 'coveralls', require: false - # gem 'spring' - # gem 'spring-commands-rspec' + gem 'spring' + gem 'spring-commands-rspec' end group :production do diff --git a/Gemfile.lock b/Gemfile.lock index 3cfba250..c48b62a7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -317,6 +317,9 @@ GEM slop (3.6.0) spectrum-rails (1.3.4) railties (>= 3.1) + spring (1.1.3) + spring-commands-rspec (1.0.2) + spring (>= 0.9.1) sprockets (2.11.0) hike (~> 1.2) multi_json (~> 1.0) @@ -447,6 +450,8 @@ DEPENDENCIES shoulda-matchers slack-notifier (~> 0.5.0) spectrum-rails + spring + spring-commands-rspec therubyracer (~> 0.12.1) twilio-ruby (~> 3.11.5) twitter (~> 5.8.0) diff --git a/bin/spring b/bin/spring index 253ec37c..6862bdd3 100755 --- a/bin/spring +++ b/bin/spring @@ -7,12 +7,14 @@ unless defined?(Spring) require "rubygems" require "bundler" - if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m) + 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"] = "" + ENV["GEM_HOME"] = "" unless /^GIT$/ === lockfile Gem.paths = ENV - gem "spring", match[1] + gem "spring", version require "spring/binstub" end end