Class: PuppetLint::Checks

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet-lint/plugins/check_ghostbuster_hiera_files.rb,
lib/puppet-lint/plugins/check_ghostbuster_templates.rb,
lib/puppet-lint/plugins/check_ghostbuster_functions.rb,
lib/puppet-lint/plugins/check_ghostbuster_defines.rb,
lib/puppet-lint/plugins/check_ghostbuster_classes.rb,
lib/puppet-lint/plugins/check_ghostbuster_types.rb,
lib/puppet-lint/plugins/check_ghostbuster_files.rb,
lib/puppet-lint/plugins/check_ghostbuster_facts.rb

Instance Method Summary collapse

Instance Method Details

#load_data(path, content) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
# File 'lib/puppet-lint/plugins/check_ghostbuster_hiera_files.rb', line 2

def load_data(path, content)
  lexer = PuppetLint::Lexer.new
  PuppetLint::Data.path = path
  begin
    PuppetLint::Data.manifest_lines = content.split("\n", -1)
    PuppetLint::Data.tokens = lexer.tokenise(content)
    PuppetLint::Data.parse_control_comments
  rescue StandardError
    PuppetLint::Data.tokens = []
  end
end