summaryrefslogtreecommitdiff
path: root/lib/bundler/index.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/index.rb')
-rw-r--r--lib/bundler/index.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/bundler/index.rb b/lib/bundler/index.rb
index c28a120990..f0ee411df8 100644
--- a/lib/bundler/index.rb
+++ b/lib/bundler/index.rb
@@ -134,10 +134,16 @@ module Bundler
def ==(other)
all? do |spec|
other_spec = other[spec].first
- other_spec && (spec.dependencies & other_spec.dependencies).empty? && spec.source == other_spec.source
+ other_spec && dependencies_eql?(spec, other_spec) && spec.source == other_spec.source
end
end
+ 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)
+ end
+
def add_source(index)
raise ArgumentError, "Source must be an index, not #{index.class}" unless index.is_a?(Index)
@sources << index