Commit graph

7 commits

Author SHA1 Message Date
Alex Tomlins
44596e73da (MODULES-3246) Fix concat with Hash arguments.
85d5ead Updated the concat function so that it wouldn't modify the
original array. A side-effect of this change is that it now always calls
`Array()` on the second argument. If thit is a Hash, this results in
`to_a` being called on the hash, which converts it to an array or
tuples. This is undesired.

Update the behaviour so that it doesn't (indirectly) call `to_a` on
anything, instead test for the type of the argument, wrapping it in an
array if it's not already an array.
2016-04-08 13:42:13 +01:00
Peter Souter
84bd98645f (MODULES-444) - Real meat of the change
This is the core change, we now go through the array and add it to the first element, instead of just two arguments.
2014-12-04 14:34:25 +00:00
Peter Souter
594c2dd38d (MODULES-444) Change argument restriction to < 2 2014-12-04 14:33:23 +00:00
Peter Souter
75a6186512 (MODULES-444) Update docs with new functionality 2014-12-04 14:32:39 +00:00
Colleen Murphy
85d5eadbab Concatenate arrays without modifying the first array 2014-07-31 11:22:18 -07:00
Martin Foot
35bf5fd8c9 Allow concat to take non-array second parameters
Also improve and extend concat tests to lock down functionality
2014-02-21 15:48:27 +00:00
fatmcgav
3cef5d9e33 (#19201) Add concat function to join two arrays
Without this patch applied there is no easy way to append one array to
another.  This is a problem because it is often desirable to join two
arrays without flattening the contents into a single, one dimensional
array.

This patch addresses the problem by adding a `concat()` function which
takes two arguments.  The arguments will be concatenated together and a
new array returned to the caller.

Reviewed-by: Jeff McCune <jeff@puppetlabs.com>
2013-02-12 10:00:09 -08:00