Class: StackMaster::Commands::Lint
- Inherits:
-
Object
- Object
- StackMaster::Commands::Lint
- Includes:
- Commander::UI, StackMaster::Command
- Defined in:
- lib/stack_master/commands/lint.rb
Instance Method Summary collapse
-
#initialize(config, stack_definition, options = {}) ⇒ Lint
constructor
A new instance of Lint.
- #perform ⇒ Object
Methods included from StackMaster::Command
Constructor Details
#initialize(config, stack_definition, options = {}) ⇒ Lint
Returns a new instance of Lint.
9 10 11 12 |
# File 'lib/stack_master/commands/lint.rb', line 9 def initialize(config, stack_definition, = {}) @config = config @stack_definition = stack_definition end |
Instance Method Details
#perform ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/stack_master/commands/lint.rb', line 14 def perform unless cfn_lint_available failed! 'Failed to run cfn-lint. You may need to install it using'\ '`pip install cfn-lint`, or add it to $PATH.'\ "\n"\ '(See https://github.com/aws-cloudformation/cfn-python-lint'\ ' for package information)' end Tempfile.open(['stack', ".#{proposed_stack.template_format}"]) do |f| f.write(proposed_stack.template_body) f.flush system('cfn-lint', f.path) puts "cfn-lint run complete" end end |