diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2022-04-28 17:15:43 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2022-04-28 19:08:49 +0900 |
commit | 1056489ea3e1c3f201936666b2725bfc142bb0f2 (patch) | |
tree | cc993148b660f7cc2d92823ccfafcf10d3009c0a /lib/bundler/rubygems_ext.rb | |
parent | cd2410f9d8c99fd0fbb232eb5f195188fbfc122f (diff) | |
download | ruby-1056489ea3e1c3f201936666b2725bfc142bb0f2.tar.gz |
Merge https://github.com/rubygems/rubygems/commit/3f7d0352e84b29d4a2d4cd93b31e5ebdb5f79cc6
Diffstat (limited to 'lib/bundler/rubygems_ext.rb')
-rw-r--r-- | lib/bundler/rubygems_ext.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb index 78422ceb76..b0e35e005e 100644 --- a/lib/bundler/rubygems_ext.rb +++ b/lib/bundler/rubygems_ext.rb @@ -67,6 +67,23 @@ module Gem full_gem_path end + unless const_defined?(:LATEST_RUBY_WITHOUT_PATCH_VERSIONS) + LATEST_RUBY_WITHOUT_PATCH_VERSIONS = Gem::Version.new("2.1") + + alias_method :rg_required_ruby_version=, :required_ruby_version= + def required_ruby_version=(req) + self.rg_required_ruby_version = req + + @required_ruby_version.requirements.map! do |op, v| + if v >= LATEST_RUBY_WITHOUT_PATCH_VERSIONS && v.release.segments.size == 4 + [op == "~>" ? "=" : op, Gem::Version.new(v.segments.tap {|s| s.delete_at(3) }.join("."))] + else + [op, v] + end + end + end + end + def groups @groups ||= [] end |