lib/autobuild/reporting.rb in autobuild-1.7.3.rc2 vs lib/autobuild/reporting.rb in autobuild-1.7.3.rc3
- old
+ new
@@ -85,10 +85,15 @@
# Displays a warning message
def self.warn(message, *style)
Autobuild.message(" WARN: #{message}", :magenta, *style)
end
+ # @return [Boolean] true if there is some progress messages for the given
+ # key
+ def self.has_progress_for?(key)
+ progress_messages.any? { |msg_key, _| msg_key == key }
+ end
def self.progress_start(key, *args)
if args.last.kind_of?(Hash)
options = Kernel.validate_options args.pop, :done_message => nil
else
@@ -106,10 +111,10 @@
end
if block_given?
begin
yield
- if options[:done_message]
+ if options[:done_message] && has_progress_for?(key)
progress(key, *options[:done_message])
end
progress_done(key, true)
rescue Exception => e
progress_done(key, false)