summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2017-04-03 21:11:46 -0500
committerSamuel Giddins <segiddins@segiddins.me>2017-04-03 21:11:46 -0500
commit3d518b56a8ed9b357428afd3d252302bd0df06a8 (patch)
treed1f5981aa2b776372bab9455ceb8244568de174d
parent47959cf97ca82292fc037f5118c89820446f4a35 (diff)
downloadbundler-seg-zoom-zoom.tar.gz
[Definition] Add comment explaining why we need to override a deps typeseg-zoom-zoom
-rw-r--r--lib/bundler/definition.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index 99cf1ee4e5..e31de3d38a 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -694,6 +694,12 @@ module Bundler
next
end
+ # Gem::Dependency#== matches Gem::Dependency#type. As the lockfile
+ # doesn't carry a notion of the dependency type, if you use
+ # add_development_dependency in a gemspec that's loaded with the gemspec
+ # directive, the lockfile dependencies and resolved dependencies end up
+ # with a mismatch on #type. Work around that by setting the type on the
+ # dep from the lockfile.
locked_dep.instance_variable_set(:@type, dependency.type)
# We already know the name matches from the hash lookup