Class: ConfigBuilder::Loader::YAML_ERB

Inherits:
YAML
  • Object
show all
Defined in:
lib/config_builder/loader/yaml_erb.rb

Instance Method Summary collapse

Methods inherited from YAML

#yamldir

Instance Method Details

#yamlfile(file_path) ⇒ Hash

Load configuration from a YAML file with ERB interpolation first

determine whether to use the environment variable 'VAGRANT_MANIFEST' or the default value 'init.pp' for the puppet manifest file.


provisioner: - type: puppet manifest_file: <%= ENV['VAGRANT_MANIFEST'] || 'init.pp' >

Examples:

the following config file will be processed by ERB first so it can

Parameters:

  • file_path (String)

Returns:

  • (Hash)


19
20
21
# File 'lib/config_builder/loader/yaml_erb.rb', line 19

def yamlfile(file_path)
  ::YAML.load(::ERB.new(File.read(file_path)).result)
end