Class: Rex::Ui::Text::Output::Buffer
- Inherits:
-
Rex::Ui::Text::Output
- Object
- Output
- Rex::Ui::Text::Output
- Rex::Ui::Text::Output::Buffer
- Defined in:
- lib/rex/ui/text/output/buffer.rb,
lib/rex/ui/text/output/buffer/stdout.rb
Overview
This class implements output against a buffer.
Defined Under Namespace
Modules: Stdout
Constant Summary
Constants included from Color
Instance Attribute Summary collapse
-
#buf ⇒ Object
The underlying buffer state.
Attributes inherited from Rex::Ui::Text::Output
Instance Method Summary collapse
-
#dump_buffer ⇒ Object
Read everything out of the buffer and reset it.
-
#initialize ⇒ Buffer
constructor
Initializes an output buffer.
-
#print_raw(msg = '') ⇒ Object
Appends the supplied message to the output buffer.
-
#reset ⇒ Object
Reset the buffer to an empty string.
- #supports_color? ⇒ Boolean
Methods inherited from Rex::Ui::Text::Output
#auto_color, #disable_color, #enable_color, #print, #print_debug, #print_error, #print_good, #print_line, #print_status, #print_warning, #update_prompt
Methods included from Color
#ansi, #colorize, #do_colorize, #reset_color, #substitute_colors
Methods inherited from Output
#flush, #print, #print_debug, #print_error, #print_good, #print_line, #print_status, #print_warning, #prompting, #prompting?
Constructor Details
#initialize ⇒ Buffer
Initializes an output buffer.
18 19 20 |
# File 'lib/rex/ui/text/output/buffer.rb', line 18 def initialize self.buf = '' end |
Instance Attribute Details
#buf ⇒ Object
The underlying buffer state.
56 57 58 |
# File 'lib/rex/ui/text/output/buffer.rb', line 56 def buf @buf end |
Instance Method Details
#dump_buffer ⇒ Object
Read everything out of the buffer and reset it
39 40 41 42 43 44 |
# File 'lib/rex/ui/text/output/buffer.rb', line 39 def dump_buffer self.buf ||= '' buffer = self.buf.dup reset() buffer end |
#print_raw(msg = '') ⇒ Object
Appends the supplied message to the output buffer.
29 30 31 32 33 |
# File 'lib/rex/ui/text/output/buffer.rb', line 29 def print_raw(msg = '') self.buf += msg || '' msg end |
#reset ⇒ Object
Reset the buffer to an empty string.
49 50 51 |
# File 'lib/rex/ui/text/output/buffer.rb', line 49 def reset self.buf = '' end |
#supports_color? ⇒ Boolean
22 23 24 |
# File 'lib/rex/ui/text/output/buffer.rb', line 22 def supports_color? false end |