]> git.cworth.org Git - sup/blob - lib/sup/mbox.rb
Merge branch 'buffer-rolling'
[sup] / lib / sup / mbox.rb
1 require "sup/mbox/loader"
2 require "sup/mbox/ssh-file"
3 require "sup/mbox/ssh-loader"
4
5 module Redwood
6
7 module MBox
8   BREAK_RE = /^From \S+ (.+)$/
9
10   def is_break_line? l
11     l =~ BREAK_RE or return false
12     time = $1
13     begin
14       ## hack -- make Time.parse fail when trying to substitute values from Time.now
15       Time.parse time, 0
16       true
17     rescue NoMethodError
18       warn "found invalid date in potential mbox split line, not splitting: #{l.inspect}"
19       false
20     end
21   end
22   module_function :is_break_line?
23 end
24 end