Class: StackMaster::Commands::Apply

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

Instance Method Summary collapse

Methods included from Prompter

#ask?

Methods included from StackMaster::Command

included

Constructor Details

#initialize(config, stack_definition, options = {}) ⇒ Apply

Returns a new instance of Apply.



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

def initialize(config, stack_definition, options = {})
  @config = config
  @stack_definition = stack_definition
  @from_time = Time.now
  @updating = false
end

Instance Method Details

#performObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/stack_master/commands/apply.rb', line 15

def perform
  diff_stacks
  unless ask?("Continue and apply the stack (y/n)? ")
    StackMaster.stdout.puts "Stack update aborted"
    return
  end
  begin
    return if stack_too_big
    create_or_update_stack
    tail_stack_events
  rescue StackMaster::CtrlC
    cancel
  end
end