diff options
author | Krzysztof Wilczynski <krzysztof.wilczynski@linux.com> | 2011-04-23 16:43:11 +0100 |
---|---|---|
committer | Krzysztof Wilczynski <krzysztof.wilczynski@linux.com> | 2011-04-23 16:43:11 +0100 |
commit | 92d4a4eb85d72253ee6310b44dd37aa71478ce11 (patch) | |
tree | 482cc045d9c64c6e5e60af5865c01519adcd6fea | |
parent | 4a57da669c19a972968b8a88e09058844a52ba64 (diff) | |
download | puppet-stdlib-92d4a4eb85d72253ee6310b44dd37aa71478ce11.tar.gz puppet-stdlib-92d4a4eb85d72253ee6310b44dd37aa71478ce11.tar.bz2 |
First version. Adding join to Puppet for use within the manifest files.
Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
-rw-r--r-- | join.rb | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -0,0 +1,25 @@ +# +# join.rb +# + +module Puppet::Parser::Functions + newfunction(:join, :type => :rvalue, :doc => <<-EOS + EOS + ) do |arguments| + + array = arguments[0] + + suffix = arguments[1] + prefix = arguments[2] + + if prefix and not prefix.empty? + result = prefix + array.join(suffix + prefix) + else + result = array.join(suffix) + end + + return result + end +end + +# vim: set ts=2 sw=2 et : |