projects
/
mirror
/
dsa-puppet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update stdlib and concat to 6.1.0 both
[mirror/dsa-puppet.git]
/
3rdparty
/
modules
/
stdlib
/
lib
/
puppet
/
parser
/
functions
/
intersection.rb
diff --git
a/3rdparty/modules/stdlib/lib/puppet/parser/functions/intersection.rb
b/3rdparty/modules/stdlib/lib/puppet/parser/functions/intersection.rb
index
48f02e9
..
b46ca58
100644
(file)
--- a/
3rdparty/modules/stdlib/lib/puppet/parser/functions/intersection.rb
+++ b/
3rdparty/modules/stdlib/lib/puppet/parser/functions/intersection.rb
@@
-1,22
+1,22
@@
#
# intersection.rb
#
#
# intersection.rb
#
-
module Puppet::Parser::Functions
module Puppet::Parser::Functions
- newfunction(:intersection, :type => :rvalue, :doc => <<-EOS
-This function returns an array an intersection of two.
-
-*Examples:*
+ newfunction(:intersection, :type => :rvalue, :doc => <<-DOC
+ @summary
+ This function returns an array of the intersection of two.
- intersection(["a","b","c"],["b","c","d"])
+ @return
+ an array of the intersection of two.
-Would return: ["b","c"]
- EOS
- ) do |arguments|
+ @example Example Usage:
+ intersection(["a","b","c"],["b","c","d"]) # returns ["b","c"]
+ intersection(["a","b","c"],[1,2,3,4]) # returns [] (true, when evaluated as a Boolean)
+ DOC
+ ) do |arguments|
# Two arguments are required
# Two arguments are required
- raise(Puppet::ParseError, "intersection(): Wrong number of arguments " +
- "given (#{arguments.size} for 2)") if arguments.size != 2
+ raise(Puppet::ParseError, "intersection(): Wrong number of arguments given (#{arguments.size} for 2)") if arguments.size != 2
first = arguments[0]
second = arguments[1]
first = arguments[0]
second = arguments[1]