diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2016-08-10 14:08:32 -0500 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-08-16 16:44:37 -0500 |
commit | 4f6bdcd5fd2074ff97dba83bf0c7a6398c1a3530 (patch) | |
tree | 6193d1d810131e1a32c67d3f1b5abba9c39bd9b4 | |
parent | 4fe91931d587075c2de507a1f87bcdab9b30373a (diff) | |
download | bundler-4f6bdcd5fd2074ff97dba83bf0c7a6398c1a3530.tar.gz |
Add a setting for disable_exec_load
-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 | 9 |
3 files changed, 13 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..dec1605c9e 100644 --- a/spec/commands/exec_spec.rb +++ b/spec/commands/exec_spec.rb @@ -553,6 +553,15 @@ describe "bundle exec" do it_behaves_like "it runs" end + context "when disable_exec_load is set" do + let(:exec) { "EXEC: exec" } + 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} |