lib/sup/mbox.rb in sup-0.20.0 vs lib/sup/mbox.rb in sup-0.21.0

- old
+ new

@@ -113,11 +113,11 @@ each_raw_message_line(offset) { |l| ret << l } ret end def store_message date, from_email, &block - need_blank = File.exists?(@path) && !File.zero?(@path) + need_blank = File.exist?(@path) && !File.zero?(@path) File.open(@path, "ab") do |f| f.puts if need_blank f.puts "From #{from_email} #{date.asctime}" yield f end @@ -178,10 +178,10 @@ def self.is_break_line? l l =~ BREAK_RE or return false time = $1 begin ## hack -- make Time.parse fail when trying to substitute values from Time.now - Time.parse time, 0 + Time.parse time, Time.at(0) true rescue NoMethodError, ArgumentError warn "found invalid date in potential mbox split line, not splitting: #{l.inspect}" false end