Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

return the right error code for bundle exec with ruby version

paired with @wycats
  • Loading branch information...
commit 5ba208133c7c2293dfa096dcb8ccbe19f8d010f3 1 parent 1ce763f
@hone hone authored
View
2  lib/bundler/cli.rb
@@ -421,6 +421,8 @@ def exec(*)
Bundler.setup_environment
+ ENV['BUNDLE_EXECING'] = options["no-color"] ? "no-color" : "color"
+
begin
# Run
Kernel.exec(*ARGV)
View
6 lib/bundler/setup.rb
@@ -1,4 +1,5 @@
require 'bundler/shared_helpers'
+require 'bundler/friendly_errors'
if Bundler::SharedHelpers.in_bundle?
require 'bundler'
@@ -13,6 +14,11 @@
end
exit e.status_code
end
+ elsif ENV['BUNDLE_EXECING']
+ require 'bundler/vendored_thor'
+ the_shell = (ENV['BUNDLE_EXECING'] == "no-color" ? Thor::Shell::Basic.new : Thor::Base.shell.new)
+ Bundler.ui = Bundler::UI::Shell.new(the_shell)
+ Bundler.with_friendly_errors {Bundler.setup }
else
Bundler.setup
end
View
1  spec/other/platform_spec.rb
@@ -592,6 +592,7 @@ def should_be_engine_version_incorrect(opts = {:exitstatus => true})
end
it "fails when the engine version doesn't match" do
+ pending "we need to run this under jruby. can't simulate jruby with Kernel.exec inside `bundle exec`"
simulate_ruby_engine "jruby" do
gemfile <<-G
gem "rack", "0.9.1"
Please sign in to comment.
Something went wrong with that request. Please try again.