summaryrefslogtreecommitdiff
path: root/lib/puppet/parser/functions/member.rb
diff options
context:
space:
mode:
authorKen Barber <ken@bob.sh>2011-04-30 16:00:49 +0200
committerKen Barber <ken@bob.sh>2011-04-30 16:00:49 +0200
commitaafce9c99b779855e1e10e5a337848fa9f676a01 (patch)
treed012e1ca5ea41a41cd8782c7c106f91b51bc1be4 /lib/puppet/parser/functions/member.rb
parent09abea2d47b09b9e8933a1c27c7a454c77760e83 (diff)
Moved more functions into lib/puppet/parser/functions/
Diffstat (limited to 'lib/puppet/parser/functions/member.rb')
-rw-r--r--lib/puppet/parser/functions/member.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/puppet/parser/functions/member.rb b/lib/puppet/parser/functions/member.rb
index a491a76..bb43a37 100644
--- a/lib/puppet/parser/functions/member.rb
+++ b/lib/puppet/parser/functions/member.rb
@@ -1,28 +1,28 @@
#
-# include.rb
+# member.rb
#
# TODO(Krzysztof Wilczynski): We need to add support for regular expression ...
# TODO(Krzysztof Wilczynski): Support for strings and hashes too ...
module Puppet::Parser::Functions
- newfunction(:includes, :type => :rvalue, :doc => <<-EOS
+ newfunction(:member, :type => :rvalue, :doc => <<-EOS
EOS
) do |arguments|
- raise(Puppet::ParseError, "includes(): Wrong number of arguments " +
+ raise(Puppet::ParseError, "member(): Wrong number of arguments " +
"given (#{arguments.size} for 2)") if arguments.size < 2
array = arguments[0]
- if not array.is_a?(Array)
- raise(Puppet::ParseError, 'includes(): Requires an array to work with')
+ unless array.is_a?(Array)
+ raise(Puppet::ParseError, 'member(): Requires array to work with')
end
item = arguments[1]
- raise(Puppet::ParseError, 'includes(): You must provide item ' +
- 'to search for within given array') if item.empty?
+ raise(Puppet::ParseError, 'member(): You must provide item ' +
+ 'to search for within array given') if item.empty?
result = array.include?(item)