class Rex::Ui::Text::ProgressTracker
This module implements progress tracking against a text interface.
Attributes
output[RW]
Public Class Methods
new(output)
click to toggle source
# File lib/rex/ui/text/progress_tracker.rb, line 14 def initialize(output) self.output = output self.start = 0 self.stop = 0 self.pos = 0 end
Public Instance Methods
abort(msg = '')
click to toggle source
Progress has been aborted, the reason is supplied in msg.
# File lib/rex/ui/text/progress_tracker.rb, line 46 def abort(msg = '') output.print_error("fatal: #{msg}") end
error(msg = '')
click to toggle source
An error occurred that may result in aborting the progress.
# File lib/rex/ui/text/progress_tracker.rb, line 39 def error(msg = '') output.print_error(msg) end
status(msg = '')
click to toggle source
Passes a generic status message that isn’t necessarily associated with a step event.
# File lib/rex/ui/text/progress_tracker.rb, line 25 def status(msg = '') output.print_status(msg) end
step_status(msg = '')
click to toggle source
Updates the status associated with the current step.
# File lib/rex/ui/text/progress_tracker.rb, line 32 def step_status(msg = '') output.print_status("#{pos}: #{msg}") if (msg and msg.length > 0) end