diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2022-08-22 11:52:51 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2022-08-23 10:45:57 +0900 |
commit | f69244cee8c01d82e94d38032c82be684f37808a (patch) | |
tree | 40dc0819f3a987867788fe1f752f8088ff209004 /lib/bundler/match_remote_metadata.rb | |
parent | 4790d0accdb745f9d8e605fd42eab712e4ebf834 (diff) |
Merge rubygems/bundler HEAD
Pick from https://github.com/rubygems/rubygems/commit/6b3a5a9ab0453463381a8164efb6298ea9eb776f
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6268
Diffstat (limited to 'lib/bundler/match_remote_metadata.rb')
-rw-r--r-- | lib/bundler/match_remote_metadata.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/bundler/match_remote_metadata.rb b/lib/bundler/match_remote_metadata.rb new file mode 100644 index 0000000000..e1b2f4d0e2 --- /dev/null +++ b/lib/bundler/match_remote_metadata.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Bundler + module FetchMetadata + def matches_current_ruby? + @required_ruby_version ||= _remote_specification.required_ruby_version + + super + end + + def matches_current_rubygems? + # A fallback is included because the original version of the specification + # API didn't include that field, so some marshalled specs in the index have it + # set to +nil+. + @required_rubygems_version ||= _remote_specification.required_rubygems_version || Gem::Requirement.default + + super + end + end + + module MatchRemoteMetadata + include MatchMetadata + + prepend FetchMetadata + end +end |