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.037;
2             # ABSTRACT: something that keeps its minting profile in a sharedir
3              
4 2     2   2128 use Moose::Role;
  2         6  
  2         18  
5             with 'Dist::Zilla::Role::MintingProfile';
6              
7 2     2   25514 use Dist::Zilla::Pragmas;
  2         6  
  2         18  
8              
9 2     2   11 use namespace::autoclean;
  2         4  
  2         27  
10              
11 2     2   131 use File::ShareDir;
  2         4  
  2         109  
12 2     2   9 use Dist::Zilla::Path;
  2         4  
  2         26  
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 6 my ($self, $profile_name) = @_;
23              
24 2         12 my $profile_dir = path( File::ShareDir::module_dir($self->meta->name) )
25             ->child( $profile_name );
26              
27 2 50       214 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.037
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
57             released in the last two to three years. (That is, if the most recently
58             released version is v5.40, then this module should work on both v5.40 and
59             v5.38.)
60              
61             Although it may work on older versions of perl, no guarantee is made that the
62             minimum required version will not be increased. The version may be increased
63             for any reason, and there is no promise that patches will be accepted to
64             lower the minimum required perl.
65              
66             =head1 AUTHOR
67              
68             Ricardo SIGNES 😏 <cpan@semiotic.systems>
69              
70             =head1 COPYRIGHT AND LICENSE
71              
72             This software is copyright (c) 2026 by Ricardo SIGNES.
73              
74             This is free software; you can redistribute it and/or modify it under
75             the same terms as the Perl 5 programming language system itself.
76              
77             =cut