[rubygems/rubygems] #to_spec must fallback for prereleases always

https://github.com/rubygems/rubygems/commit/6302798a32
This commit is contained in:
Kim Emmanuel 2024-01-31 18:29:06 -03:00 committed by git
parent aaef443a59
commit 0edf5a714b

View File

@ -328,9 +328,9 @@ class Gem::Dependency
return active if active
unless prerelease?
# Move prereleases to the end of the list for >= 0 requirements
# Consider prereleases only as a fallback
pre, matches = matches.partition {|spec| spec.version.prerelease? }
matches += pre if requirement == Gem::Requirement.default || matches.empty?
matches = pre if matches.empty?
end
matches.first