5 module Puppet::Parser::Functions
6 newfunction(:reject, :type => :rvalue, :doc => <<-EOS) do |args|
7 This function searches through an array and rejects all elements that match
8 the provided regular expression.
12 reject(['aaa','bbb','ccc','aaaddd'], 'aaa')
20 raise Puppet::ParseError,
21 "reject(): Wrong number of arguments given #{args.size} for 2"
25 pattern = Regexp.new(args[1])
27 ary.reject { |e| e =~ pattern }
31 # vim: set ts=2 sw=2 et :