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.

1
2
3
4
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.

1
2
3
4
5
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>.

input=
  • References/Ruby on Rails/Ruby/Classes/Readline

Readline.input = input Class Public methods Specifies a

2025-01-10 15:47:30
pre_input_hook
  • References/Ruby on Rails/Ruby/Classes/Readline

Readline.pre_input_hook â proc Class Public methods Returns a

2025-01-10 15:47:30
completer_word_break_characters=
  • References/Ruby on Rails/Ruby/Classes/Readline

Readline.completer_word_break_characters = string Class Public methods Sets

2025-01-10 15:47:30
filename_quote_characters=
  • References/Ruby on Rails/Ruby/Classes/Readline

Readline.filename_quote_characters = string Class Public methods Sets a list

2025-01-10 15:47:30
vi_editing_mode?
  • References/Ruby on Rails/Ruby/Classes/Readline

Readline.vi_editing_mode? â bool Class Public methods Returns true if vi mode

2025-01-10 15:47:30
emacs_editing_mode?
  • References/Ruby on Rails/Ruby/Classes/Readline

Readline.emacs_editing_mode? â bool Class Public methods Returns true if emacs

2025-01-10 15:47:30
completion_case_fold=
  • References/Ruby on Rails/Ruby/Classes/Readline

Readline.completion_case_fold = bool Class Public methods Sets whether or not

2025-01-10 15:47:30
line_buffer
  • References/Ruby on Rails/Ruby/Classes/Readline

Readline.line_buffer â string Class Public methods Returns the full line that

2025-01-10 15:47:30
special_prefixes
  • References/Ruby on Rails/Ruby/Classes/Readline

Readline.special_prefixes â string Class Public methods Gets the list of characters

2025-01-10 15:47:30
completer_word_break_characters
  • References/Ruby on Rails/Ruby/Classes/Readline

Readline.completer_word_break_characters â string Class Public methods Gets

2025-01-10 15:47:30