aboutsummaryrefslogtreecommitdiff
path: root/lib/puppet/parser/functions/array_join.rb
blob: c715c5d39c66011fa4aa981d8d556dec47c0ab02 (plain)
1
2
3
4
5
6
7
8
Puppet::Parser::Functions::newfunction(:array_join,
    :type => :rvalue,
    :doc  => "Join a list of strings with an optional delimiter.") do |args|
  unless 1..2.include? args.length
    raise Puppet::ParseError, 'array_join() takes 1 or 2 arguments'
  end
  args.first.join args.last
end