Update puppetlabs/stdlib module
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / lib / puppet / parser / functions / join.rb
index 1c17997..d2d7019 100644 (file)
@@ -1,21 +1,23 @@
 #
 # join.rb
 #
-
 module Puppet::Parser::Functions
-  newfunction(:join, :type => :rvalue, :doc => <<-EOS
-This function joins an array into a string using a separator.
+  newfunction(:join, :type => :rvalue, :doc => <<-DOC
+    This function joins an array into a string using a separator.
+
+    *Examples:*
 
-*Examples:*
+        join(['a','b','c'], ",")
 
-    join(['a','b','c'], ",")
+    Would result in: "a,b,c"
 
-Would result in: "a,b,c"
-    EOS
-  ) do |arguments|
+    Note: from Puppet 5.4.0, the compatible function with the same name in Puppet core
+    will be used instead of this function.
+    DOC
+             ) do |arguments|
 
     # Technically we support two arguments but only first is mandatory ...
-    raise(Puppet::ParseError, "join(): Wrong number of arguments given (#{arguments.size} for 1)") if arguments.size < 1
+    raise(Puppet::ParseError, "join(): Wrong number of arguments given (#{arguments.size} for 1)") if arguments.empty?
 
     array = arguments[0]