diff --git a/lib/spring/test/application.rb b/lib/spring/test/application.rb index f6fe74b0..a522647f 100644 --- a/lib/spring/test/application.rb +++ b/lib/spring/test/application.rb @@ -94,7 +94,7 @@ def run(command, opts = {}) Bundler.with_clean_env do Process.spawn( env, - command.to_s, + "bundle exec #{command}", out: stdout.last, err: stderr.last, in: :close, @@ -200,7 +200,7 @@ def run!(command, options = {}) end def bundle - run! "(gem list bundler | grep bundler) || gem install bundler", timeout: nil, retry: 2 + run! "gem list bundler | grep bundler || gem install bundler", timeout: nil, retry: 2 run! "bundle check || bundle update --retry=2", timeout: nil end diff --git a/lib/spring/test/application_generator.rb b/lib/spring/test/application_generator.rb index 0c110560..95eb6596 100644 --- a/lib/spring/test/application_generator.rb +++ b/lib/spring/test/application_generator.rb @@ -85,10 +85,10 @@ def generate_if_missing def install_spring return if @installed - build_and_install_gems - application.bundle + build_and_install_gems + FileUtils.rm_rf application.path("bin") if application.path("bin_original").exist? diff --git a/spring.gemspec b/spring.gemspec index 20389bae..eec1a75f 100644 --- a/spring.gemspec +++ b/spring.gemspec @@ -13,6 +13,7 @@ Gem::Specification.new do |gem| gem.files = Dir["LICENSE.txt", "README.md", "lib/**/*", "bin/*"] gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } + gem.add_dependency 'bundler', '>= 1.0' gem.add_development_dependency 'activesupport', '~> 4.2.0' gem.add_development_dependency 'rake' gem.add_development_dependency 'bump'