| 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
| |||||||||||
| 28 | |||||||||||
| 29 | 0 | confess "Can't find profile $profile_name via $self"; | |||||||||
| 30 | } | ||||||||||
| 31 | |||||||||||
| 32 | 2 | 1; | |||||||||
| 33 | |||||||||||
| 34 | __END__ | ||||||||||