Class: Cody::Base
Instance Method Summary collapse
-
#initialize(options) ⇒ Base
constructor
A new instance of Base.
- #run_with_exception_handling ⇒ Object
Methods included from AwsServices
Methods included from AwsServices::Helpers
#are_you_sure?, #inferred_project_name, #inferred_stack_name, #project_name_convention, #stack_exists?
Constructor Details
#initialize(options) ⇒ Base
Returns a new instance of Base.
6 7 8 9 10 |
# File 'lib/cody/base.rb', line 6 def initialize() @options = @project_name = [:project_name] || inferred_project_name @full_project_name = project_name_convention(@project_name) end |
Instance Method Details
#run_with_exception_handling ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/cody/base.rb', line 12 def run_with_exception_handling yield rescue Aws::CodeBuild::Errors::ResourceNotFoundException => e puts "ERROR: #{e.class}: #{e.}".color(:red) puts "CodeBuild project #{@full_project_name} not found." rescue Aws::CodeBuild::Errors::InvalidInputException => e puts "ERROR: #{e.class}: #{e.}".color(:red) end |