X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fflatten.rb;fp=3rdparty%2Fmodules%2Fstdlib%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fflatten.rb;h=6be5962b26f823e289b369c5fb55564bd8211222;hb=131e09855e065be940e104d9ab0f18940cc76257;hp=4401bdb351e6ddf2c713efea12fc2f2d926b12ab;hpb=407d322498f4fde815abf381007fbecfe5c10b2b;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/lib/puppet/parser/functions/flatten.rb b/3rdparty/modules/stdlib/lib/puppet/parser/functions/flatten.rb index 4401bdb35..6be5962b2 100644 --- a/3rdparty/modules/stdlib/lib/puppet/parser/functions/flatten.rb +++ b/3rdparty/modules/stdlib/lib/puppet/parser/functions/flatten.rb @@ -1,19 +1,21 @@ # # flatten.rb # - module Puppet::Parser::Functions - newfunction(:flatten, :type => :rvalue, :doc => <<-EOS -This function flattens any deeply nested arrays and returns a single flat array -as a result. + newfunction(:flatten, :type => :rvalue, :doc => <<-DOC + This function flattens any deeply nested arrays and returns a single flat array + as a result. + + *Examples:* -*Examples:* + flatten(['a', ['b', ['c']]]) - flatten(['a', ['b', ['c']]]) + Would return: ['a','b','c'] -Would return: ['a','b','c'] - EOS - ) do |arguments| + Note: from Puppet 5.5.0, the compatible function with the same name in Puppet core + will be used instead of this function. + DOC + ) do |arguments| raise(Puppet::ParseError, "flatten(): Wrong number of arguments given (#{arguments.size} for 1)") if arguments.size != 1