Method: CloudFlock::App::Common#retry_exit

Defined in:
lib/cloudflock/app/common/servers.rb

#retry_exit(message, prompt = 'Try again? (Y/N)') ⇒ Object

Public: Wrap retry_prompt, exiting the application if the prompt is declined.

message - String containing a failure message. prompt - Prompt to present to the user (default: ‘Try again? (Y/N)’).

Returns false, or exits.



993
994
995
996
# File 'lib/cloudflock/app/common/servers.rb', line 993

def retry_exit(message, prompt = 'Try again? (Y/N)')
  error = UI.red { "#{message}  #{prompt}" }
  exit unless UI.prompt_yn(error, default_answer: 'Y')
end