line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MIME::Expander::Plugin; |
2
|
|
|
|
|
|
|
|
3
|
9
|
|
|
9
|
|
34746
|
use strict; |
|
9
|
|
|
|
|
21
|
|
|
9
|
|
|
|
|
656
|
|
4
|
9
|
|
|
9
|
|
52
|
use warnings; |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
396
|
|
5
|
9
|
|
|
9
|
|
49
|
use vars qw($VERSION); |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
547
|
|
6
|
|
|
|
|
|
|
$VERSION = '0.01'; |
7
|
|
|
|
|
|
|
|
8
|
9
|
|
|
9
|
|
754
|
use parent qw(Class::Data::Inheritable); |
|
9
|
|
|
|
|
296
|
|
|
9
|
|
|
|
|
157
|
|
9
|
9
|
|
|
9
|
|
20574
|
use Email::MIME; |
|
9
|
|
|
|
|
698928
|
|
|
9
|
|
|
|
|
1898
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
__PACKAGE__->mk_classdata('ACCEPT_TYPES' => [qw( |
12
|
|
|
|
|
|
|
)]); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub new { |
15
|
28
|
|
|
28
|
0
|
7627
|
my $class = shift; |
16
|
28
|
|
33
|
|
|
294
|
bless {}, (ref $class || $class); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub is_acceptable { |
20
|
180
|
|
|
180
|
0
|
14498
|
my $self = shift; |
21
|
180
|
50
|
|
|
|
504
|
my $type = shift or return (); |
22
|
180
|
|
|
|
|
291
|
for ( @{$self->ACCEPT_TYPES} ){ |
|
180
|
|
|
|
|
758
|
|
23
|
312
|
100
|
|
|
|
2195
|
return 1 if( $type eq $_ ); |
24
|
|
|
|
|
|
|
} |
25
|
148
|
|
|
|
|
728
|
return (); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub expand { |
29
|
1
|
|
|
1
|
0
|
3
|
my $self = shift; |
30
|
1
|
|
|
|
|
2
|
my $contents = shift; |
31
|
1
|
|
|
|
|
2
|
my $callback = shift; |
32
|
1
|
|
|
|
|
2
|
my $c = 0; |
33
|
|
|
|
|
|
|
|
34
|
1
|
50
|
|
|
|
9
|
$callback->( ref $contents eq 'SCALAR' ? $contents : \$contents ) |
|
|
50
|
|
|
|
|
|
35
|
|
|
|
|
|
|
if( ref $callback eq 'CODE' ); |
36
|
|
|
|
|
|
|
|
37
|
1
|
|
|
|
|
1094
|
++$c; |
38
|
|
|
|
|
|
|
|
39
|
1
|
|
|
|
|
6
|
return $c; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
__END__ |