diff options
author | David RodrÃguez <[email protected]> | 2022-04-26 14:53:55 +0200 |
---|---|---|
committer | git <[email protected]> | 2022-04-28 15:44:02 +0900 |
commit | 5250210aa9f632a415e90deaac424ff69c37fb3e (patch) | |
tree | c54023a390d9aaf8da705d377a37704c621bfcc8 /lib/bundler/endpoint_specification.rb | |
parent | 4210ae2158b545beda908fb29e03d23994f262e3 (diff) |
[rubygems/rubygems] Fix missing required rubygems version when using old APIs
A while ago, we fixed resolution when using old dependency endpoints to
also consider metadata dependencies, by requesting the full gemspec from
the marsahaled index, which includes this information as opposed to
these old APIs. This has made resolution slower, but correct, but also
introduced the issue that some old marshaled gemspecs don't include the
`required_rubygems_version` field because they were created with a
RubyGems version that predates its addition.
Use a default value in this case.
https://github.com/rubygems/rubygems/commit/5dc94afcc0
Co-authored-by: Ilya Dudarenko <[email protected]>
Diffstat (limited to 'lib/bundler/endpoint_specification.rb')
-rw-r--r-- | lib/bundler/endpoint_specification.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/bundler/endpoint_specification.rb b/lib/bundler/endpoint_specification.rb index f3260a38e6..e9aa366b41 100644 --- a/lib/bundler/endpoint_specification.rb +++ b/lib/bundler/endpoint_specification.rb @@ -26,8 +26,11 @@ module Bundler @required_ruby_version ||= _remote_specification.required_ruby_version end + # 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+. def required_rubygems_version - @required_rubygems_version ||= _remote_specification.required_rubygems_version + @required_rubygems_version ||= _remote_specification.required_rubygems_version || Gem::Requirement.default end def fetch_platform |