Class: Progress

Inherits:
Object
  • Object
show all
Defined in:
lib/progress.rb

Direct Known Subclasses

ProgressBar

Instance Method Summary collapse

Constructor Details

#initializeProgress

Returns a new instance of Progress.



5
6
7
# File 'lib/progress.rb', line 5

def initialize()
    @last_line = ""
end

Instance Method Details



15
16
17
18
# File 'lib/progress.rb', line 15

def print_line(line)
   print "\033[M#{line}\n#{@last_line}"
   $stdout.flush()
end

#update_last_line(last_line) ⇒ Object



9
10
11
12
13
# File 'lib/progress.rb', line 9

def update_last_line(last_line)
   @last_line = last_line
   print "\033[M#{last_line}"
   $stdout.flush()
end