diff options
author | Homu <homu@barosl.com> | 2016-08-17 09:06:20 +0900 |
---|---|---|
committer | Homu <homu@barosl.com> | 2016-08-17 09:06:20 +0900 |
commit | 54ff7a4fb827ec36d5cac2fac843993f28b19077 (patch) | |
tree | 8702fd03aa0bce00714a457fe2e5df8f1ac5c9d2 | |
parent | 4fe91931d587075c2de507a1f87bcdab9b30373a (diff) | |
parent | 39d10a65d3b7c9613baf089f0800e79402cf5736 (diff) | |
download | bundler-54ff7a4fb827ec36d5cac2fac843993f28b19077.tar.gz |
Auto merge of #4869 - bundler:seg-disable-exec-load, r=segiddins
Add a setting for disable_exec_load
See #4852
-rw-r--r-- | lib/bundler/cli/exec.rb | 4 | ||||
-rw-r--r-- | lib/bundler/settings.rb | 1 | ||||
-rw-r--r-- | spec/commands/exec_spec.rb | 11 |
3 files changed, 15 insertions, 1 deletions
diff --git a/lib/bundler/cli/exec.rb b/lib/bundler/cli/exec.rb index 8240fc2342..4f238bbb59 100644 --- a/lib/bundler/cli/exec.rb +++ b/lib/bundler/cli/exec.rb @@ -23,7 +23,9 @@ module Bundler validate_cmd! SharedHelpers.set_bundle_environment if bin_path = Bundler.which(cmd) - return kernel_load(bin_path, *args) if ruby_shebang?(bin_path) + if !Bundler.settings[:disable_exec_load] && ruby_shebang?(bin_path) + return kernel_load(bin_path, *args) + end # First, try to exec directly to something in PATH if Bundler.current_ruby.jruby_18? kernel_exec(bin_path, *args) diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb index 094c859908..2a04805f92 100644 --- a/lib/bundler/settings.rb +++ b/lib/bundler/settings.rb @@ -6,6 +6,7 @@ module Bundler BOOL_KEYS = %w( allow_offline_install cache_all + disable_exec_load disable_local_branch_check disable_shared_gems frozen diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb index 8163fc7725..e1b94d80d5 100644 --- a/spec/commands/exec_spec.rb +++ b/spec/commands/exec_spec.rb @@ -553,6 +553,17 @@ describe "bundle exec" do it_behaves_like "it runs" end + context "when disable_exec_load is set" do + let(:exec) { "EXEC: exec" } + let(:process) { "PROCESS: ruby #{path} arg1 arg2" } + + before do + bundle "config disable_exec_load true" + end + + it_behaves_like "it runs" + end + context "signals being trapped by bundler" do let(:executable) { strip_whitespace <<-RUBY } #{shebang} |