class PbSyringe::AnsiProgressbarUnit

Attributes

progressbar[R]

Public Instance Methods

finish() click to toggle source
# File lib/pb_syringe/ansi_progressbar_unit.rb, line 16
def finish
  @progressbar.finish if @progressbar
  @progressbar = nil
  $stderr.sync = false
  $stdout.sync = false
end
increment(count) click to toggle source
# File lib/pb_syringe/ansi_progressbar_unit.rb, line 12
def increment(count)
  @progressbar.inc(count) if @progressbar
end
start(**options) click to toggle source
# File lib/pb_syringe/ansi_progressbar_unit.rb, line 6
def start(**options)
  $stdout.sync = true
  $stderr.sync = true
  @progressbar = ANSI::Progressbar.new(options[:label], options[:total])
end