X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Floadyaml.rb;h=f84f5300d33935a06f1572118e48287a9f5c37b0;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hp=a49ae2c0cc3e3e74353312fd8e842e75204a93a6;hpb=131e09855e065be940e104d9ab0f18940cc76257;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/lib/puppet/parser/functions/loadyaml.rb b/3rdparty/modules/stdlib/lib/puppet/parser/functions/loadyaml.rb index a49ae2c0c..f84f5300d 100644 --- a/3rdparty/modules/stdlib/lib/puppet/parser/functions/loadyaml.rb +++ b/3rdparty/modules/stdlib/lib/puppet/parser/functions/loadyaml.rb @@ -3,14 +3,18 @@ # module Puppet::Parser::Functions newfunction(:loadyaml, :type => :rvalue, :arity => -2, :doc => <<-'DOC') do |args| - Load a YAML file containing an array, string, or hash, and return the data - in the corresponding native data type. + @summary + Load a YAML file containing an array, string, or hash, and return the data + in the corresponding native data type. + The first parameter can be a file path or a URL. The second parameter is the default value. It will be returned if the file was not found or could not be parsed. - For example: + @return [Array|String|Hash] + The data stored in the YAML file, the type depending on the type of data that was stored. + @example Example Usage: $myhash = loadyaml('/etc/puppet/data/myhash.yaml') $myhash = loadyaml('https://example.local/my_hash.yaml') $myhash = loadyaml('https://username:password@example.local/my_hash.yaml')