Class: PuppetDocLint::DocRunner
- Inherits:
-
Object
- Object
- PuppetDocLint::DocRunner
- Defined in:
- lib/puppet-doc-lint/doc_runner.rb
Instance Method Summary collapse
-
#initialize ⇒ DocRunner
constructor
A new instance of DocRunner.
- #run(files) ⇒ Object
Constructor Details
#initialize ⇒ DocRunner
Returns a new instance of DocRunner.
3 4 |
# File 'lib/puppet-doc-lint/doc_runner.rb', line 3 def initialize end |
Instance Method Details
#run(files) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/puppet-doc-lint/doc_runner.rb', line 6 def run(files) runner_results = [] files.each do |file| puppet_file_result = Result.new Puppet.initialize_settings unless Puppet.settings.app_defaults_initialized? content = PuppetDocLint::Parser.new(file) next if content.instance_variable_get('@object').nil? parameters = (defined? content.parameters) ? content.parameters.paramflat : nil puppet_file_result.class_name = content.klass puppet_file_result.no_documentation = true if content.docs == {} result = { content.klass => { 'parameters' => parameters, 'docs' => content.docs } } puppet_file_result.parameters = parameters.keys undocumented = parameters.keys - content.docs.keys puppet_file_result.undocumented_parameters = undocumented unless undocumented.empty? documented = parameters.keys - undocumented puppet_file_result.documented_parameters = documented unless undocumented.empty? runner_results << puppet_file_result end runner_results end |