Top Level Namespace
Defined Under Namespace
Modules: Kernel, Subversion Classes: Array, IO, Object, String
Instance Method Summary collapse
Instance Method Details
#confirm(question, options = ['Yes', 'No']) ⇒ Object
125 126 127 128 129 130 131 132 133 134 |
# File 'lib/svn-command/svn_command.rb', line 125 def confirm(question, = ['Yes', 'No']) print question + " " + "Yes".(:red) + ", " + "No".(:green) + " > " response = '' # Currently allow user to press Enter to accept the default. response = $stdin.getch.downcase while !['y', 'n', "\n"].include?(begin response.downcase!; response end) response end |