summaryrefslogtreecommitdiff
path: root/lib/bundler/definition.rb
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2017-10-16 09:58:58 +0000
committerThe Bundler Bot <bot@bundler.io>2017-10-16 09:58:58 +0000
commit6c90bcb2969a302c33c8117b50c06543f3ba4741 (patch)
tree25a634f8f9dc2218ce1b883fda8512512db66f99 /lib/bundler/definition.rb
parent69ca440c3a122b65e95dbcc203383ee835158e1c (diff)
parent803200c01b663df8f11f18c7038c578939b9ed5d (diff)
downloadbundler-6c90bcb2969a302c33c8117b50c06543f3ba4741.tar.gz
Auto merge of #6098 - akhramov:fix/doubled-message-in-verbose-mode, r=segiddins
Fix doubled message in verbose mode ### What was the end-user problem that led to this PR? The problem was doubled informative message in verbose mode (#6028) ### What was your diagnosis of the problem? `Bundler::Definition#missing_specs?` clears the `@resolve` ivar due to the fact that `ensure` clause evaluates regardless whether exception occurred. That results in repeated resolution, and, therefore, in repeated debug messages. ### What is your fix for the problem, implemented in this PR? This change moves ivars clearing into the `rescue` clause, so `@resolve` will be cleared only in case when `BundlerError` occurs ### Why did you choose this fix out of the possible options? I chose this fix because running deps resolution twice is a bad idea anyway and it needs to be prevented.
Diffstat (limited to 'lib/bundler/definition.rb')
-rw-r--r--lib/bundler/definition.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index f4022da04e..5ae0f2e793 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -205,19 +205,18 @@ module Bundler
end
def missing_specs?
- missing = []
- resolve.materialize(requested_dependencies, missing)
+ missing = missing_specs
return false if missing.empty?
Bundler.ui.debug "The definition is missing #{missing.map(&:full_name)}"
true
rescue BundlerError => e
- Bundler.ui.debug "The definition is missing dependencies, failed to resolve & materialize locally (#{e})"
- true
- ensure
@index = nil
@resolve = nil
@specs = nil
@gem_version_promoter = nil
+
+ Bundler.ui.debug "The definition is missing dependencies, failed to resolve & materialize locally (#{e})"
+ true
end
def requested_specs