Class: MailParser

Inherits:
BaseParser show all
Defined in:
lib/mail_parser.rb

Instance Method Summary collapse

Methods inherited from BaseParser

#initialize, #isduplicate, #parse, #parsegrep, #shouldabsent, #shouldexist

Constructor Details

This class inherits a constructor from BaseParser

Instance Method Details

#convert(curfile, lines) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/mail_parser.rb', line 16

def convert(curfile, lines)
    return unless lines and lines.length > 0

    gm = GrepMail.new(curfile, lines, 9)
    msgid, mlog = gm.tolog
    if isduplicate(msgid)
        @oh.outputmlog curfile, nil
    else
        if gm.iscomplete?
            @oh.outputmlog curfile, mlog
        elsif gm.istocc?
            @oh.outputtocc curfile, mlog
        else
            @oh.outputothers curfile
        end
    end
end

#parse_with_summaryObject



8
9
10
11
12
13
14
# File 'lib/mail_parser.rb', line 8

def parse_with_summary
    grep = shouldexist('.grep')
    shouldabsent('.mlog', '.fok')

    parsegrep grep
    @oh.finishoutput
end