diff options
author | mmihira <mmihira.w@gmail.com> | 2016-07-04 21:33:03 +1000 |
---|---|---|
committer | mmihira <mmihira.w@gmail.com> | 2016-07-04 21:33:03 +1000 |
commit | 7d9c50ec81baa304a5144f19898505c7f3b9ae04 (patch) | |
tree | e07f24054be157915d06aef51f34cb04914b4985 | |
parent | b86ced682efde4029164da757d380d0f023678d8 (diff) | |
download | highline-7d9c50ec81baa304a5144f19898505c7f3b9ae04.tar.gz |
confirm in question now accepts Proc
-rwxr-xr-x | lib/highline/question.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/highline/question.rb b/lib/highline/question.rb index 3724c67..07d6954 100755 --- a/lib/highline/question.rb +++ b/lib/highline/question.rb @@ -529,6 +529,8 @@ class HighLine def confirm_question(highline) if confirm == true "Are you sure? " + elsif confirm.is_a?(Proc) + confirm.call(self.answer) else # evaluate ERb under initial scope, so it will have # access to question and answer |