aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules/mga-common/lib/puppet/parser/functions/str_join.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/mga-common/lib/puppet/parser/functions/str_join.rb b/modules/mga-common/lib/puppet/parser/functions/str_join.rb
new file mode 100644
index 00000000..de97bfb5
--- /dev/null
+++ b/modules/mga-common/lib/puppet/parser/functions/str_join.rb
@@ -0,0 +1,11 @@
+# str_join($array, $sep)
+# -> return a string created by converting each element of the array to
+# a string, separated by $sep
+
+module Puppet::Parser::Functions
+ newfunction(:str_join, :type => :rvalue) do |args|
+ array = args[0]
+ sep = args[1]
+ return array.join(sep)
+ end
+end