Class: ProgressBar::Outputs::Tty
Constant Summary
collapse
- DEFAULT_FORMAT_STRING =
'%t: |%B|'.freeze
ProgressBar::Output::DEFAULT_OUTPUT_STREAM
Instance Attribute Summary
#stream
Instance Method Summary
collapse
#clear_string, detect, #initialize, #length, #log, #refresh, #with_refresh
Instance Method Details
#bar_update_string ⇒ Object
15
16
17
|
# File 'lib/ruby-progressbar/outputs/tty.rb', line 15
def bar_update_string
bar.to_s
end
|
#clear ⇒ Object
10
11
12
13
|
# File 'lib/ruby-progressbar/outputs/tty.rb', line 10
def clear
stream.print clear_string
stream.print "\r"
end
|
19
20
21
|
# File 'lib/ruby-progressbar/outputs/tty.rb', line 19
def default_format
ENV['RUBY_PROGRESS_BAR_FORMAT'] || DEFAULT_FORMAT_STRING
end
|
#eol ⇒ Object
27
28
29
|
# File 'lib/ruby-progressbar/outputs/tty.rb', line 27
def eol
bar.stopped? ? "\n" : "\r"
end
|
23
24
25
|
# File 'lib/ruby-progressbar/outputs/tty.rb', line 23
def resolve_format(other_format)
other_format || default_format
end
|