File Coverage

blib/lib/Dist/Zilla/MVP/Section.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: a standard section in Dist::Zilla's configuration sequence
2              
3             use Moose;
4 50     50   1710 extends 'Config::MVP::Section';
  50         138  
  50         487  
5              
6             use Dist::Zilla::Pragmas;
7 50     50   347949  
  50         149  
  50         533  
8             use namespace::autoclean;
9 50     50   404  
  50         150  
  50         509  
10             use Config::MVP::Section 2.200009; # not-installed error with section_name
11 50     50   5043  
  50         1926  
  50         17709  
12             around add_value => sub {
13             my ($orig, $self, $name, $value) = @_;
14              
15             if ($name =~ s/\A://) {
16             if ($name eq 'version') {
17             Dist::Zilla::Util->_assert_loaded_class_version_ok(
18             $self->package,
19             $value,
20             );
21             }
22              
23             return;
24             }
25              
26             $self->$orig($name, $value);
27             };
28              
29             after finalize => sub {
30             my ($self) = @_;
31              
32             my ($name, $plugin_class, $arg) = (
33             $self->name,
34             $self->package,
35             $self->payload,
36             );
37              
38             my %payload = %{ $self->payload };
39              
40             $plugin_class->register_component($name, \%payload, $self);
41              
42             return;
43             };
44              
45             __PACKAGE__->meta->make_immutable;
46             1;
47              
48              
49             =pod
50              
51             =encoding UTF-8
52              
53             =head1 NAME
54              
55             Dist::Zilla::MVP::Section - a standard section in Dist::Zilla's configuration sequence
56              
57             =head1 VERSION
58              
59             version 6.028
60              
61             =head1 PERL VERSION
62              
63             This module should work on any version of perl still receiving updates from
64             the Perl 5 Porters. This means it should work on any version of perl released
65             in the last two to three years. (That is, if the most recently released
66             version is v5.40, then this module should work on both v5.40 and v5.38.)
67              
68             Although it may work on older versions of perl, no guarantee is made that the
69             minimum required version will not be increased. The version may be increased
70             for any reason, and there is no promise that patches will be accepted to lower
71             the minimum required perl.
72              
73             =head1 AUTHOR
74              
75             Ricardo SIGNES 😏 <cpan@semiotic.systems>
76              
77             =head1 COPYRIGHT AND LICENSE
78              
79             This software is copyright (c) 2022 by Ricardo SIGNES.
80              
81             This is free software; you can redistribute it and/or modify it under
82             the same terms as the Perl 5 programming language system itself.
83              
84             =cut