Class: PuppetAuditor::LintPlugin
- Inherits:
-
PuppetLint::CheckPlugin
- Object
- PuppetLint::CheckPlugin
- PuppetAuditor::LintPlugin
- Defined in:
- lib/puppet_auditor/lint_plugin.rb
Constant Summary collapse
- COMPARISONS =
{ 'matches' => ->(expected, token) { token =~ expected }, 'not_matches' => ->(expected, token) { (token =~ expected).nil? }, 'equals' => ->(expected, token) { token == expected }, 'not_equal' => ->(expected, token) { token != expected }, 'less_than' => ->(expected, token) { token < expected }, 'less_or_equal_to' => ->(expected, token) { token <= expected }, 'greater_than' => ->(expected, token) { token > expected }, 'greater_or_equal_to' => ->(expected, token) { token >= expected }, }
Instance Method Summary collapse
- #check ⇒ Object
-
#initialize ⇒ LintPlugin
constructor
A new instance of LintPlugin.
Constructor Details
#initialize ⇒ LintPlugin
Returns a new instance of LintPlugin.
17 18 19 20 21 22 23 24 |
# File 'lib/puppet_auditor/lint_plugin.rb', line 17 def initialize super @resource = self.class::RESOURCE @attributes = self.class::ATTRIBUTES @message = self.class::MESSAGE @scoped_variables = { 'global' => {} } @scopes = {} end |
Instance Method Details
#check ⇒ Object
26 27 28 29 30 31 |
# File 'lib/puppet_auditor/lint_plugin.rb', line 26 def check discover_scopes build_scope scan_variables resource_indexes.each { |resource| resource_block(resource) if resource[:type].value == @resource } end |