| 1 | package Email::MIME::Kit::KitReader::Dir 3.000007; | ||||||||||
| 2 | # ABSTRACT: read kit entries out of a directory | ||||||||||
| 3 | |||||||||||
| 4 | 6 | ▶ | use v5.20.0; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 6 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 6 | with 'Email::MIME::Kit::Role::KitReader'; | |||||||||
| 7 | |||||||||||
| 8 | 6 | ▶ | use File::Spec; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | # cache sometimes | ||||||||||
| 11 | sub get_kit_entry { | ||||||||||
| 12 | 16 | ▶ | my ($self, $path) = @_; | ||||||||
|
Subroutine
get_kit_entry: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||
| 13 | |||||||||||
| 14 | 16 | my $fullpath = File::Spec->catfile($self->kit->source, $path); | |||||||||
| 15 | |||||||||||
| 16 | 16 | ▶ | open my $fh, '<:raw', $fullpath | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | or die "can't open $fullpath for reading: $!"; | ||||||||||
| 18 | 16 | my $content = do { local $/; <$fh> }; | |||||||||
| 19 | |||||||||||
| 20 | 16 | return \$content; | |||||||||
| 21 | } | ||||||||||
| 22 | |||||||||||
| 23 | 6 | ▶ | no Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 24 | 6 | __PACKAGE__->meta->make_immutable; | |||||||||
| 25 | 6 | 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.000007 | ||||||||||
| 40 | |||||||||||
| 41 | =head1 PERL VERSION | ||||||||||
| 42 | |||||||||||
| 43 | This library should run on perls released even a long time ago. It should work | ||||||||||
| 44 | 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 lower | ||||||||||
| 49 | the minimum required perl. | ||||||||||
| 50 | |||||||||||
| 51 | =head1 AUTHOR | ||||||||||
| 52 | |||||||||||
| 53 | Ricardo Signes <rjbs@cpan.org> | ||||||||||
| 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 | ||||||||||