add a join function
This commit is contained in:
parent
90a172d01f
commit
2dd17923bf
1 changed files with 10 additions and 0 deletions
10
lib/puppet/parser/functions/join.rb
Normal file
10
lib/puppet/parser/functions/join.rb
Normal file
|
@ -0,0 +1,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
|
Loading…
Reference in a new issue