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
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_error, #print_good, #print_line, #print_status, #print_warning, #puts, #update_prompt
Methods inherited from Output
#flush, #print, #print_error, #print_good, #print_line, #print_status, #print_warning, #prompting, #prompting?
Constructor Details
#initialize ⇒ Buffer
Initializes an output buffer.
17 18 19 |
# File 'lib/rex/ui/text/output/buffer.rb', line 17 def initialize self.buf = '' end |
Instance Attribute Details
#buf ⇒ Object
The underlying buffer state.
55 56 57 |
# File 'lib/rex/ui/text/output/buffer.rb', line 55 def buf @buf end |
Instance Method Details
#dump_buffer ⇒ Object
Read everything out of the buffer and reset it
38 39 40 41 42 43 |
# File 'lib/rex/ui/text/output/buffer.rb', line 38 def dump_buffer self.buf ||= '' buffer = self.buf.dup reset() buffer end |
#print_raw(msg = '') ⇒ Object
Appends the supplied message to the output buffer.
28 29 30 31 32 |
# File 'lib/rex/ui/text/output/buffer.rb', line 28 def print_raw(msg = '') self.buf += msg || '' msg end |
#reset ⇒ Object
Reset the buffer to an empty string.
48 49 50 |
# File 'lib/rex/ui/text/output/buffer.rb', line 48 def reset self.buf = '' end |
#supports_color? ⇒ Boolean
21 22 23 |
# File 'lib/rex/ui/text/output/buffer.rb', line 21 def supports_color? false end |