[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
This commit is contained in:
parent
72db2e00d4
commit
1976b38f7a
@ -768,7 +768,7 @@ str = ARGV.first
|
|||||||
if str
|
if str
|
||||||
str = str.b[/\\A_(.*)_\\z/, 1]
|
str = str.b[/\\A_(.*)_\\z/, 1]
|
||||||
if str and Gem::Version.correct?(str)
|
if str and Gem::Version.correct?(str)
|
||||||
version = str
|
#{explicit_version_requirement(spec.name)}
|
||||||
ARGV.shift
|
ARGV.shift
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -791,6 +791,16 @@ Gem.use_gemdeps
|
|||||||
TEXT
|
TEXT
|
||||||
end
|
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
|
# return the stub script text used to launch the true Ruby script
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user