summaryrefslogtreecommitdiff
path: root/README.markdown
diff options
context:
space:
mode:
Diffstat (limited to 'README.markdown')
-rw-r--r--README.markdown32
1 files changed, 31 insertions, 1 deletions
diff --git a/README.markdown b/README.markdown
index 6cedc2a..eff3b28 100644
--- a/README.markdown
+++ b/README.markdown
@@ -660,12 +660,42 @@ Returns the keys of a hash as an array. *Type*: rvalue.
#### `loadyaml`
-Loads a YAML file containing an array, string, or hash, and returns the data in the corresponding native data type. For example:
+Loads a YAML file containing an array, string, or hash, and returns the data in the corresponding native data type.
+
+For example:
~~~
$myhash = loadyaml('/etc/puppet/data/myhash.yaml')
~~~
+The second parameter will be returned if the file was not found or could not be parsed.
+
+For example:
+
+ ~~~
+ $myhash = loadyaml('no-file.yaml', {'default'=>'value'})
+ ~~~
+
+*Type*: rvalue.
+
+#### `loadjson`
+
+Loads a JSON file containing an array, string, or hash, and returns the data in the corresponding native data type.
+
+For example:
+
+ ~~~
+ $myhash = loadjson('/etc/puppet/data/myhash.json')
+ ~~~
+
+The second parameter will be returned if the file was not found or could not be parsed.
+
+For example:
+
+ ~~~
+ $myhash = loadjson('no-file.json', {'default'=>'value'})
+ ~~~
+
*Type*: rvalue.
#### `load_module_metadata`