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.



5
6
7
8
# File 'lib/vop/shell/shell_input_readline.rb', line 5

def initialize(completion_method)
  Readline.completion_append_character = ""
  Readline.completion_proc = completion_method
end

Instance Method Details

#exitObject



14
15
16
# File 'lib/vop/shell/shell_input_readline.rb', line 14

def exit
  Kernel.exit
end

#read(prompt) ⇒ Object



10
11
12
# File 'lib/vop/shell/shell_input_readline.rb', line 10

def read(prompt)
  Readline.readline(prompt, true)
end