Class: Chemtrail::Cli
- Inherits:
-
Thor
- Object
- Thor
- Chemtrail::Cli
- Defined in:
- lib/chemtrail/cli.rb
Instance Attribute Summary collapse
-
#cloud_formation ⇒ Object
writeonly
Sets the attribute cloud_formation.
Instance Method Summary collapse
Instance Attribute Details
#cloud_formation=(value) ⇒ Object
Sets the attribute cloud_formation
7 8 9 |
# File 'lib/chemtrail/cli.rb', line 7 def cloud_formation=(value) @cloud_formation = value end |
Instance Method Details
#build(template_name) ⇒ Object
20 21 22 23 |
# File 'lib/chemtrail/cli.rb', line 20 def build(template_name) template_json = extract_template_json(template_name, [:path]) Kernel.puts(template_json) end |
#list ⇒ Object
13 14 15 16 |
# File 'lib/chemtrail/cli.rb', line 13 def list require_templates_from([:path]) Chemtrail::Template.subclass_map.keys.each { |k| Kernel.puts(k) } end |
#validate(template_name) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/chemtrail/cli.rb', line 27 def validate(template_name) template_json = extract_template_json(template_name, [:path]) cloud_formation.validate_template(template_body: template_json) Kernel.puts("Template #{template_name} is valid") rescue Aws::CloudFormation::Errors::ValidationError => e raise Thor::Error.new(e) end |