From ad4aedeeac4e8891ad2b43d98d75af37cb93a5b2 Mon Sep 17 00:00:00 2001 From: Aditya Prakash Date: Wed, 16 Dec 2015 19:41:05 +0530 Subject: [PATCH] Add bundler Dependency to gemspec bundle exec was added to commands cause otherwise it was giving Gem::LoadError for conflicting bundler versions on travis --- lib/spring/test/application.rb | 4 ++-- lib/spring/test/application_generator.rb | 4 ++-- spring.gemspec | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) 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'