# File lib/puppet/provider/cron/crontab.rb, line 94
 94:   def self.match(record, resources)
 95:     resources.each do |name, resource|
 96:       # Match the command first, since it's the most important one.
 97:       next unless record[:target] == resource.value(:target)
 98:       next unless record[:command] == resource.value(:command)
 99: 
100:       # Then check the @special stuff
101:       if record[:special]
102:         next unless resource.value(:special) == record[:special]
103:       end
104: 
105:       # Then the normal fields.
106:       matched = true
107:       record_type(record[:record_type]).fields.each do |field|
108:         next if field == :command
109:         next if field == :special
110:         if record[field] and ! resource.value(field)
111:           #Puppet.info "Cron is missing %s: %s and %s" %
112:           #    [field, record[field].inspect, resource.value(field).inspect]
113:           matched = false
114:           break
115:         end
116: 
117:         if ! record[field] and resource.value(field)
118:           #Puppet.info "Hash is missing %s: %s and %s" %
119:           #    [field, resource.value(field).inspect, record[field].inspect]
120:           matched = false
121:           break
122:         end
123: 
124:         # Yay differing definitions of absent.
125:         next if (record[field] == :absent and resource.value(field) == "*")
126: 
127:         # Everything should be in the form of arrays, not the normal text.
128:         next if (record[field] == resource.value(field))
129:         #Puppet.info "Did not match %s: %s vs %s" %
130:         #    [field, resource.value(field).inspect, record[field].inspect]
131:         matched = false
132:         break
133:       end
134:       return resource if matched
135:     end
136: 
137:     false
138:   end