summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Rafaniello <jrafanie@redhat.com>2016-06-17 09:51:03 -0400
committerJoe Rafaniello <jrafanie@redhat.com>2016-06-17 12:57:28 -0400
commit1b66b1d4dbe779b658c67e1fd7094808aa6f34ee (patch)
treec08fff9a7552d789ac8ae368484e55797d4a124f
parent33e238d3b0a0a779ef7de1af02e0b34138f3cb66 (diff)
downloadbundler-1b66b1d4dbe779b658c67e1fd7094808aa6f34ee.tar.gz
Don't include dev dependencies when comparing indexes.
-rw-r--r--lib/bundler/index.rb8
-rw-r--r--spec/bundler/definition_spec.rb1
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/bundler/index.rb b/lib/bundler/index.rb
index d150fafb04..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 && Set.new(spec.dependencies) == Set.new(other_spec.dependencies) && 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
diff --git a/spec/bundler/definition_spec.rb b/spec/bundler/definition_spec.rb
index 02049b557a..a8ee3080f1 100644
--- a/spec/bundler/definition_spec.rb
+++ b/spec/bundler/definition_spec.rb
@@ -73,6 +73,7 @@ describe Bundler::Definition do
it "for a path gem with deps and no changes" do
build_lib "foo", "1.0", :path => lib_path("foo") do |s|
s.add_dependency "rack", "1.0"
+ s.add_development_dependency "net-ssh", "1.0"
end
install_gemfile <<-G