Class: PuppetfileFixturesGenerator::Puppetfile

Inherits:
Object
  • Object
show all
Defined in:
lib/puppetfile_fixtures_generator/puppetfile.rb

Overview

Manipulate Puppetfiles so they can be converted to fixtures or diffed

Since:

  • 0.1.0

Instance Method Summary collapse

Constructor Details

#initialize(puppetfile_path) ⇒ Puppetfile

Constructor

Since:

  • 0.1.0



10
11
12
# File 'lib/puppetfile_fixtures_generator/puppetfile.rb', line 10

def initialize(puppetfile_path)
  @pf_path = puppetfile_path
end

Instance Method Details

#modules_hashHash

Returns Modules from the Puppetfile.

Since:

  • 0.1.0



15
16
17
18
19
20
21
22
# File 'lib/puppetfile_fixtures_generator/puppetfile.rb', line 15

def modules_hash
  @modules_hash ||=
    begin
      hash = {}
      puppetfile.modules.each { |mod| module_builder(mod, hash) }
      hash
    end
end