File Coverage

blib/lib/Dist/Zilla/MintingProfile/Default.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 16 16 100.0


line stmt bran cond sub pod time code
1             # ABSTRACT: Default minting profile provider
2              
3             use Moose;
4 2     2   3266 with 'Dist::Zilla::Role::MintingProfile::ShareDir';
  2         5  
  2         18  
5              
6             use Dist::Zilla::Pragmas;
7 2     2   13696  
  2         7  
  2         19  
8             use namespace::autoclean;
9 2     2   26  
  2         9  
  2         17  
10             use Dist::Zilla::Util;
11 2     2   163  
  2         4  
  2         417  
12             #pod =head1 DESCRIPTION
13             #pod
14             #pod Default minting profile provider.
15             #pod
16             #pod This provider looks first in the F<~/.dzil/profiles/$profile_name> directory,
17             #pod if not found it looks among the default profiles shipped with Dist::Zilla.
18             #pod
19             #pod =cut
20              
21             around profile_dir => sub {
22             my ($orig, $self, $profile_name) = @_;
23              
24             $profile_name ||= 'default';
25              
26             # shouldn't look in user's config when testing
27             if (!$ENV{DZIL_TESTING}) {
28             my $profile_dir = Dist::Zilla::Util->_global_config_root
29             ->child('profiles', $profile_name);
30              
31             return $profile_dir if -d $profile_dir;
32             }
33              
34             return $self->$orig($profile_name);
35             };
36              
37             __PACKAGE__->meta->make_immutable;
38             1;
39              
40              
41             =pod
42              
43             =encoding UTF-8
44              
45             =head1 NAME
46              
47             Dist::Zilla::MintingProfile::Default - Default minting profile provider
48              
49             =head1 VERSION
50              
51             version 6.028
52              
53             =head1 DESCRIPTION
54              
55             Default minting profile provider.
56              
57             This provider looks first in the F<~/.dzil/profiles/$profile_name> directory,
58             if not found it looks among the default profiles shipped with Dist::Zilla.
59              
60             =head1 PERL VERSION
61              
62             This module should work on any version of perl still receiving updates from
63             the Perl 5 Porters. This means it should work on any version of perl released
64             in the last two to three years. (That is, if the most recently released
65             version is v5.40, then this module should work on both v5.40 and v5.38.)
66              
67             Although it may work on older versions of perl, no guarantee is made that the
68             minimum required version will not be increased. The version may be increased
69             for any reason, and there is no promise that patches will be accepted to lower
70             the minimum required perl.
71              
72             =head1 AUTHOR
73              
74             Ricardo SIGNES 😏 <cpan@semiotic.systems>
75              
76             =head1 COPYRIGHT AND LICENSE
77              
78             This software is copyright (c) 2022 by Ricardo SIGNES.
79              
80             This is free software; you can redistribute it and/or modify it under
81             the same terms as the Perl 5 programming language system itself.
82              
83             =cut