Skip to content

Instantly share code, notes, and snippets.

@mathiasrw
Created August 18, 2016 06:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mathiasrw/3faf37356b5141415973dbe2e58ee15f to your computer and use it in GitHub Desktop.
Save mathiasrw/3faf37356b5141415973dbe2e58ee15f to your computer and use it in GitHub Desktop.
require 'HighLine/import'
def ok(prompt = '[y/N]')
confirm = ask(prompt) { |yn| yn.limit = 1}
return true if confirm.downcase == 'y'
return false if confirm.downcase == 'n' || confirm.downcase == ''
return ok
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment