summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2022-01-17 18:55:10 +0100
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2022-01-19 11:20:36 +0900
commite7249294fb85953c3caa0af1eb9d3627a4827a11 (patch)
tree0d2664c2f971825e3a449dc8f059119f12b89c35 /lib
parent39c36a5cf45fc6a779b88c22571075da45cb70e4 (diff)
[rubygems/rubygems] Fix regression with old marshaled specs having null required_rubygems_version
https://github.com/rubygems/rubygems/commit/91f07a0208
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/remote_specification.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/bundler/remote_specification.rb b/lib/bundler/remote_specification.rb
index 89b69e1045..4e966b820a 100644
--- a/lib/bundler/remote_specification.rb
+++ b/lib/bundler/remote_specification.rb
@@ -27,6 +27,13 @@ module Bundler
@platform = _remote_specification.platform
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 || Gem::Requirement.default
+ end
+
def full_name
if platform == Gem::Platform::RUBY || platform.nil?
"#{@name}-#{@version}"