Class: Jack::Terminate
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Terminate
constructor
A new instance of Terminate.
- #run ⇒ Object
Methods included from Util
#app_name_convention, #aws_bin, #check_aws_setup, #confirm, #eb, #eb_base_flags, #eb_bin, #ensure_folder_exist, #get_answer, #get_region, #prerequisites, #settings, #sh
Constructor Details
#initialize(options = {}) ⇒ Terminate
Returns a new instance of Terminate.
5 6 7 8 9 10 |
# File 'lib/jack/terminate.rb', line 5 def initialize(={}) @options = @root = [:root] || '.' @env_name = [:env_name] @app_name = [:app] || app_name_convention(@env_name) end |
Instance Method Details
#run ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/jack/terminate.rb', line 12 def run check_aws_setup = "Are you sure you want to delete the environment #{@env_name}?".colorize(:yellow) if confirm() && !@options[:noop] eb.terminate_environment(environment_name: @env_name) UI.say("Environment #{@env_name} is terminating!") else UI.say("Whew that was close. Environment #{@env_name} was not deleted.") end end |