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