Class: PuppetLint::CheckPlugin

Inherits:
Object
  • Object
show all
Includes:
Plugin
Defined in:
lib/puppet-lint/plugin.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Plugin

included

Constructor Details

#initializeCheckPlugin

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

#errorsObject (readonly)

Returns the value of attribute errors.



21
22
23
# File 'lib/puppet-lint/plugin.rb', line 21

def errors
  @errors
end

#warningsObject (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(message)
  @errors << message
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(message)
  @warnings << message
end