summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/puppet/parser/functions/getvar.rb4
-rw-r--r--lib/puppet/parser/functions/has_key.rb17
-rw-r--r--lib/puppet/parser/functions/loadyaml.rb2
3 files changed, 12 insertions, 11 deletions
diff --git a/lib/puppet/parser/functions/getvar.rb b/lib/puppet/parser/functions/getvar.rb
index ffd774d..3ca179f 100644
--- a/lib/puppet/parser/functions/getvar.rb
+++ b/lib/puppet/parser/functions/getvar.rb
@@ -5,11 +5,11 @@ module Puppet::Parser::Functions
For example:
- $foo = getvar('site::data::foo')
+ $foo = getvar('site::data::foo')
This is useful if the namespace itself is stored in a string:
- $bar = getvar("${datalocation}::bar")
+ $bar = getvar("${datalocation}::bar")
ENDHEREDOC
unless args.length == 1
diff --git a/lib/puppet/parser/functions/has_key.rb b/lib/puppet/parser/functions/has_key.rb
index 9c1c4c3..4657cc2 100644
--- a/lib/puppet/parser/functions/has_key.rb
+++ b/lib/puppet/parser/functions/has_key.rb
@@ -1,16 +1,17 @@
module Puppet::Parser::Functions
newfunction(:has_key, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args|
- determine if a hash has a certain key value.
+ Determine if a hash has a certain key value.
Example:
- $my_hash = {'key_one' => 'value_one'}
- if has_key($my_hash, 'key_two') {
- notice('we will not reach here')
- }
- if has_key($my_hash, 'key_one') {
- notice('this will be printed')
- }
+
+ $my_hash = {'key_one' => 'value_one'}
+ if has_key($my_hash, 'key_two') {
+ notice('we will not reach here')
+ }
+ if has_key($my_hash, 'key_one') {
+ notice('this will be printed')
+ }
ENDHEREDOC
diff --git a/lib/puppet/parser/functions/loadyaml.rb b/lib/puppet/parser/functions/loadyaml.rb
index 0f16f69..4ccc95b 100644
--- a/lib/puppet/parser/functions/loadyaml.rb
+++ b/lib/puppet/parser/functions/loadyaml.rb
@@ -6,7 +6,7 @@ module Puppet::Parser::Functions
For example:
- $myhash = loadyaml('/etc/puppet/data/myhash.yaml')
+ $myhash = loadyaml('/etc/puppet/data/myhash.yaml')
ENDHEREDOC
unless args.length == 1