File Coverage

blib/lib/Dist/Zilla/Plugin/MetaConfig.pm
Criterion Covered Total %
statement 21 21 100.0
branch 3 4 75.0
condition n/a
subroutine 4 4 100.0
pod 0 1 0.0
total 28 30 93.3


line stmt bran cond sub pod time code
1             package Dist::Zilla::Plugin::MetaConfig 6.037;
2             # ABSTRACT: summarize Dist::Zilla configuration into distmeta
3              
4 3     3   4072 use Moose;
  3         10  
  3         28  
5             with 'Dist::Zilla::Role::MetaProvider';
6              
7 3     3   24574 use Dist::Zilla::Pragmas;
  3         10  
  3         31  
8              
9 3     3   53 use namespace::autoclean;
  3         10  
  3         37  
10              
11             #pod =head1 DESCRIPTION
12             #pod
13             #pod This plugin adds a top-level C<x_Dist_Zilla> key to the
14             #pod L<distmeta|Dist::Zilla/distmeta> for the distribution. It describe the
15             #pod Dist::Zilla version used as well as all the plugins used. Each plugin's name,
16             #pod package, and version will be included. Plugins may augment their
17             #pod implementation of the L<Dist::Zilla::Role::ConfigDumper> role methods to add
18             #pod more data to this dump.
19             #pod
20             #pod More information may be added to the top-level of this metadata as time goes
21             #pod on.
22             #pod
23             #pod =cut
24              
25             sub metadata {
26 3     3 0 12 my ($self) = @_;
27              
28 3         7 my $dump = { };
29              
30 3         6 my @plugins;
31 3         12 $dump->{plugins} = \@plugins;
32              
33 3         157 my $config = $self->zilla->dump_config;
34             $dump->{zilla} = {
35 3 50       124 class => $self->zilla->meta->name,
36             version => $self->zilla->VERSION,
37             (keys %$config ? (config => $config) : ()),
38             };
39              
40             $dump->{perl} = {
41 3         16 version => "$]",
42             };
43              
44 3         21 for my $plugin (@{ $self->zilla->plugins }) {
  3         112  
45 57         184 my $config = $plugin->dump_config;
46              
47 57 100       236 push @plugins, {
48             class => $plugin->meta->name,
49             name => $plugin->plugin_name,
50             version => $plugin->VERSION,
51             (keys %$config ? (config => $config) : ()),
52             };
53             }
54              
55 3         51 return { x_Dist_Zilla => $dump };
56             }
57              
58             __PACKAGE__->meta->make_immutable;
59             1;
60              
61             #pod =head1 SEE ALSO
62             #pod
63             #pod Dist::Zilla roles: L<MetaProvider|Dist::Zilla::Role::MetaProvider>.
64             #pod
65             #pod =cut
66              
67             __END__
68              
69             =pod
70              
71             =encoding UTF-8
72              
73             =head1 NAME
74              
75             Dist::Zilla::Plugin::MetaConfig - summarize Dist::Zilla configuration into distmeta
76              
77             =head1 VERSION
78              
79             version 6.037
80              
81             =head1 DESCRIPTION
82              
83             This plugin adds a top-level C<x_Dist_Zilla> key to the
84             L<distmeta|Dist::Zilla/distmeta> for the distribution. It describe the
85             Dist::Zilla version used as well as all the plugins used. Each plugin's name,
86             package, and version will be included. Plugins may augment their
87             implementation of the L<Dist::Zilla::Role::ConfigDumper> role methods to add
88             more data to this dump.
89              
90             More information may be added to the top-level of this metadata as time goes
91             on.
92              
93             =head1 PERL VERSION
94              
95             This module should work on any version of perl still receiving updates from
96             the Perl 5 Porters. This means it should work on any version of perl
97             released in the last two to three years. (That is, if the most recently
98             released version is v5.40, then this module should work on both v5.40 and
99             v5.38.)
100              
101             Although it may work on older versions of perl, no guarantee is made that the
102             minimum required version will not be increased. The version may be increased
103             for any reason, and there is no promise that patches will be accepted to
104             lower the minimum required perl.
105              
106             =head1 SEE ALSO
107              
108             Dist::Zilla roles: L<MetaProvider|Dist::Zilla::Role::MetaProvider>.
109              
110             =head1 AUTHOR
111              
112             Ricardo SIGNES 😏 <cpan@semiotic.systems>
113              
114             =head1 COPYRIGHT AND LICENSE
115              
116             This software is copyright (c) 2026 by Ricardo SIGNES.
117              
118             This is free software; you can redistribute it and/or modify it under
119             the same terms as the Perl 5 programming language system itself.
120              
121             =cut