Type:
Module
Constants:
HISTORY : history

The history buffer. It extends Enumerable module, so it behaves just like an array. For example, gets the fifth content that the user input by HISTORY.

FILENAME_COMPLETION_PROC : fcomp

The Object with the call method that is a completion for filename. This is sets by ::completion_proc= method.

USERNAME_COMPLETION_PROC : ucomp

The Object with the call method that is a completion for usernames. This is sets by ::completion_proc= method.

VERSION : version

Version string of GNU Readline or libedit.

The Readline module provides interface for GNU Readline. This module defines a number of methods to facilitate completion and accesses input history from the Ruby interpreter. This module supported Edit Line(libedit) too. libedit is compatible with GNU Readline.

GNU Readline

www.gnu.org/directory/readline.html

libedit

www.thrysoee.dk/editline/

Reads one inputted line with line edit by ::readline method. At this time, the facilitatation completion and the key bind like Emacs can be operated like GNU Readline.

require "readline"
while buf = Readline.readline("> ", true)
  p buf
end

The content that the user input can be recorded to the history. The history can be accessed by Readline::HISTORY constant.

require "readline"
while buf = Readline.readline("> ", true)
  p Readline::HISTORY.to_a
  print("-> ", buf, "\n")
end

Most of methods raise SecurityError exception if $SAFE is 4.

Documented by TAKAO Kouji <kouji at takao7 dot net>.

get_screen_size

Readline.get_screen_size â [rows, columns] Class Public methods Returns the

2015-05-05 02:10:01
completion_proc=

Readline.completion_proc = proc Class Public methods Specifies a

2015-05-05 01:56:48
basic_quote_characters

Readline.basic_quote_characters â string Class Public methods Gets a list of

2015-05-05 00:53:52
emacs_editing_mode

Readline.emacs_editing_mode â nil Class Public methods Specifies Emacs editing

2015-05-05 01:58:23
completion_proc

Readline.completion_proc â proc Class Public methods Returns the completion

2015-05-05 01:50:48
refresh_line

Readline.refresh_line â nil Class Public methods Clear the current input line

2015-05-05 02:54:31
vi_editing_mode

Readline.vi_editing_mode â nil Class Public methods Specifies VI editing mode

2015-05-05 03:22:54
readline

Readline.readline(prompt = "", add_hist = false) â string or nil Class Public methods Shows

2015-05-05 02:43:16
completion_case_fold

Readline.completion_case_fold â bool Class Public methods Returns true if completion

2015-05-05 01:40:11
basic_word_break_characters=

Readline.basic_word_break_characters = string Class Public methods Sets the

2015-05-05 01:09:08