Module: Jets::Command::ApiHelpers
- Extended by:
- ActiveSupport::Concern
- Includes:
- Api
- Included in:
- Jets::Cfn::Deployment, Base, Release, Rollback
- Defined in:
- lib/jets/command/api_helpers.rb
Overview
:nodoc:
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
Instance Method Details
#check_for_error_message!(resp) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/jets/command/api_helpers.rb', line 15 def (resp) # IE: {"error":"Invalid token. Please check your token in ~/.jets/config.yml"} if resp && resp["error"] $stderr.puts "ERROR: #{resp["error"]}" exit 1 end resp end |
#no_token_exit! ⇒ Object
8 9 10 11 12 13 |
# File 'lib/jets/command/api_helpers.rb', line 8 def no_token_exit! return if Jets::Api.token puts "ERROR: This command requires Jets Api".color(:red) puts "Please run `jets configure` first" exit 1 end |