summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKim Emmanuel <kim.emmanuel@gmail.com>2024-01-27 02:58:45 -0300
committergit <svn-admin@ruby-lang.org>2024-02-07 05:46:49 +0000
commit5ddf4f5c95ae24eda6a89afb885410991f010abd (patch)
tree1a52d197884d25791f380874baa0963a8f9a99f6 /lib
parent2dba441397d338617e1b605104d8b42b5311a482 (diff)
[rubygems/rubygems] fix Gem::Dependency#to_spec returning nil when prerelease is the only available version
https://github.com/rubygems/rubygems/commit/a7dcc7214b
Diffstat (limited to 'lib')
-rw-r--r--lib/rubygems/dependency.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rubygems/dependency.rb b/lib/rubygems/dependency.rb
index 00eff2dfe7..2f0dcba0ea 100644
--- a/lib/rubygems/dependency.rb
+++ b/lib/rubygems/dependency.rb
@@ -330,7 +330,7 @@ class Gem::Dependency
unless prerelease?
# Move prereleases to the end of the list for >= 0 requirements
pre, matches = matches.partition {|spec| spec.version.prerelease? }
- matches += pre if requirement == Gem::Requirement.default
+ matches += pre if requirement == Gem::Requirement.default || matches.empty?
end
matches.first