X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Freverse.rb;h=8b97a97311afaf25b5500159d670b4ce9e653f8a;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hp=aca98cea333142d3c7a5e45c51bda7efe3d68e71;hpb=6963202b4b62c2816655ac9532521b018fdf83bd;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/lib/puppet/parser/functions/reverse.rb b/3rdparty/modules/stdlib/lib/puppet/parser/functions/reverse.rb index aca98cea3..8b97a9731 100644 --- a/3rdparty/modules/stdlib/lib/puppet/parser/functions/reverse.rb +++ b/3rdparty/modules/stdlib/lib/puppet/parser/functions/reverse.rb @@ -1,14 +1,19 @@ # # reverse.rb # - module Puppet::Parser::Functions - newfunction(:reverse, :type => :rvalue, :doc => <<-EOS -Reverses the order of a string or array. - EOS - ) do |arguments| + newfunction(:reverse, :type => :rvalue, :doc => <<-DOC + @summary + Reverses the order of a string or array. + + @return + reversed string or array + + > *Note:* that the same can be done with the reverse_each() function in Puppet. + DOC + ) do |arguments| - raise(Puppet::ParseError, "reverse(): Wrong number of arguments given (#{arguments.size} for 1)") if arguments.size < 1 + raise(Puppet::ParseError, "reverse(): Wrong number of arguments given (#{arguments.size} for 1)") if arguments.empty? value = arguments[0]