mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/rdoc] Delay require "readline"
in case the terminal is in raw mode
This commit is contained in:
parent
739ad81ff1
commit
5129ca3e05
1 changed files with 4 additions and 5 deletions
|
@ -1,11 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
require 'optparse'
|
||||
|
||||
begin
|
||||
require 'readline'
|
||||
rescue LoadError
|
||||
end
|
||||
|
||||
require_relative '../../rdoc'
|
||||
|
||||
require_relative 'formatter' # For RubyGems backwards compatibility
|
||||
|
@ -1079,6 +1074,10 @@ or the PAGER environment variable.
|
|||
def interactive
|
||||
puts "\nEnter the method name you want to look up."
|
||||
|
||||
begin
|
||||
require 'readline'
|
||||
rescue LoadError
|
||||
end
|
||||
if defined? Readline then
|
||||
Readline.completion_proc = method :complete
|
||||
puts "You can use tab to autocomplete."
|
||||
|
|
Loading…
Reference in a new issue