Class: AwsCftTools::Runbooks::Diff::Context
- Inherits:
-
Object
- Object
- AwsCftTools::Runbooks::Diff::Context
- Includes:
- Common::Templates, Reporting
- Defined in:
- lib/aws_cft_tools/runbooks/diff/context.rb,
lib/aws_cft_tools/runbooks/diff/context/reporting.rb
Overview
The context of stacks and templates for a Diff report.
Defined Under Namespace
Modules: Reporting
Constant Summary collapse
- DIFF_OPTIONS =
The options provided to the
diff
command to build template diffs. %w[-w -U5 -t].freeze
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#stacks ⇒ Object
readonly
Returns the value of attribute stacks.
-
#templates ⇒ Object
readonly
Returns the value of attribute templates.
Instance Method Summary collapse
-
#initialize(stacks, templates, options = {}) ⇒ Context
constructor
A new instance of Context.
-
#report_on_differences ⇒ Object
Reports on the differences in the template bodies between the set of templates and the deployed stacks.
-
#report_on_missing_stacks ⇒ Object
Reports out templates that do not have corresponding stacks.
-
#report_on_missing_templates ⇒ Object
Reports out stacks that do not have corresponding templates.
Methods included from Reporting
#output_report_on_differences, #output_report_on_missing_stacks, #output_report_on_missing_templates
Constructor Details
#initialize(stacks, templates, options = {}) ⇒ Context
Returns a new instance of Context.
29 30 31 32 33 |
# File 'lib/aws_cft_tools/runbooks/diff/context.rb', line 29 def initialize(stacks, templates, = {}) @stacks = build_map(stacks) @templates = build_map(templates) @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
12 13 14 |
# File 'lib/aws_cft_tools/runbooks/diff/context.rb', line 12 def @options end |
#stacks ⇒ Object (readonly)
Returns the value of attribute stacks.
12 13 14 |
# File 'lib/aws_cft_tools/runbooks/diff/context.rb', line 12 def stacks @stacks end |
#templates ⇒ Object (readonly)
Returns the value of attribute templates.
12 13 14 |
# File 'lib/aws_cft_tools/runbooks/diff/context.rb', line 12 def templates @templates end |
Instance Method Details
#report_on_differences ⇒ Object
Reports on the differences in the template bodies between the set of templates and the deployed stacks.
53 54 55 56 |
# File 'lib/aws_cft_tools/runbooks/diff/context.rb', line 53 def report_on_differences # these are stacks with templates output_report_on_differences(build_diffs) end |
#report_on_missing_stacks ⇒ Object
Reports out templates that do not have corresponding stacks.
45 46 47 |
# File 'lib/aws_cft_tools/runbooks/diff/context.rb', line 45 def report_on_missing_stacks output_report_on_missing_stacks(templates.keys - stacks.keys) end |
#report_on_missing_templates ⇒ Object
Reports out stacks that do not have corresponding templates.
38 39 40 |
# File 'lib/aws_cft_tools/runbooks/diff/context.rb', line 38 def report_on_missing_templates output_report_on_missing_templates(stacks.keys - templates.keys) end |