projects
/
puppet_common.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
90a172d
)
add a join function
author
mh
<mh@immerda.ch>
Wed, 20 Oct 2010 22:10:28 +0000
(
00:10
+0200)
committer
Micah Anderson
<micah@riseup.net>
Sun, 7 Nov 2010 18:37:21 +0000
(13:37 -0500)
lib/puppet/parser/functions/join.rb
[new file with mode: 0644]
patch
|
blob
diff --git a/lib/puppet/parser/functions/join.rb
b/lib/puppet/parser/functions/join.rb
new file mode 100644
(file)
index 0000000..
95b664c
--- /dev/null
+++ b/
lib/puppet/parser/functions/join.rb
@@ -0,0
+1,10
@@
+Puppet::Parser::Functions::newfunction(
+ :join,
+ :type => :rvalue,
+ :doc => "Joins the values of the array in arg1 with the string in arg2
+
+ Example: join(['a','b'],',') -> 'a,b'"
+) do |args|
+ raise Puppet::ParseError, 'join() needs two arguments' if args.length != 2
+ args[0].to_a.join(args[1])
+end