Class: BuildTool::Commands::ModuleProgressbar
- Inherits:
-
MJ::Logging::Progressbar
- Object
- Logging::Appender
- MJ::Logging::Progressbar
- BuildTool::Commands::ModuleProgressbar
- Defined in:
- lib/build-tool/commands.rb
Overview
class Standard
Instance Method Summary collapse
-
#initialize(title, mod, &block) ⇒ ModuleProgressbar
constructor
A new instance of ModuleProgressbar.
- #write(event) ⇒ Object
Constructor Details
#initialize(title, mod, &block) ⇒ ModuleProgressbar
Returns a new instance of ModuleProgressbar.
457 458 459 460 461 462 463 464 465 466 467 468 |
# File 'lib/build-tool/commands.rb', line 457 def initialize( title, mod, &block ) super( title, mod.size ) do mod.each_with_index do |mod, i| if .set( i ) .title= mod.name.split( '/' )[-1] end yield mod end .title= 'finished' if end end |
Instance Method Details
#write(event) ⇒ Object
471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 |
# File 'lib/build-tool/commands.rb', line 471 def write( event ) = event.data return if .empty? # Remove the progressbar and print the message case event.level when ::Logging::level_num( :ERROR ), ::Logging::level_num( :WARN ), ::Logging::level_num( :INFO ) begin .clear() if @oldlogger.append(event) rescue Exception => e error( e ) verbose( e.backtrace.join("\n") ) end end end |