Module: CFManifests::Builder

Included in:
Loader
Defined in:
lib/manifests/loader/builder.rb

Instance Method Summary collapse

Instance Method Details

#build(file) ⇒ Object

parse a manifest and merge with its inherited manifests


6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/manifests/loader/builder.rb', line 6

def build(file)
  manifest = YAML.load_file file
  raise CFManifests::InvalidManifest.new(file) unless manifest

  Array(manifest["inherit"]).each do |path|
    manifest = merge_parent(path, manifest)
  end

  manifest.delete("inherit")

  manifest
end