зеркало из https://github.com/github/ruby.git
[rubygems/rubygems] Prefer reverse+find to select+last
https://github.com/rubygems/rubygems/commit/ffb161bb69
This commit is contained in:
Родитель
bc0de1e162
Коммит
5487e76374
|
@ -96,12 +96,12 @@ module Bundler
|
|||
else
|
||||
source.specs.search(self)
|
||||
end
|
||||
installable_candidates = candidates.select do |spec|
|
||||
best_installable_candidate = candidates.reverse.find do |spec|
|
||||
spec.is_a?(StubSpecification) ||
|
||||
(spec.required_ruby_version.satisfied_by?(Gem.ruby_version) &&
|
||||
spec.required_rubygems_version.satisfied_by?(Gem.rubygems_version))
|
||||
end
|
||||
search = installable_candidates.last || candidates.last
|
||||
search = best_installable_candidate || candidates.last
|
||||
search.dependencies = dependencies if search && (search.is_a?(RemoteSpecification) || search.is_a?(EndpointSpecification))
|
||||
search
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче