Class: StackMaster::Commands::Delete

Inherits:
Object
  • Object
show all
Includes:
StackMaster::Command, Prompter
Defined in:
lib/stack_master/commands/delete.rb

Instance Method Summary collapse

Methods included from Prompter

#ask?

Methods included from StackMaster::Command

included, #success?

Constructor Details

#initialize(region, stack_name, options) ⇒ Delete

Returns a new instance of Delete.



7
8
9
10
11
12
# File 'lib/stack_master/commands/delete.rb', line 7

def initialize(region, stack_name, options)
  super(nil, nil, options)
  @region = region
  @stack_name = stack_name
  @from_time = Time.now
end

Instance Method Details

#performObject



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/stack_master/commands/delete.rb', line 14

def perform

  return unless check_exists

  unless ask?("Really delete stack #{@stack_name} (y/n)? ")
    StackMaster.stdout.puts "Stack update aborted"
    return
  end

  delete_stack
  tail_stack_events unless StackMaster.quiet?
end