Class: Moonshot::Plugins::DynamicTemplate

Inherits:
Object
  • Object
show all
Defined in:
lib/plugins/dynamic_template.rb

Instance Method Summary collapse

Constructor Details

#initialize(source:, parameters:, destination:) ⇒ DynamicTemplate

Returns a new instance of DynamicTemplate.



6
7
8
9
10
11
12
# File 'lib/plugins/dynamic_template.rb', line 6

def initialize(source:, parameters:, destination:)
  @dynamic_template = ::Moonshot::DynamicTemplate.new(
    source:,
    parameters:,
    destination:
  )
end

Instance Method Details

#cli_hook(parser) ⇒ Object Also known as: create_cli_hook, delete_cli_hook, update_cli_hook



18
19
20
21
22
23
# File 'lib/plugins/dynamic_template.rb', line 18

def cli_hook(parser)
  parser.on('--template-file=FILE', 'Override the path to the CloudFormation template.') do |v|
    @dynamic_template.destination = v
    Moonshot.config.template_file = v
  end
end

#run_hookObject Also known as: setup_create, setup_update, setup_delete



14
15
16
# File 'lib/plugins/dynamic_template.rb', line 14

def run_hook
  @dynamic_template.process
end