diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-05-08 13:41:03 +0200 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-05-12 09:25:06 -0400 |
commit | a5da088a6d8aa2bb14d5007dc7f70b25a50d79d7 (patch) | |
tree | f06982e7259c91ca4205ef8407068a93bad2e393 /lib/bundler | |
parent | b874d63cd3cfdd2d52a5e6fa849c8b7a3f116d1b (diff) | |
download | bundler-a5da088a6d8aa2bb14d5007dc7f70b25a50d79d7.tar.gz |
Setup rubyopt to require bundler absolutely
This way, we will never leak to a different bundler copy.
Diffstat (limited to 'lib/bundler')
-rw-r--r-- | lib/bundler/shared_helpers.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb index e56a44a559..da2a384d29 100644 --- a/lib/bundler/shared_helpers.rb +++ b/lib/bundler/shared_helpers.rb @@ -291,8 +291,9 @@ module Bundler def set_rubyopt rubyopt = [ENV["RUBYOPT"]].compact - return if !rubyopt.empty? && rubyopt.first =~ %r{-rbundler/setup} - rubyopt.unshift %(-rbundler/setup) + setup_require = "-r#{File.expand_path("setup", __dir__)}" + return if !rubyopt.empty? && rubyopt.first =~ /#{setup_require}/ + rubyopt.unshift %(#{setup_require}) Bundler::SharedHelpers.set_env "RUBYOPT", rubyopt.join(" ") end |