Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Split a string variable into an array using the specified split
# character.
#
# Usage:
#
#   $string    = 'value1,value2'
#   $array_var = split($string, ',')
#
# $array_var holds the result ['value1', 'value2']
#
module Puppet::Parser::Functions
  newfunction(:split, :type => :rvalue) do |args|
    return args[0].split(args[1])
  end
end