blib/lib/Dist/Zilla/Plugin/MetaConfig.pm

filter: Statementstmt 100% 24 / 24 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 93.9% 31 / 33 CC 4 SCAR 10.0
CC
4
Cov
96%
metadata
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.7
« blib/lib/Dist/Zilla/Role/FileMunger.pm ↑ Summary blib/lib/Dist/Zilla/Role/MutableFile.pm »
1 package Dist::Zilla::Plugin::MetaConfig 6.040;
2 # ABSTRACT: summarize Dist::Zilla configuration into distmeta
3  
4 3 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 with 'Dist::Zilla::Role::MetaProvider';
6  
7 3 ▶use Dist::Zilla::Pragmas;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 3 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
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 3 ▶sub metadata {
Subroutine metadata: called CC=4 SCAR=13.9
Pod undocumented
26 3 my ($self) = @_;
27  
28 3 my $dump = { };
29  
30 3 my @plugins;
31 3 $dump->{plugins} = \@plugins;
32  
33 3 my $config = $self->zilla->dump_config;
34 $dump->{zilla} = {
35 3 ▶ class => $self->zilla->meta->name,
Branch: 1 branch
BranchTrueFalseTotal
keys %$config ? : 3 0 3
36 version => $self->zilla->VERSION,
37 (keys %$config ? (config => $config) : ()),
38 };
39  
40 $dump->{perl} = {
41 3 version => "$]",
42 };
43  
44 3 for my $plugin (@{ $self->zilla->plugins }) {
45 57 my $config = $plugin->dump_config;
46  
47 57 ▶ push @plugins, {
Branch: 1 branch
BranchTrueFalseTotal
keys %$config ? : 17 40 57
48 class => $plugin->meta->name,
49 name => $plugin->plugin_name,
50 version => $plugin->VERSION,
51 (keys %$config ? (config => $config) : ()),
52 };
53 }
54  
55 3 return { x_Dist_Zilla => $dump };
56 }
57  
58 3 __PACKAGE__->meta->make_immutable;
59 3 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__
« blib/lib/Dist/Zilla/Role/FileMunger.pm ↑ Summary blib/lib/Dist/Zilla/Role/MutableFile.pm »