commit e2aa05a0ceaf03409d5979087d8c50546e53ffe1
parent 55133abad76e8415a078fa0b0749094406f4d08a
Author: William Morgan <wmorgan-sup@masanjin.net>
Date: Sun, 17 May 2009 11:36:06 -0700
make MBox::Loader#next return nil once EOF is hit
Previously it was raising a debugging exception. This is a better
interface for writing unit tests against.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/sup/mbox/loader.rb b/lib/sup/mbox/loader.rb
@@ -128,7 +128,7 @@ class Loader < Source
## 2. at the beginning of an mbox separator (in all other
## cases).
- l = @f.gets or raise "next while at EOF"
+ l = @f.gets or return nil
if l =~ /^\s*$/ # case 1
returned_offset = @f.tell
@f.gets # now we're at a BREAK_RE, so skip past it