Update stdlib and concat to 6.1.0 both
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / lib / puppet / parser / functions / fqdn_rand_string.rb
index ee45236..9bfba73 100644 (file)
@@ -2,17 +2,25 @@ Puppet::Parser::Functions.newfunction(
   :fqdn_rand_string,
   :arity => -2,
   :type => :rvalue,
-  :doc => "Usage: `fqdn_rand_string(LENGTH, [CHARSET], [SEED])`. LENGTH is
-  required and must be a positive integer. CHARSET is optional and may be
-  `undef` or a string. SEED is optional and may be any number or string.
-
-  Generates a random string LENGTH characters long using the character set
-  provided by CHARSET, combining the `$fqdn` fact and the value of SEED for
-  repeatable randomness. (That is, each node will get a different random
-  string from this function, but a given node's result will be the same every
-  time unless its hostname changes.) Adding a SEED can be useful if you need
-  more than one unrelated string. CHARSET will default to alphanumeric if
-  `undef` or an empty string.",
+  :doc => <<-DOC
+  @summary
+    Generates a random alphanumeric string. Combining the `$fqdn` fact and an
+    optional seed for repeatable randomness.
+
+  Optionally, you can specify a character set for the function (defaults to alphanumeric).
+
+  Arguments
+  * An integer, specifying the length of the resulting string.
+  * Optionally, a string specifying the character set.
+  * Optionally, a string specifying the seed for repeatable randomness.
+
+  @return [String]
+
+  @example Example Usage:
+    fqdn_rand_string(10)
+    fqdn_rand_string(10, 'ABCDEF!@$%^')
+    fqdn_rand_string(10, '', 'custom seed')
+  DOC
 ) do |args|
   raise(ArgumentError, 'fqdn_rand_string(): wrong number of arguments (0 for 1)') if args.empty?
   Puppet::Parser::Functions.function('is_integer')