Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Get bundle exec respecting proc titles #7140

Merged
1 commit merged into from
Apr 29, 2019
Merged
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
7 changes: 1 addition & 6 deletions lib/bundler/cli/exec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,7 @@ def run
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)
else
kernel_exec([bin_path, cmd], *args)
end
kernel_exec(bin_path, *args)
else
# exec using the given command
kernel_exec(cmd, *args)
Expand Down
11 changes: 11 additions & 0 deletions spec/commands/exec_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@
expect(out).to eq("hi")
end

it "respects custom process title when loading through ruby" do
script_that_changes_its_own_title_and_checks_if_picked_up_by_ps_unix_utility = <<~RUBY
Process.setproctitle("1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16")
puts `ps -eo args | grep [1]-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16`
RUBY
create_file "Gemfile"
create_file "a.rb", script_that_changes_its_own_title_and_checks_if_picked_up_by_ps_unix_utility
bundle "exec ruby a.rb"
expect(out).to eq("1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16")
end

it "accepts --verbose" do
install_gemfile 'gem "rack"'
bundle "exec --verbose echo foobar"
Expand Down