Top Level Namespace
Defined Under Namespace
Modules: Subversion Classes: Array, String
Instance Method Summary collapse
Instance Method Details
#confirm(question, options = ['Yes', 'No']) ⇒ Object
70 71 72 73 74 75 76 77 78 79 |
# File 'lib/svn-command/svn_command.rb', line 70 def confirm(question, = ['Yes', 'No']) print question + " " + "Yes".(:red) + ", " + "No".(:green) + " > " response = '' # Currently allow user to press Enter to accept the default. response = $stdin.getc.chr.downcase while !['y', 'n', "\n"].include?(begin response.downcase!; response end) response end |