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.037;
2             # ABSTRACT: a standard section in Dist::Zilla's configuration sequence
3              
4 50     50   1587 use Moose;
  50         112  
  50         486  
5             extends 'Config::MVP::Section';
6              
7 50     50   366631 use Dist::Zilla::Pragmas;
  50         134  
  50         537  
8              
9 50     50   424 use namespace::autoclean;
  50         145  
  50         562  
10              
11 50     50   5724 use Config::MVP::Section 2.200009; # not-installed error with section_name
  50         347175  
  50         21520  
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.037
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
67             released in the last two to three years. (That is, if the most recently
68             released version is v5.40, then this module should work on both v5.40 and
69             v5.38.)
70              
71             Although it may work on older versions of perl, no guarantee is made that the
72             minimum required version will not be increased. The version may be increased
73             for any reason, and there is no promise that patches will be accepted to
74             lower the minimum required perl.
75              
76             =head1 AUTHOR
77              
78             Ricardo SIGNES 😏 <cpan@semiotic.systems>
79              
80             =head1 COPYRIGHT AND LICENSE
81              
82             This software is copyright (c) 2026 by Ricardo SIGNES.
83              
84             This is free software; you can redistribute it and/or modify it under
85             the same terms as the Perl 5 programming language system itself.
86              
87             =cut