@@ -22,7 +22,7 @@ class Context
22
22
#
23
23
# The optional +input_method+ argument:
24
24
#
25
- # +nil+:: uses stdin or Reidline or Readline
25
+ # +nil+:: uses stdin or Reline or Readline
26
26
# +String+:: uses a File
27
27
# +other+:: uses this as InputMethod
28
28
def initialize ( irb , workspace = nil , input_method = nil )
@@ -48,8 +48,13 @@ def initialize(irb, workspace = nil, input_method = nil)
48
48
end
49
49
if IRB . conf . has_key? ( :USE_MULTILINE )
50
50
@use_multiline = IRB . conf [ :USE_MULTILINE ]
51
- elsif IRB . conf . has_key? ( :USE_REIDLINE ) # backward compatibility
52
- @use_multiline = IRB . conf [ :USE_REIDLINE ]
51
+ elsif IRB . conf . has_key? ( :USE_RELINE ) # backward compatibility
52
+ @use_multiline = IRB . conf [ :USE_RELINE ]
53
+ elsif IRB . conf . has_key? ( :USE_REIDLINE )
54
+ warn <<~MSG . strip
55
+ USE_REIDLINE is deprecated, please use USE_RELINE instead.
56
+ MSG
57
+ @use_multiline = IRB . conf [ :USE_RELINE ]
53
58
else
54
59
@use_multiline = nil
55
60
end
@@ -83,14 +88,14 @@ def initialize(irb, workspace = nil, input_method = nil)
83
88
when nil
84
89
if STDIN . tty? && IRB . conf [ :PROMPT_MODE ] != :INF_RUBY && !use_singleline?
85
90
# Both of multiline mode and singleline mode aren't specified.
86
- @io = ReidlineInputMethod . new
91
+ @io = RelineInputMethod . new
87
92
else
88
93
@io = nil
89
94
end
90
95
when false
91
96
@io = nil
92
97
when true
93
- @io = ReidlineInputMethod . new
98
+ @io = RelineInputMethod . new
94
99
end
95
100
unless @io
96
101
case use_singleline?
@@ -160,7 +165,7 @@ def main
160
165
# The current input method.
161
166
#
162
167
# Can be either StdioInputMethod, ReadlineInputMethod,
163
- # ReidlineInputMethod , FileInputMethod or other specified when the
168
+ # RelineInputMethod , FileInputMethod or other specified when the
164
169
# context is created. See ::new for more # information on +input_method+.
165
170
attr_accessor :io
166
171
@@ -326,9 +331,9 @@ def main
326
331
# Alias for #use_singleline
327
332
alias use_singleline? use_singleline
328
333
# backward compatibility
329
- alias use_reidline use_multiline
334
+ alias use_reline use_multiline
330
335
# backward compatibility
331
- alias use_reidline ? use_multiline
336
+ alias use_reline ? use_multiline
332
337
# backward compatibility
333
338
alias use_readline use_singleline
334
339
# backward compatibility
@@ -346,7 +351,7 @@ def main
346
351
# Returns whether messages are displayed or not.
347
352
def verbose?
348
353
if @verbose . nil?
349
- if @io . kind_of? ( ReidlineInputMethod )
354
+ if @io . kind_of? ( RelineInputMethod )
350
355
false
351
356
elsif defined? ( ReadlineInputMethod ) && @io . kind_of? ( ReadlineInputMethod )
352
357
false
@@ -361,11 +366,11 @@ def verbose?
361
366
end
362
367
363
368
# Whether #verbose? is +true+, and +input_method+ is either
364
- # StdioInputMethod or ReidlineInputMethod or ReadlineInputMethod, see #io
369
+ # StdioInputMethod or RelineInputMethod or ReadlineInputMethod, see #io
365
370
# for more information.
366
371
def prompting?
367
372
verbose? || ( STDIN . tty? && @io . kind_of? ( StdioInputMethod ) ||
368
- @io . kind_of? ( ReidlineInputMethod ) ||
373
+ @io . kind_of? ( RelineInputMethod ) ||
369
374
( defined? ( ReadlineInputMethod ) && @io . kind_of? ( ReadlineInputMethod ) ) )
370
375
end
371
376
0 commit comments