line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MIME::Expander::Plugin; |
2
|
|
|
|
|
|
|
|
3
|
9
|
|
|
9
|
|
217188
|
use strict; |
|
9
|
|
|
|
|
17
|
|
|
9
|
|
|
|
|
341
|
|
4
|
9
|
|
|
9
|
|
46
|
use warnings; |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
265
|
|
5
|
9
|
|
|
9
|
|
38
|
use vars qw($VERSION); |
|
9
|
|
|
|
|
14
|
|
|
9
|
|
|
|
|
466
|
|
6
|
|
|
|
|
|
|
$VERSION = '0.02'; |
7
|
|
|
|
|
|
|
|
8
|
9
|
|
|
9
|
|
41
|
use parent qw(Class::Data::Inheritable); |
|
9
|
|
|
|
|
15
|
|
|
9
|
|
|
|
|
79
|
|
9
|
9
|
|
|
9
|
|
7860
|
use Email::MIME; |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
1693
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
__PACKAGE__->mk_classdata('ACCEPT_TYPES' => [qw( |
12
|
|
|
|
|
|
|
)]); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub new { |
15
|
31
|
|
|
31
|
0
|
8100
|
my $class = shift; |
16
|
31
|
|
33
|
|
|
261
|
bless {}, (ref $class || $class); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub is_acceptable { |
20
|
259
|
|
|
259
|
0
|
11831
|
my $self = shift; |
21
|
259
|
50
|
|
|
|
598
|
my $type = shift or return (); |
22
|
259
|
|
|
|
|
261
|
for ( @{$self->ACCEPT_TYPES} ){ |
|
259
|
|
|
|
|
755
|
|
23
|
332
|
100
|
|
|
|
2370
|
return 1 if( $type eq $_ ); |
24
|
|
|
|
|
|
|
} |
25
|
225
|
|
|
|
|
797
|
return (); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub expand { |
29
|
1
|
|
|
1
|
0
|
5850
|
my $self = shift; |
30
|
1
|
|
|
|
|
3
|
my $part = shift; |
31
|
1
|
|
|
|
|
2
|
my $callback = shift; |
32
|
1
|
|
|
|
|
3
|
my $c = 0; |
33
|
|
|
|
|
|
|
|
34
|
1
|
50
|
|
|
|
9
|
$callback->( $part->body ) |
35
|
|
|
|
|
|
|
if( ref $callback eq 'CODE' ); |
36
|
|
|
|
|
|
|
|
37
|
1
|
|
|
|
|
940
|
++$c; |
38
|
|
|
|
|
|
|
|
39
|
1
|
|
|
|
|
5
|
return $c; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
__END__ |