ruby-marc/ruby-marc — pull request #29 by daniels (2014-03-21 08:01:36+00:00)
Title: Add iterator for raw records

Refactor `each` to use another iterator for getting the raw data.
Exposing this iterator allows the user to handle decoding errors per
record while iterating through the file.

My use case was that I got a lot of encoding errors, and wanted to correct them in the source application. For this I wanted a list of the corrupted records. But the call to MARC::Reader.decode was made inside `each`, and since the exception left no reference to the corrupt record I could not get to it, only the previous or the next. With this I'm able to manually handle the decode-part, and decide what to do when it causes an error.