File Coverage

lib/Archive/Lha/Decode.pm
Criterion Covered Total %
statement 16 16 100.0
branch 2 4 50.0
condition n/a
subroutine 4 4 100.0
pod 1 1 100.0
total 23 25 92.0


line stmt bran cond sub pod time code
1             package Archive::Lha::Decode;
2            
3 16     16   1857 use strict;
  16         28  
  16         620  
4 16     16   81 use warnings;
  16         30  
  16         1052  
5 16     16   104 use Carp;
  16         28  
  16         4673  
6            
7             sub new {
8 27     27 1 14266 my ($class, %options) = @_;
9            
10 27 50       112 croak "Header is missing" unless defined $options{header};
11            
12 27         121 my $method = uc $options{header}->method;
13            
14 27         67 my $package = 'Archive::Lha::Decode::'.$method;
15            
16 27         2092 eval "require $package;";
17 27 50       141 croak "Can't load decoder: $@" if $@;
18            
19 27         162 return $package->new( %options );
20             }
21            
22             1;
23            
24             __END__