aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2021-12-12 20:43:09 +0100
committergit <svn-admin@ruby-lang.org>2021-12-20 07:42:53 +0900
commit1976b38f7a4e1884852653508ec1160c8b581363 (patch)
tree503d4468a603ba3ab435f49d40a36547e4c291e2
parent72db2e00d4edb7a0e316a5979316595a67069d97 (diff)
downloadruby-1976b38f7a4e1884852653508ec1160c8b581363.tar.gz
[rubygems/rubygems] Add support in binstubs for trampolining bundler
If `bundler _<version>_` is given, I guess the most reasonable approach is to completely skip version switching, because the user is technically opting out of it. But since binstubs completely remove this argument from `ARGV` after processing it, we have no way of detecting that it was actually passed in the first place in order to skip the feature. So we set `BUNDLER_VERSION` explicitly in this case. https://github.com/rubygems/rubygems/commit/e0f360d6d7
-rw-r--r--lib/rubygems/installer.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb
index 8e3965ef92..ab09c18280 100644
--- a/lib/rubygems/installer.rb
+++ b/lib/rubygems/installer.rb
@@ -768,7 +768,7 @@ str = ARGV.first
if str
str = str.b[/\\A_(.*)_\\z/, 1]
if str and Gem::Version.correct?(str)
- version = str
+ #{explicit_version_requirement(spec.name)}
ARGV.shift
end
end
@@ -791,6 +791,16 @@ Gem.use_gemdeps
TEXT
end
+ def explicit_version_requirement(name)
+ code = "version = str"
+ return code unless name == "bundler"
+
+ code += <<-TEXT
+
+ ENV['BUNDLER_VERSION'] = str
+TEXT
+ end
+
##
# return the stub script text used to launch the true Ruby script