Class PowerBar
In: lib/powerbar.rb
Parent: Object

This is PowerBar - The last progressbar-library you‘ll ever need.

Methods

bar   close   done   elapsed   eta   h_bar   h_done   h_elapsed   h_eta   h_msg   h_percent   h_rate   h_total   hook_exit   msg   new   percent   print   rate   render   scope   settings   show   terminal_width   total   update   wipe  

Classes and Modules

Class PowerBar::Rate

Constants

STRIP_ANSI = Regexp.compile '\e\[(\d+)(;\d+)?(;\d+)?[m|K]', nil
RUBY18 = RUBY_VERSION[0..2] == "1.8"
HQ_UNITS = %w(b k M G T).freeze

Public Class methods

Public Instance methods

Render the actual bar-portion of the PowerBar. The length of the bar is determined from the template. Returns nil if the bar-length would be == 0.

Print the close-template and defuse the exit-hook. Be a good citizen, always close your PowerBars!

returns nil when eta is < 1 second

Hook at_exit to ensure cleanup if we get interrupted

Remove progress-bar, print a message

Render the PowerBar and return as a string.

settings under current scope (e.g. tty.infinite)

Output the PowerBar. Returns true if bar was shown, false otherwise.

Update state (and settings) without printing anything.

Remove the PowerBar from the screen.

[Validate]