Class: Vop::ShellInputReadline
- Inherits:
-
Object
- Object
- Vop::ShellInputReadline
- Defined in:
- lib/vop/shell/shell_input_readline.rb
Instance Method Summary collapse
- #exit ⇒ Object
-
#initialize(completion_method) ⇒ ShellInputReadline
constructor
A new instance of ShellInputReadline.
- #read(prompt) ⇒ Object
Constructor Details
#initialize(completion_method) ⇒ ShellInputReadline
Returns a new instance of ShellInputReadline.
7 8 9 10 11 |
# File 'lib/vop/shell/shell_input_readline.rb', line 7 def initialize(completion_method) Readline.completion_append_character = "" Readline.completion_proc = completion_method Readline.completer_word_break_characters = "\t\n\"\\'\`@$><=;|&{(" # default, but without space end |
Instance Method Details
#exit ⇒ Object
17 18 19 |
# File 'lib/vop/shell/shell_input_readline.rb', line 17 def exit Kernel.exit end |
#read(prompt) ⇒ Object
13 14 15 |
# File 'lib/vop/shell/shell_input_readline.rb', line 13 def read(prompt) Readline.readline(prompt, true) end |