Update stdlib and concat to 6.1.0 both
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / lib / puppet / parser / functions / shuffle.rb
index 30c663d..3e10739 100644 (file)
@@ -1,21 +1,22 @@
 #
 # shuffle.rb
 #
-
 module Puppet::Parser::Functions
-  newfunction(:shuffle, :type => :rvalue, :doc => <<-EOS
-Randomizes the order of a string or array elements.
-    EOS
-  ) do |arguments|
+  newfunction(:shuffle, :type => :rvalue, :doc => <<-DOC
+  @summary
+    Randomizes the order of a string or array elements.
+
+   @return
+     randomized string or array
+  DOC
+             ) do |arguments|
 
-    raise(Puppet::ParseError, "shuffle(): Wrong number of arguments " +
-      "given (#{arguments.size} for 1)") if arguments.size < 1
+    raise(Puppet::ParseError, "shuffle(): Wrong number of arguments given (#{arguments.size} for 1)") if arguments.empty?
 
     value = arguments[0]
 
     unless value.is_a?(Array) || value.is_a?(String)
-      raise(Puppet::ParseError, 'shuffle(): Requires either ' +
-        'array or string to work with')
+      raise(Puppet::ParseError, 'shuffle(): Requires either array or string to work with')
     end
 
     result = value.clone