| 1 | package MIME::Expander::Plugin::ApplicationGzip; | ||||||||||||
| 2 | |||||||||||||
| 3 | 4 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 4 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 4 | ▶ | use vars qw($VERSION); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 4 | $VERSION = '0.02'; | |||||||||||
| 7 | |||||||||||||
| 8 | 4 | ▶ | use parent qw(MIME::Expander::Plugin); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | 4 | __PACKAGE__->mk_classdata('ACCEPT_TYPES' => [qw( | |||||||||||
| 10 | application/gzip | ||||||||||||
| 11 | )]); | ||||||||||||
| 12 | |||||||||||||
| 13 | 4 | ▶ | use IO::Uncompress::Gunzip; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 14 | |||||||||||||
| 15 | 7 | ▶ | sub expand { | ||||||||||
|
Subroutine
expand: called CC=5 SCAR=16.3
Pod
undocumented
| |||||||||||||
| 16 | 7 | my $self = shift; | |||||||||||
| 17 | 7 | my $part = shift; | |||||||||||
| 18 | 7 | my $callback = shift; | |||||||||||
| 19 | 7 | my $c = 0; | |||||||||||
| 20 | |||||||||||||
| 21 | 7 | my $contents = $part->body; | |||||||||||
| 22 | 7 | ▶ | my $z = IO::Uncompress::Gunzip->new( | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 23 | \$contents, Append => 1 | ||||||||||||
| 24 | ) or die "gunzip failed: $IO::Uncompress::Gunzip::GunzipError"; | ||||||||||||
| 25 | |||||||||||||
| 26 | 7 | my $buf; | |||||||||||
| 27 | 7 | ▶ | 1 while( 0 < $z->read($buf) ); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 28 | |||||||||||||
| 29 | 7 | ▶ | my $h = $z->getHeaderInfo || {}; | ||||||||||
|
Condition50%1/2
$z->getHeaderInfo || {}
MC/DC0%0/1
$z->getHeaderInfo || {}
$z->getHeaderInfo
Truth table50%1/2
A
A= $z->getHeaderInfo
| |||||||||||||
| 30 | $callback->( \$buf, { | ||||||||||||
| 31 | filename => $h->{Name}, | ||||||||||||
| 32 | 7 | ▶ | } ) if( ref $callback eq 'CODE' ); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 33 | 7 | ++$c; | |||||||||||
| 34 | |||||||||||||
| 35 | 7 | return $c; | |||||||||||
| 36 | } | ||||||||||||
| 37 | |||||||||||||
| 38 | 4 | 1; | |||||||||||
| 39 | __END__ | ||||||||||||