In Files

  • bundler/vendor/thor/lib/thor/line_editor/readline.rb

Class/Module Index [+]

Quicksearch

Bundler::Thor::LineEditor::Readline

Public Class Methods

available?() click to toggle source
 
               # File bundler/vendor/thor/lib/thor/line_editor/readline.rb, line 4
def self.available?
  begin
    require "readline"
  rescue LoadError
  end

  Object.const_defined?(:Readline)
end
            

Public Instance Methods

readline() click to toggle source
 
               # File bundler/vendor/thor/lib/thor/line_editor/readline.rb, line 13
def readline
  if echo?
    ::Readline.completion_append_character = nil
    # rb-readline does not allow Readline.completion_proc= to receive nil.
    if complete = completion_proc
      ::Readline.completion_proc = complete
    end
    ::Readline.readline(prompt, add_to_history?)
  else
    super
  end
end