From 1b2babce21c1dc16331c890c8a6c6e2550d0759b Mon Sep 17 00:00:00 2001 From: "Abinoam P. Marques Jr" Date: Sun, 2 Jul 2017 01:24:27 -0300 Subject: Use loop do over begin/end/while --- lib/highline/question_asker.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/highline/question_asker.rb b/lib/highline/question_asker.rb index 0d124b1..4c1ff5b 100644 --- a/lib/highline/question_asker.rb +++ b/lib/highline/question_asker.rb @@ -66,10 +66,10 @@ class HighLine def gather_answers original_question_template = question.template verify_match = question.verify_match + answers = [] - begin # when verify_match is set this loop will repeat until unique_answers == 1 + loop do # when verify_match is set this loop will repeat until unique_answers == 1 question.template = original_question_template - answers = gather_answers_based_on_type if verify_match && (@highline.send(:unique_answers, answers).size > 1) @@ -77,7 +77,8 @@ class HighLine else verify_match = false end - end while verify_match + break unless verify_match + end question.verify_match ? @highline.send(:last_answer, answers) : answers end -- cgit v1.2.1