Class: PuppetParse::Runner

Inherits:
Object show all
Defined in:
lib/puppet-parse/runner.rb

Instance Method Summary collapse

Constructor Details

#initializeRunner

Returns a new instance of Runner.



4
5
# File 'lib/puppet-parse/runner.rb', line 4

def initialize
end

Instance Method Details

#run(files) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/puppet-parse/runner.rb', line 7

def run(files)
  output = {}
  files.each do |file|
    content          = PuppetParse::Parser.new(file)
    next if content.instance_variable_get('@object').nil? 
    parameters = (defined? content.parameters) ? content.parameters.paramflat : nil
    result           = {
      content.klass  => {
        'parameters' => parameters,
        'docs'       => content.docs
      }
    }
    output = output.merge(result)
  end
  output
end