1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[bundler/bundler] Add workaround from old rubygems

In these versions, the `approximate_recommendation` method doesn't
include the prerelease logic.

https://github.com/bundler/bundler/commit/caf13e9e4f
This commit is contained in:
David Rodríguez 2019-07-23 15:25:28 +02:00 committed by Hiroshi SHIBATA
parent cb6abf551a
commit bb50f87b69
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2

View file

@ -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!