X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fdifference.rb;h=49e86737141f57a1d7d787879d287b36431e9bf9;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hp=c9ac478731d7adb051b3a8d3e3086dfc5fe36ddf;hpb=6963202b4b62c2816655ac9532521b018fdf83bd;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/lib/puppet/parser/functions/difference.rb b/3rdparty/modules/stdlib/lib/puppet/parser/functions/difference.rb index c9ac47873..49e867371 100644 --- a/3rdparty/modules/stdlib/lib/puppet/parser/functions/difference.rb +++ b/3rdparty/modules/stdlib/lib/puppet/parser/functions/difference.rb @@ -1,20 +1,29 @@ # # 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 + @summary + 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. + + @example Example usage + + 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: + ['a', 'b', 'c'] - ['b', 'c', 'd'] + Would return: `['a']` - difference(["a","b","c"],["b","c","d"]) + @return [Array] + The difference between the two given arrays -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