Class: Rex::Ui::Text::Output::Socket
- Inherits:
-
Rex::Ui::Text::Output
- Object
- Output
- Rex::Ui::Text::Output
- Rex::Ui::Text::Output::Socket
- Defined in:
- lib/rex/ui/text/output/socket.rb
Overview
This class implements the output interface against a socket.
Instance Attribute Summary
Attributes inherited from Rex::Ui::Text::Output
Instance Method Summary collapse
-
#initialize(sock) ⇒ Socket
constructor
A new instance of Socket.
-
#print_raw(msg = '') ⇒ Object
Prints the supplied message to the socket.
- #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, #reset, #update_prompt
Methods inherited from Output
#flush, #print, #print_error, #print_good, #print_line, #print_status, #print_warning, #prompting, #prompting?
Constructor Details
#initialize(sock) ⇒ Socket
Returns a new instance of Socket.
14 15 16 17 |
# File 'lib/rex/ui/text/output/socket.rb', line 14 def initialize(sock) @sock = sock super() end |
Instance Method Details
#print_raw(msg = '') ⇒ Object
Prints the supplied message to the socket.
32 33 34 35 36 37 |
# File 'lib/rex/ui/text/output/socket.rb', line 32 def print_raw(msg = '') @sock.write(msg) @sock.flush msg end |
#supports_color? ⇒ Boolean
19 20 21 22 23 24 25 26 27 |
# File 'lib/rex/ui/text/output/socket.rb', line 19 def supports_color? case config[:color] when true # Allow color if the user forces it on return true else false end end |