summaryrefslogtreecommitdiff
path: root/lib/bundler/index.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2022-08-24 10:05:20 +0200
committergit <svn-admin@ruby-lang.org>2022-09-12 22:13:29 +0900
commit6a21d196ba774f219956ede5d4cf276b1af433c4 (patch)
tree1d7061c4114f8cb7dda9ff0b2137081bdf4f0f55 /lib/bundler/index.rb
parent8d2bcc88ffe603290099d626cab40afcc834a12f (diff)
[rubygems/rubygems] Let specs be sorted just once by the gem version promoter
https://github.com/rubygems/rubygems/commit/3cea25a39d
Diffstat (limited to 'lib/bundler/index.rb')
-rw-r--r--lib/bundler/index.rb14
1 files changed, 1 insertions, 13 deletions
diff --git a/lib/bundler/index.rb b/lib/bundler/index.rb
index c639936cb0..9c48c9032b 100644
--- a/lib/bundler/index.rb
+++ b/lib/bundler/index.rb
@@ -57,16 +57,12 @@ module Bundler
# Search this index's specs, and any source indexes that this index knows
# about, returning all of the results.
def search(query)
- sort_specs(unsorted_search(query))
- end
-
- def unsorted_search(query)
results = local_search(query)
seen = results.map(&:full_name).uniq unless @sources.empty?
@sources.each do |source|
- source.unsorted_search(query).each do |spec|
+ source.search(query).each do |spec|
next if seen.include?(spec.full_name)
seen << spec.full_name
@@ -76,14 +72,6 @@ module Bundler
results
end
- protected :unsorted_search
-
- def sort_specs(specs)
- specs.sort_by do |s|
- platform_string = s.platform.to_s
- [s.version, platform_string == RUBY ? NULL : platform_string]
- end
- end
def local_search(query)
case query