# File lib/puppet/util/fileparsing.rb, line 154
154:     def handle_record_line(line, record)
155:         ret = nil
156:         if record.respond_to?(:process)
157:             if ret = record.send(:process, line.dup)
158:                 unless ret.is_a?(Hash)
159:                     raise Puppet::DevError,
160:                         "Process record type %s returned non-hash" % record.name
161:                 end
162:             else
163:                 return nil
164:             end
165:         elsif regex = record.match
166:             # In this case, we try to match the whole line and then use the
167:             # match captures to get our fields.
168:             if match = regex.match(line)
169:                 fields = []
170:                 ret = {}
171:                 record.fields.zip(match.captures).each do |field, value|
172:                     if value == record.absent
173:                         ret[field] = :absent
174:                     else
175:                         ret[field] = value
176:                     end
177:                 end
178:             else
179:                 nil
180:             end
181:         else
182:             ret = {}
183:             sep = record.separator
184: 
185:             # String "helpfully" replaces ' ' with /\s+/ in splitting, so we
186:             # have to work around it.
187:             if sep == " "
188:                 sep = / /
189:             end
190:             line_fields = line.split(sep)
191:             record.fields.each do |param|
192:                 value = line_fields.shift
193:                 if value and value != record.absent
194:                     ret[param] = value
195:                 else
196:                     ret[param] = :absent
197:                 end
198:             end
199: 
200:             if record.rollup and ! line_fields.empty?
201:                 last_field = record.fields[-1]
202:                 val = ([ret[last_field]] + line_fields).join(record.joiner)
203:                 ret[last_field] = val
204:             end
205:         end
206: 
207:         if ret
208:             ret[:record_type] = record.name
209:             return ret
210:         else
211:             return nil
212:         end
213:     end