Spec-Zone.ru › Ruby 3.3

модуль Readline

Константы

CursorPos
DEFAULT_DIALOG_CONTEXT
DEFAULT_DIALOG_PROC_AUTOCOMPLETE
DialogRenderInfo
FILENAME_COMPLETION_PROC

ПРИМЕЧАНИЕ: Для совместимости с драгоценным камнем rb-readline

HISTORY
IOGate
Key
USERNAME_COMPLETION_PROC
VERSION

Общедоступные методы класса

core() Показать исходный код
# File lib/reline.rb, line 550
def self.core
  @core ||= Core.new { |core|
    core.config = Reline::Config.new
    core.key_stroke = Reline::KeyStroke.new(core.config)
    core.line_editor = Reline::LineEditor.new(core.config, core.encoding)

    core.basic_word_break_characters = " \t\n`><=;|&{("
    core.completer_word_break_characters = " \t\n`><=;|&{("
    core.basic_quote_characters = '"\''
    core.completer_quote_characters = '"\''
    core.filename_quote_characters = ""
    core.special_prefixes = ""
    core.add_dialog_proc(:autocomplete, Reline::DEFAULT_DIALOG_PROC_AUTOCOMPLETE, Reline::DEFAULT_DIALOG_CONTEXT)
  }
end
encoding_system_needs() Показать исходный код
# File lib/reline.rb, line 546
def self.encoding_system_needs
  self.core.encoding
end
insert_text(*args, &block) Показать исходный код
# File lib/reline.rb, line 527
def self.insert_text(*args, &block)
  line_editor.insert_text(*args, &block)
  self
end
line_editor() Показать исходный код
# File lib/reline.rb, line 570
def self.line_editor
  core.line_editor
end
ungetc(c) Показать исходный код
# File lib/reline.rb, line 566
def self.ungetc(c)
  core.io_gate.ungetc(c)
end
update_iogate() Показать исходный код
# File lib/reline.rb, line 574
def self.update_iogate
  return if core.config.test_mode

  # Need to change IOGate when `$stdout.tty?` change from false to true by `$stdout.reopen`
  # Example: rails/spring boot the application in non-tty, then run console in tty.
  if ENV['TERM'] != 'dumb' && core.io_gate == Reline::GeneralIO && $stdout.tty?
    require 'reline/ansi'
    remove_const(:IOGate)
    const_set(:IOGate, Reline::ANSI)
  end
end

Ruby Core © 1993–2022 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API