From e2aa05a0ceaf03409d5979087d8c50546e53ffe1 Mon Sep 17 00:00:00 2001 From: William Morgan Date: Sun, 17 May 2009 11:36:06 -0700 Subject: [PATCH] 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. --- lib/sup/mbox/loader.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sup/mbox/loader.rb b/lib/sup/mbox/loader.rb index 37d253e..11b0711 100644 --- 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 -- 2.45.2