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