class ProgressBar::Outputs::NonTty

Constants

DEFAULT_FORMAT_STRING

Attributes

last_update_length[W]

Public Instance Methods

bar_update_string() click to toggle source
# File lib/ruby-progressbar/outputs/non_tty.rb, line 18
def bar_update_string
  formatted_string        = bar.to_s
  formatted_string        = formatted_string[0...-1] unless bar.finished?

  output_string           = formatted_string[last_update_length..-1]
  self.last_update_length = formatted_string.length

  output_string.to_s
end
clear() click to toggle source
# File lib/ruby-progressbar/outputs/non_tty.rb, line 8
def clear
  self.last_update_length = 0

  stream.print "\n"
end
default_format() click to toggle source
# File lib/ruby-progressbar/outputs/non_tty.rb, line 28
def default_format
  DEFAULT_FORMAT_STRING
end
eol() click to toggle source
# File lib/ruby-progressbar/outputs/non_tty.rb, line 38
def eol
  bar.stopped? ? "\n" : ''
end
last_update_length() click to toggle source
# File lib/ruby-progressbar/outputs/non_tty.rb, line 14
def last_update_length
  @last_update_length ||= 0
end
refresh_with_format_change(*) click to toggle source
# File lib/ruby-progressbar/outputs/non_tty.rb, line 36
def refresh_with_format_change(*); end
resolve_format(*) click to toggle source
# File lib/ruby-progressbar/outputs/non_tty.rb, line 32
def resolve_format(*)
  default_format
end