4 # TODO: Remove this function when puppetlabs-stdlib 4.0.0 is in wider use
6 module Puppet::Parser::Functions
7 newfunction(:os_any2array, :type => :rvalue, :doc => <<-EOS
8 This converts any object to an array containing that object. Empty argument
9 lists are converted to an empty array. Arrays are left untouched. Hashes are
10 converted to arrays of alternating keys and values.
18 if arguments.length == 1
19 if arguments[0].kind_of?(Array)
21 elsif arguments[0].kind_of?(Hash)
23 arguments[0].each do |key, value|
24 result << key << value
34 # vim: set ts=2 sw=2 et :