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, mods, &block) ⇒ ModuleProgressbar
constructor
A new instance of ModuleProgressbar.
- #write(event) ⇒ Object
Constructor Details
#initialize(title, mods, &block) ⇒ ModuleProgressbar
Returns a new instance of ModuleProgressbar.
465 466 467 468 469 470 471 472 473 474 475 476 |
# File 'lib/build-tool/commands.rb', line 465 def initialize( title, mods, &block ) super( title, mods.size ) do mods.each_with_index do |mod, i| if @pbar @pbar.set( i ) @pbar.title= mod.name.split( '/' )[-1] end yield mod end @pbar.title= 'finished' if @pbar end end |
Instance Method Details
#write(event) ⇒ Object
479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 |
# File 'lib/build-tool/commands.rb', line 479 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 @pbar.clear() if @pbar @oldlogger.append(event) rescue Exception => e error( e ) verbose( e.backtrace.join("\n") ) end end end |