Module: Rex::Ui::Text::Shell::InputShell

Defined in:
lib/rex/ui/text/shell.rb

Overview

This module is meant to be mixed into an input medium class instance as a means of extending it to display a prompt before each call to gets.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#outputObject

Returns the value of attribute output.



25
26
27
# File 'lib/rex/ui/text/shell.rb', line 25

def output
  @output
end

#promptObject

Returns the value of attribute prompt.



25
26
27
# File 'lib/rex/ui/text/shell.rb', line 25

def prompt
  @prompt
end

Instance Method Details

#pgetsObject



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/rex/ui/text/shell.rb', line 27

def pgets

  output.print(prompt)
  output.flush

  output.prompting
  buf = gets
  output.prompting(false)

  buf
end