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