File Coverage

blib/lib/Dist/Zilla/Role/MintingProfile/ShareDir.pm
Criterion Covered Total %
statement 18 19 94.7
branch 1 2 50.0
condition n/a
subroutine 6 6 100.0
pod 0 1 0.0
total 25 28 89.2


line stmt bran cond sub pod time code
1             # ABSTRACT: something that keeps its minting profile in a sharedir
2              
3             use Moose::Role;
4 2     2   4201 with 'Dist::Zilla::Role::MintingProfile';
  2         7  
  2         17  
5              
6             use Dist::Zilla::Pragmas;
7 2     2   10825  
  2         7  
  2         18  
8             use namespace::autoclean;
9 2     2   17  
  2         6  
  2         12  
10             use File::ShareDir;
11 2     2   163 use Dist::Zilla::Path;
  2         7  
  2         125  
12 2     2   16  
  2         5  
  2         33  
13             #pod =head1 DESCRIPTION
14             #pod
15             #pod This role includes L<Dist::Zilla::Role::MintingProfile>, providing a
16             #pod C<profile_dir> method that looks in the I<module>'s L<ShareDir|File::ShareDir>.
17             #pod
18             #pod =cut
19              
20             my ($self, $profile_name) = @_;
21              
22 2     2 0 7 my $profile_dir = path( File::ShareDir::module_dir($self->meta->name) )
23             ->child( $profile_name );
24 2         11  
25             return $profile_dir if -d $profile_dir;
26              
27 2 50       211 confess "Can't find profile $profile_name via $self";
28             }
29 0            
30             1;
31              
32              
33             =pod
34              
35             =encoding UTF-8
36              
37             =head1 NAME
38              
39             Dist::Zilla::Role::MintingProfile::ShareDir - something that keeps its minting profile in a sharedir
40              
41             =head1 VERSION
42              
43             version 6.028
44              
45             =head1 DESCRIPTION
46              
47             This role includes L<Dist::Zilla::Role::MintingProfile>, providing a
48             C<profile_dir> method that looks in the I<module>'s L<ShareDir|File::ShareDir>.
49              
50             =head1 PERL VERSION
51              
52             This module should work on any version of perl still receiving updates from
53             the Perl 5 Porters. This means it should work on any version of perl released
54             in the last two to three years. (That is, if the most recently released
55             version is v5.40, then this module should work on both v5.40 and v5.38.)
56              
57             Although it may work on older versions of perl, no guarantee is made that the
58             minimum required version will not be increased. The version may be increased
59             for any reason, and there is no promise that patches will be accepted to lower
60             the minimum required perl.
61              
62             =head1 AUTHOR
63              
64             Ricardo SIGNES 😏 <cpan@semiotic.systems>
65              
66             =head1 COPYRIGHT AND LICENSE
67              
68             This software is copyright (c) 2022 by Ricardo SIGNES.
69              
70             This is free software; you can redistribute it and/or modify it under
71             the same terms as the Perl 5 programming language system itself.
72              
73             =cut