summaryrefslogtreecommitdiff
path: root/lib/bundler
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-07-23 15:25:28 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-07-23 16:43:59 +0200
commitcaf13e9e4fb2455199741dd81117f580f894af67 (patch)
treeae9dde0e645a30845766c78389dca7f9cf0f3e45 /lib/bundler
parent9ddeeb1fe1b9febd650460dd792d0db40cb3d986 (diff)
downloadbundler-caf13e9e4fb2455199741dd81117f580f894af67.tar.gz
Add workaround from old rubygemsrelax_bundler_binstub
In these versions, the `approximate_recommendation` method doesn't include the prerelease logic.
Diffstat (limited to 'lib/bundler')
-rw-r--r--lib/bundler/templates/Executable.bundler10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/bundler/templates/Executable.bundler b/lib/bundler/templates/Executable.bundler
index 95748bba5e..69f26bb9c0 100644
--- a/lib/bundler/templates/Executable.bundler
+++ b/lib/bundler/templates/Executable.bundler
@@ -69,7 +69,15 @@ m = Module.new do
def bundler_requirement
return "#{Gem::Requirement.default}.a" unless bundler_version
- Gem::Version.new(bundler_version).approximate_recommendation
+ bundler_gem_version = Gem::Version.new(bundler_version)
+
+ requirement = bundler_gem_version.approximate_recommendation
+
+ return requirement unless Gem::Version.new(Gem::VERSION) < Gem::Version.new("2.7.0")
+
+ requirement += ".a" if bundler_gem_version.prerelease?
+
+ requirement
end
def load_bundler!