mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Check block in #readmultiline
This commit is contained in:
parent
b215054800
commit
4b012c23b2
1 changed files with 3 additions and 0 deletions
|
@ -246,6 +246,9 @@ module Reline
|
||||||
end
|
end
|
||||||
|
|
||||||
def readmultiline(prompt = '', add_hist = false, &confirm_multiline_termination)
|
def readmultiline(prompt = '', add_hist = false, &confirm_multiline_termination)
|
||||||
|
unless confirm_multiline_termination
|
||||||
|
raise ArgumentError.new('#readmultiline needs block to confirm multiline termination')
|
||||||
|
end
|
||||||
if block_given?
|
if block_given?
|
||||||
inner_readline(prompt, add_hist, true, &confirm_multiline_termination)
|
inner_readline(prompt, add_hist, true, &confirm_multiline_termination)
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Reference in a new issue