Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/spring/test/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def run(command, opts = {})
Bundler.with_clean_env do
Process.spawn(
env,
command.to_s,
"bundle exec #{command}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary? Which tests fail without it?

We are already setting GEM_PATH and GEM_HOME in the env of the spawned process, so I don't understand why it would be an issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are already setting GEM_PATH and GEM_HOME in the env of the spawned process, so I don't understand why it would be an issue.

Yes, it shouldn't be an issues and it isn't, at least locally. However, tests on travis fail with conflicting bundler version. For some reason travis installs bundler 1.7.6 at first and later it ends up conflicting with generated rails app bundler. Same thing happened in last two attempts of this fix ( #293, #373).

out: stdout.last,
err: stderr.last,
in: :close,
Expand Down Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change this? It makes it less readable IMO

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bundle exec (gem list bundler | grep bundler) || gem install bundler gives following error:

bash: syntax error near unexpected token `('

run! "bundle check || bundle update --retry=2", timeout: nil
end

Expand Down
4 changes: 2 additions & 2 deletions lib/spring/test/application_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
1 change: 1 addition & 0 deletions spring.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down