summaryrefslogtreecommitdiff
path: root/lib/bundler/index.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2021-02-01 16:17:16 +0100
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-03-08 13:47:35 +0900
commit53468cc11147b0d285fc376fc546b677dad600ca (patch)
treeeb9c97f544d089be2d324126b025b11f41a22c90 /lib/bundler/index.rb
parent2ab6b7a7516e1b2c48a66ce513afabb62d101461 (diff)
Sync latest development version of bundler & rubygems
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4143
Diffstat (limited to 'lib/bundler/index.rb')
-rw-r--r--lib/bundler/index.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/bundler/index.rb b/lib/bundler/index.rb
index f26f542fde..f945176037 100644
--- a/lib/bundler/index.rb
+++ b/lib/bundler/index.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require "set"
-
module Bundler
class Index
include Enumerable
@@ -65,11 +63,14 @@ module Bundler
def unsorted_search(query, base)
results = local_search(query, base)
- seen = results.map(&:full_name).to_set unless @sources.empty?
+ seen = results.map(&:full_name).uniq unless @sources.empty?
@sources.each do |source|
source.unsorted_search(query, base).each do |spec|
- results << spec if seen.add?(spec.full_name)
+ next if seen.include?(spec.full_name)
+
+ seen << spec.full_name
+ results << spec
end
end
@@ -170,7 +171,7 @@ module Bundler
def dependencies_eql?(spec, other_spec)
deps = spec.dependencies.select {|d| d.type != :development }
other_deps = other_spec.dependencies.select {|d| d.type != :development }
- Set.new(deps) == Set.new(other_deps)
+ deps.sort == other_deps.sort
end
def add_source(index)