Skip to content
Browse files

Fix bug involving source ordering and pinning

  • Loading branch information...
1 parent ff7b89d commit a9e9b906fdb0d3602200ef057a5e309c7981c888 @wycats wycats committed Mar 2, 2012
Showing with 9 additions and 1 deletion.
  1. +9 −1 lib/bundler/index.rb
View
10 lib/bundler/index.rb
@@ -1,3 +1,5 @@
+require "set"
+
module Bundler
class Index
include Enumerable
@@ -41,9 +43,15 @@ def empty?
# about, returning all of the results.
def search(query, base = nil)
results = local_search(query, base)
+ seen = Set.new(results.map { |spec| [spec.name, spec.version, spec.platform] })
+
@sources.each do |source|
- results += source.search(query, base)
+ source.search(query, base).each do |spec|
+ results << spec unless seen.include?([spec.name, spec.version, spec.platform])
+ seen << [spec.name, spec.version, spec.platform]
+ end
end
+
results
end

0 comments on commit a9e9b90

Please sign in to comment.
Something went wrong with that request. Please try again.