Method: Puppet::Plugins::SyntaxCheckers::SyntaxChecker#check

Defined in:
lib/puppet/plugins/syntax_checkers.rb

#check(text, syntax_identifier, acceptor, location_info) ⇒ Boolean

Checks the text for syntax issues and reports them to the given acceptor. This implementation is abstract, it raises NotImplementedError since a subclass should have implemented the method.

Parameters:

  • text (String)

    The text to check

  • syntax_identifier (String)

    The syntax identifier in mime style (e.g. ‘json’, ‘json-patch+json’, ‘xml’, ‘myapp+xml’

  • location_info (Hash)

    a customizable set of options

Options Hash (location_info):

  • :file (String)

    The filename where the string originates

  • :line (Integer)

    The line number identifying the location where the string is being used/checked

  • :position (Integer)

    The position on the line identifying the location where the string is being used/checked

Returns:

  • (Boolean)

    Whether the checked string had issues (warnings and/or errors) or not.

Raises:

  • (NotImplementedError)

Since:

  • Puppet 4.0.0



98
99
100
# File 'lib/puppet/plugins/syntax_checkers.rb', line 98

def check(text, syntax_identifier, acceptor, location_info)
  raise NotImplementedError, "The class #{self.class.name} should have implemented the method check()"
end