Class: CfParameters::CFParameterGenerator

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

Instance Method Summary collapse

Instance Method Details

#get_cf_parameters(yamlInput) ⇒ Object



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

def get_cf_parameters(yamlInput)
  yaml_parameters = YAML.load_file(yamlInput)
  cf_parameters = []

  yaml_parameters.each do |key, value|
      value ||= ""
      realValue = if !value.start_with?("$") then value else ENV[value[1..-1]] end || ""
      cf_parameters << {"ParameterKey" => key, "ParameterValue" => realValue}
  end
  JSON.pretty_generate(cf_parameters)
end