5 module Puppet::Parser::Functions
6 newfunction(:concat, :type => :rvalue, :doc => <<-EOS
7 Appends the contents of multiple arrays into array 1.
11 concat(['1','2','3'],['4','5','6'],['7','8','9'])
15 ['1','2','3','4','5','6','7','8','9']
19 # Check that more than 2 arguments have been given ...
20 raise(Puppet::ParseError, "concat(): Wrong number of arguments " +
21 "given (#{arguments.size} for < 2)") if arguments.size < 2
25 # Check that the first parameter is an array
27 raise(Puppet::ParseError, 'concat(): Requires array to work with')
34 result = result + Array(x)
41 # vim: set ts=2 sw=2 et :