Class: Dooby::ReadlineHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/dooby/readline_helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeReadlineHelper

Returns a new instance of ReadlineHelper.



5
6
7
8
9
10
11
# File 'lib/dooby/readline_helper.rb', line 5

def initialize
  @completion_list = ''
  @completion_proc = proc { |s| @completion_list.grep( /^#{Regexp.escape(s)}/ ) }
  
  Readline.completion_append_character = " "
  Readline.completion_proc = @completion_proc
end

Instance Attribute Details

#completion_listObject

Returns the value of attribute completion_list.



3
4
5
# File 'lib/dooby/readline_helper.rb', line 3

def completion_list
  @completion_list
end