# File lib/puppet/reports/tagmail.rb, line 38
38:   def match(taglists)
39:     matching_logs = []
40:     taglists.each do |emails, pos, neg|
41:       # First find all of the messages matched by our positive tags
42:       messages = nil
43:       if pos.include?("all")
44:         messages = self.logs
45:       else
46:         # Find all of the messages that are tagged with any of our
47:         # tags.
48:         messages = self.logs.find_all do |log|
49:           pos.detect { |tag| log.tagged?(tag) }
50:         end
51:       end
52: 
53:       # Now go through and remove any messages that match our negative tags
54:       messages = messages.reject do |log|
55:         true if neg.detect do |tag| log.tagged?(tag) end
56:       end
57: 
58:       if messages.empty?
59:         Puppet.info "No messages to report to #{emails.join(",")}"
60:         next
61:       else
62:         matching_logs << [emails, messages.collect { |m| m.to_report }.join("\n")]
63:       end
64:     end
65: 
66:     matching_logs
67:   end