Method: ProgressBar#initialize
- Defined in:
- lib/taps/progress_bar.rb
#initialize(title, total, out = STDERR) ⇒ ProgressBar
Returns a new instance of ProgressBar.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/taps/progress_bar.rb', line 15 def initialize (title, total, out = STDERR) @title = title @total = total @out = out @terminal_width = 80 = "=" @current = 0 @previous = 0 @finished_p = false @start_time = Time.now @previous_time = @start_time @title_width = 14 @format = "%-#{@title_width}s %3d%% %s %s" @format_arguments = [:title, :percentage, :bar, :stat] clear show end |