Sha256: b1b48e391978c36a30d52ca5663201ff5dbe9173ac6cf6eeb066db2e1072c503

Contents?: true

Size: 1.23 KB

Versions: 5

Compression:

Stored size: 1.23 KB

Contents

class PuppetDocLint
  class DocRunner
    def initialize  
    end
  
    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
    
    
  end #class Runner
end #module PuppetDocLint

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
puppet-doc-lint-0.3.0 lib/puppet-doc-lint/doc_runner.rb
puppet-doc-lint-0.2.0 lib/puppet-doc-lint/doc_runner.rb
puppet-doc-lint-0.1.1 lib/puppet-doc-lint/doc_runner.rb
puppet-doc-lint-0.1.0 lib/puppet-doc-lint/doc_runner.rb
puppet-doc-lint-0.0.1 lib/puppet-doc-lint/doc_runner.rb