aboutsummaryrefslogtreecommitdiff
path: root/lib/puppet/parser/functions/join.rb
blob: 95b664c90524efc9af25a283ee4e7c9fc6383734 (plain)
1
2
3
4
5
6
7
8
9
10
Puppet::Parser::Functions::newfunction(
  :join,
  :type => :rvalue,
  :doc => "Joins the values of the array in arg1 with the string in arg2

    Example: join(['a','b'],',') -> 'a,b'"
) do |args|
  raise Puppet::ParseError, 'join() needs two arguments' if args.length != 2
  args[0].to_a.join(args[1])
end