blib/lib/Dist/Zilla/Role/MintingProfile/ShareDir.pm

filter: Statementstmt 95.2% 20 / 21 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 90.0% 27 / 30 CC 2 SCAR 2.8
CC
2
Cov
91%
profile_dir
2.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« blib/lib/Dist/Zilla/Plugin/AutoPrereqs.pm ↑ Summary blib/lib/Dist/Zilla/Plugin/Readme.pm »
1 package Dist::Zilla::Role::MintingProfile::ShareDir 6.040;
2 # ABSTRACT: something that keeps its minting profile in a sharedir
3  
4 2 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 with 'Dist::Zilla::Role::MintingProfile';
6  
7 2 ▶use Dist::Zilla::Pragmas;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 2 ▶use File::ShareDir;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 2 ▶use Dist::Zilla::Path;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 #pod =head1 DESCRIPTION
15 #pod
16 #pod This role includes L<Dist::Zilla::Role::MintingProfile>, providing a
17 #pod C<profile_dir> method that looks in the I<module>'s L<ShareDir|File::ShareDir>.
18 #pod
19 #pod =cut
20  
21 2 ▶sub profile_dir {
Subroutine profile_dir: called CC=2 SCAR=7.6
Pod undocumented
22 2 my ($self, $profile_name) = @_;
23  
24 2 my $profile_dir = path( File::ShareDir::module_dir($self->meta->name) )
25 ->child( $profile_name );
26  
27 2 ▶ return $profile_dir if -d $profile_dir;
Branch: 1 branch
BranchTrueFalseTotal
if -d $profile_dir 2 0 2
28  
29 0 confess "Can't find profile $profile_name via $self";
30 }
31  
32 2 1;
33  
34 __END__
« blib/lib/Dist/Zilla/Plugin/AutoPrereqs.pm ↑ Summary blib/lib/Dist/Zilla/Plugin/Readme.pm »