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.
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, #disable_readline, #enable_color, #enable_readline, #initialize, #intrinsic_shell?, #reset_color, #reset_tab_completion, #supports_readline, #update_prompt
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.
31 32 33 |
# File 'lib/rex/ui/text/input/stdio.rb', line 31 def eof? $stdin.closed? end |
#fd ⇒ Object
Returns the file descriptor associated with standard input.
38 39 40 |
# File 'lib/rex/ui/text/input/stdio.rb', line 38 def fd return $stdin end |
#gets ⇒ Object
Wait for a line of input to be read from standard input.
24 25 26 |
# File 'lib/rex/ui/text/input/stdio.rb', line 24 def gets return $stdin.gets end |
#sysread(len = 1) ⇒ Object
Reads text from standard input.
17 18 19 |
# File 'lib/rex/ui/text/input/stdio.rb', line 17 def sysread(len = 1) $stdin.sysread(len) end |