Delivery/Provider/File.pm untested

filter: Statementstmt 0.0% 0 / 18 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 39 CC 3 SCAR 17.5
CC
3
Cov
0%
new
12.0
BEGIN
2.0
BEGIN
2.0
CRAP 5.8
1 package Image::Delivery::Provider::File;
2  
3 use strict;
4 use base 'Image::Delivery::Provider::Scalar';
5 use File::Slurp ();
6  
7 use vars qw{$VERSION};
8 BEGIN {
9 $VERSION = '0.14';
10 }
11  
12  
13  
14  
15  
16 #####################################################################
17 # Constructor
18  
19 sub new {
20 my $class = shift;
21 my $file = (defined $_[0] and -f $_[0] and -r _) ? shift : return undef;
22  
23 # Slurp in the image
24 my $image = File::Slurp::read_file( $file, scalar_ref => 1 );
25 return undef unless ref $image eq 'SCALAR';
26  
27 # Hand off to our parent
28 $class->SUPER::new( $image, @_ );
29 }
30  
31 1;