Class: Vop::ShellInputReadline

Inherits:
Object
  • Object
show all
Defined in:
lib/vop/shell/shell_input_readline.rb

Instance Method Summary collapse

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

#exitObject



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