Class: PuppetLint::CheckPlugin
- Inherits:
-
Object
- Object
- PuppetLint::CheckPlugin
- Includes:
- Plugin
- Defined in:
- lib/puppet-lint/plugin.rb
Direct Known Subclasses
Plugins::CheckResources, Plugins::CheckStrings, Plugins::CheckWhitespace
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#warnings ⇒ Object
readonly
Returns the value of attribute warnings.
Instance Method Summary collapse
- #error(message) ⇒ Object
-
#initialize ⇒ CheckPlugin
constructor
A new instance of CheckPlugin.
- #run(data) ⇒ Object
- #test(data) ⇒ Object
- #warn(message) ⇒ Object
Methods included from Plugin
Constructor Details
#initialize ⇒ CheckPlugin
Returns a new instance of CheckPlugin.
23 24 25 26 |
# File 'lib/puppet-lint/plugin.rb', line 23 def initialize @warnings = [] @errors = [] end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
21 22 23 |
# File 'lib/puppet-lint/plugin.rb', line 21 def errors @errors end |
#warnings ⇒ Object (readonly)
Returns the value of attribute warnings.
21 22 23 |
# File 'lib/puppet-lint/plugin.rb', line 21 def warnings @warnings end |
Instance Method Details
#error(message) ⇒ Object
32 33 34 |
# File 'lib/puppet-lint/plugin.rb', line 32 def error() @errors << end |
#run(data) ⇒ Object
36 37 38 39 40 |
# File 'lib/puppet-lint/plugin.rb', line 36 def run(data) test(data) {:warnings => @warnings, :errors => @errors} end |
#test(data) ⇒ Object
42 43 44 |
# File 'lib/puppet-lint/plugin.rb', line 42 def test(data) raise NotImplementedError.new "Oh no" end |
#warn(message) ⇒ Object
28 29 30 |
# File 'lib/puppet-lint/plugin.rb', line 28 def warn() @warnings << end |