summaryrefslogtreecommitdiff
path: root/lib/bundler
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2022-04-26 14:53:55 +0200
committergit <svn-admin@ruby-lang.org>2022-04-28 15:44:02 +0900
commit5250210aa9f632a415e90deaac424ff69c37fb3e (patch)
treec54023a390d9aaf8da705d377a37704c621bfcc8 /lib/bundler
parent4210ae2158b545beda908fb29e03d23994f262e3 (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 <i.dudarenko@tinkoff.ru>
Diffstat (limited to 'lib/bundler')
-rw-r--r--lib/bundler/endpoint_specification.rb5
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