Class: Rex::Ui::Text::Input::Stdio
- Inherits:
-
Rex::Ui::Text::Input
- Object
- Rex::Ui::Text::Input
- Rex::Ui::Text::Input::Stdio
- Defined in:
- lib/rex/ui/text/input/stdio.rb
Overview
This class implements input against standard in.
Constant Summary
Constants included from Color
Instance Attribute Summary
Attributes inherited from Rex::Ui::Text::Input
#config, #eof, #prompt, #prompt_char
Instance Method Summary collapse
-
#eof? ⇒ Boolean
Returns whether or not EOF has been reached on stdin.
-
#fd ⇒ Object
Returns the file descriptor associated with standard input.
-
#gets ⇒ Object
Wait for a line of input to be read from standard input.
-
#sysread(len = 1) ⇒ Object
Reads text from standard input.
Methods inherited from Rex::Ui::Text::Input
#auto_color, #disable_color, #enable_color, #initialize, #intrinsic_shell?, #reset_color, #reset_tab_completion, #supports_readline, #update_prompt
Methods included from Color
#ansi, #colorize, #do_colorize, #reset_color, #substitute_colors
Constructor Details
This class inherits a constructor from Rex::Ui::Text::Input
Instance Method Details
#eof? ⇒ Boolean
Returns whether or not EOF has been reached on stdin.
32 33 34 |
# File 'lib/rex/ui/text/input/stdio.rb', line 32 def eof? $stdin.closed? end |
#fd ⇒ Object
Returns the file descriptor associated with standard input.
39 40 41 |
# File 'lib/rex/ui/text/input/stdio.rb', line 39 def fd return $stdin end |
#gets ⇒ Object
Wait for a line of input to be read from standard input.
25 26 27 |
# File 'lib/rex/ui/text/input/stdio.rb', line 25 def gets return $stdin.gets end |
#sysread(len = 1) ⇒ Object
Reads text from standard input.
18 19 20 |
# File 'lib/rex/ui/text/input/stdio.rb', line 18 def sysread(len = 1) $stdin.sysread(len) end |