Update puppetlabs/stdlib module
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / lib / puppet / parser / functions / difference.rb
index c9ac478..360c1e3 100644 (file)
@@ -1,20 +1,25 @@
 #
 # difference.rb
 #
-
 module Puppet::Parser::Functions
-  newfunction(:difference, :type => :rvalue, :doc => <<-EOS
-This function returns the difference between two arrays.
-The returned array is a copy of the original array, removing any items that
-also appear in the second array.
+  newfunction(:difference, :type => :rvalue, :doc => <<-DOC
+    This function returns the difference between two arrays.
+    The returned array is a copy of the original array, removing any items that
+    also appear in the second array.
+
+    *Examples:*
+
+        difference(["a","b","c"],["b","c","d"])
+
+    Would return: ["a"]
 
-*Examples:*
+    Note: Since Puppet 4 the minus (-) operator in the Puppet language does the same thing:
 
-    difference(["a","b","c"],["b","c","d"])
+      ['a', 'b', 'c'] - ['b', 'c', 'd']
+      # would return ['a']
 
-Would return: ["a"]
-    EOS
-  ) do |arguments|
+    DOC
+             ) do |arguments|
 
     # Two arguments are required
     raise(Puppet::ParseError, "difference(): Wrong number of arguments given (#{arguments.size} for 2)") if arguments.size != 2