Update puppetlabs/stdlib module
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / lib / puppet / parser / functions / reverse.rb
index aca98ce..9f7db8b 100644 (file)
@@ -1,14 +1,15 @@
 #
 # 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
+    Reverses the order of a 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]