From 36ece6cd3b4549815eb17903ded80dae254035bb Mon Sep 17 00:00:00 2001 From: Dominik Sander Date: Sun, 15 Oct 2017 12:13:21 +0200 Subject: [PATCH] Fix running specs with guard and spring Updated spring to allow running the specs with guard and spring again. --- Gemfile | 8 ++++---- Gemfile.lock | 51 +++++++++++++++++++++++++-------------------------- Guardfile | 2 +- bin/spring | 8 +++++--- 4 files changed, 35 insertions(+), 34 deletions(-) diff --git a/Gemfile b/Gemfile index 117b1060..0849673f 100644 --- a/Gemfile +++ b/Gemfile @@ -131,9 +131,9 @@ gem 'uglifier', '~> 2.7.2' group :development do gem 'better_errors', '~> 1.1' gem 'binding_of_caller' - gem 'guard', '~> 2.13.0' + gem 'guard', '~> 2.14.1' gem 'guard-livereload', '~> 2.5.1' - gem 'guard-rspec', '~> 4.6.4' + gem 'guard-rspec', '~> 4.7.3' gem 'rack-livereload', '~> 0.3.16' gem 'letter_opener_web', '~> 1.3.1' gem 'web-console', '>= 3.3.0' @@ -144,8 +144,8 @@ group :development do if_true(ENV['SPRING']) do gem 'spring-commands-rspec', '~> 1.0.4' - gem 'spring', '~> 1.7.2' - gem 'spring-watcher-listen', '~> 2.0.0' + gem 'spring', '~> 2.0.2' + gem 'spring-watcher-listen', '~> 2.0.1' end group :test do diff --git a/Gemfile.lock b/Gemfile.lock index 163a7c86..bb3831a2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -174,7 +174,7 @@ GEM rspec chronic (0.10.2) cliver (0.3.2) - coderay (1.1.0) + coderay (1.1.2) coffee-rails (4.2.1) coffee-script (>= 2.2.0) railties (>= 4.0.0, < 5.2.x) @@ -244,7 +244,7 @@ GEM faraday_middleware (>= 0.9) loofah (>= 2.0) sax-machine (>= 1.0) - ffi (1.9.10) + ffi (1.9.18) font-awesome-sass (4.7.0) sass (>= 3.2) forecast_io (2.0.1) @@ -285,9 +285,9 @@ GEM multi_json (~> 1.11) os (~> 0.9) signet (~> 0.7) - guard (2.13.0) + guard (2.14.1) formatador (>= 0.2.4) - listen (>= 2.7, <= 4.0) + listen (>= 2.7, < 4.0) lumberjack (~> 1.0) nenv (~> 0.1) notiffany (~> 0.0) @@ -300,7 +300,7 @@ GEM guard (~> 2.8) guard-compat (~> 1.0) multi_json (~> 1.8) - guard-rspec (4.6.5) + guard-rspec (4.7.3) guard (~> 2.1) guard-compat (~> 1.1) rspec (>= 2.99.0, < 4.0) @@ -352,16 +352,16 @@ GEM railties (>= 3.2) libv8 (3.16.14.19) liquid (4.0.0) - listen (3.0.5) - rb-fsevent (>= 0.9.3) - rb-inotify (>= 0.9) + listen (3.0.8) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) little-plugger (1.1.4) logging (2.2.2) little-plugger (~> 1.1) multi_json (~> 1.10) loofah (2.0.3) nokogiri (>= 1.5.9) - lumberjack (1.0.10) + lumberjack (1.0.12) macaddr (1.7.1) systemu (~> 2.6.2) mail (2.6.5) @@ -369,7 +369,7 @@ GEM memoist (0.16.0) memoizable (0.4.2) thread_safe (~> 0.3, >= 0.3.1) - method_source (0.8.2) + method_source (0.9.0) mime-types (3.1) mime-types-data (~> 3.2015) mime-types-data (3.2016.0521) @@ -383,7 +383,7 @@ GEM multipart-post (2.0.0) mysql2 (0.4.8) naught (1.1.0) - nenv (0.2.0) + nenv (0.3.0) net-ftp-list (3.2.8) net-scp (1.2.1) net-ssh (>= 2.6.5) @@ -392,7 +392,7 @@ GEM nio4r (2.0.0) nokogiri (1.8.1) mini_portile2 (~> 2.3.0) - notiffany (0.0.8) + notiffany (0.1.1) nenv (~> 0.1) shellany (~> 0.0) oauth (0.4.7) @@ -438,10 +438,9 @@ GEM multi_json (~> 1.0) websocket-driver (>= 0.2.0) polyglot (0.3.5) - pry (0.10.3) + pry (0.11.1) coderay (~> 1.1.0) - method_source (~> 0.8.1) - slop (~> 3.4) + method_source (~> 0.9.0) pry-byebug (3.3.0) byebug (~> 8.0) pry (~> 0.10) @@ -482,9 +481,9 @@ GEM thor (>= 0.18.1, < 2.0) raindrops (0.17.0) rake (12.0.0) - rb-fsevent (0.9.7) - rb-inotify (0.9.5) - ffi (>= 0.5.0) + rb-fsevent (0.10.2) + rb-inotify (0.9.10) + ffi (>= 0.5.0, < 2) rb-kqueue (0.2.4) ffi (>= 0.5.0) ref (2.0.0) @@ -561,15 +560,15 @@ GEM simplecov-html (~> 0.10.0) simplecov-html (0.10.1) slack-notifier (1.0.0) - slop (3.6.0) spectrum-rails (1.3.4) railties (>= 3.1) - spring (1.7.2) + spring (2.0.2) + activesupport (>= 4.2) spring-commands-rspec (1.0.4) spring (>= 0.9.1) - spring-watcher-listen (2.0.0) + spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) - spring (~> 1.2) + spring (>= 1.2, < 3.0) sprockets (3.7.1) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -675,9 +674,9 @@ DEPENDENCIES geokit-rails (~> 2.2.0) google-api-client (~> 0.13) google-cloud-translate (~> 1.0.0) - guard (~> 2.13.0) + guard (~> 2.14.1) guard-livereload (~> 2.5.1) - guard-rspec (~> 4.6.4) + guard-rspec (~> 4.7.3) haversine hipchat (~> 1.2.0) httmultiparty (~> 0.3.16) @@ -727,9 +726,9 @@ DEPENDENCIES shoulda-matchers slack-notifier (~> 1.0.0) spectrum-rails - spring (~> 1.7.2) + spring (~> 2.0.2) spring-commands-rspec (~> 1.0.4) - spring-watcher-listen (~> 2.0.0) + spring-watcher-listen (~> 2.0.1) therubyracer (~> 0.12.3) tumblr_client! twilio-ruby (~> 3.11.5) diff --git a/Guardfile b/Guardfile index fe974954..4908f4af 100644 --- a/Guardfile +++ b/Guardfile @@ -8,7 +8,7 @@ guard 'livereload' do watch(%r{(app|vendor)(/assets/\w+/(.+\.(css|js|html|png|jpg))).*}) { |m| "/assets/#{m[3]}" } end -guard :rspec, cmd: ENV['SPRING'] ? 'bundle exec spring rspec' : 'bundle exec rspec' do +guard :rspec, cmd: 'bin/rspec' do watch(%r{^spec/.+_spec\.rb$}) watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } watch('spec/spec_helper.rb') { "spec" } diff --git a/bin/spring b/bin/spring index 7fe232c3..fb2ec2eb 100755 --- a/bin/spring +++ b/bin/spring @@ -7,9 +7,11 @@ 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.join(Gem.path_separator) } - gem 'spring', match[1] + lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read) + spring = lockfile.specs.detect { |spec| spec.name == "spring" } + if spring + Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path + gem 'spring', spring.version require 'spring/binstub' end end