puppetlabs/puppetlabs-stdlib — pull request #128 by rdark (2013-01-28 15:13:21+00:00)
Title: strarraycat

Added a new function (and tests) for concatenating LHS and RHS values, where LHS and RHS are either a string and an array, or are both arrays.

Concatenates each value in an array with a string, or the values from another array. LHS arguments are prefixed to RHS. Third argument is optional and is a single character to insert between concatenated values

*Example 1:*

strarraycat('/var/lib/git',['puppet','stdlib'],'/')

Would result in:

[ '/var/lib/git/puppet', '/var/lib/git/stdlib' ]

Example 2:*

strarraycat(['production', 'development'],['puppet','stdlib'], '/')

Would result in:

[ 'production/puppet', 'production/stdlib', 'development/puppet', 'development/stdlib' ]