Pārlūkot izejas kodu

Merge pull request #503 from knu/respring

Readd Spring fixing a problem with a git-sourced gem.
Andrew Cantino 10 gadi atpakaļ
vecāks
revīzija
56e2afc38c
3 mainītis faili ar 12 papildinājumiem un 5 dzēšanām
  1. 2 2
      Gemfile
  2. 5 0
      Gemfile.lock
  3. 5 3
      bin/spring

+ 2 - 2
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

+ 5 - 0
Gemfile.lock

@@ -316,6 +316,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)
@@ -446,6 +449,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)

+ 5 - 3
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