File Coverage

blib/lib/Email/MIME/Kit/KitReader/Dir.pm
Criterion Covered Total %
statement 18 18 100.0
branch 1 2 50.0
condition n/a
subroutine 5 5 100.0
pod 0 1 0.0
total 24 26 92.3


line stmt bran cond sub pod time code
1             package Email::MIME::Kit::KitReader::Dir 3.000008;
2             # ABSTRACT: read kit entries out of a directory
3              
4 6     6   3158 use v5.20.0;
  6         23  
5 6     6   33 use Moose;
  6         13  
  6         54  
6             with 'Email::MIME::Kit::Role::KitReader';
7              
8 6     6   39337 use File::Spec;
  6         15  
  6         998  
9              
10             # cache sometimes
11             sub get_kit_entry {
12 16     16 0 91 my ($self, $path) = @_;
13              
14 16         484 my $fullpath = File::Spec->catfile($self->kit->source, $path);
15              
16 16 50       893 open my $fh, '<:raw', $fullpath
17             or die "can't open $fullpath for reading: $!";
18 16         61 my $content = do { local $/; <$fh> };
  16         89  
  16         798  
19              
20 16         298 return \$content;
21             }
22              
23 6     6   46 no Moose;
  6         16  
  6         36  
24             __PACKAGE__->meta->make_immutable;
25             1;
26              
27             __END__
28              
29             =pod
30              
31             =encoding UTF-8
32              
33             =head1 NAME
34              
35             Email::MIME::Kit::KitReader::Dir - read kit entries out of a directory
36              
37             =head1 VERSION
38              
39             version 3.000008
40              
41             =head1 PERL VERSION
42              
43             This library should run on perls released even a long time ago. It should
44             work on any version of perl released in the last five years.
45              
46             Although it may work on older versions of perl, no guarantee is made that the
47             minimum required version will not be increased. The version may be increased
48             for any reason, and there is no promise that patches will be accepted to
49             lower the minimum required perl.
50              
51             =head1 AUTHOR
52              
53             Ricardo Signes <cpan@semiotic.systems>
54              
55             =head1 COPYRIGHT AND LICENSE
56              
57             This software is copyright (c) 2023 by Ricardo Signes.
58              
59             This is free software; you can redistribute it and/or modify it under
60             the same terms as the Perl 5 programming language system itself.
61              
62             =cut