File Coverage

blib/lib/Dist/Zilla/App/Command/authordeps.pm
Criterion Covered Total %
statement 6 14 42.8
branch 0 2 0.0
condition 0 2 0.0
subroutine 2 5 40.0
pod 3 3 100.0
total 11 26 42.3


line stmt bran cond sub pod time code
1             package Dist::Zilla::App::Command::authordeps 6.037;
2             # ABSTRACT: List your distribution's author dependencies
3              
4 4     4   3125 use Dist::Zilla::Pragmas;
  4         12  
  4         30  
5              
6 4     4   27 use Dist::Zilla::App -command;
  4         9  
  4         30  
7              
8             #pod =head1 SYNOPSIS
9             #pod
10             #pod $ dzil authordeps
11             #pod
12             #pod This will scan the F<dist.ini> file and print a list of plugin modules that
13             #pod probably need to be installed for the dist to be buildable. This is a very
14             #pod naive scan, but tends to be pretty accurate. Modules can be added to its
15             #pod results by using special comments in the form:
16             #pod
17             #pod ; authordep Some::Package
18             #pod
19             #pod In order to add authordeps to all distributions that use a certain plugin bundle
20             #pod (or plugin), just list them as prereqs of that bundle (e.g.: using
21             #pod L<Dist::Zilla::Plugin::Prereqs> ).
22             #pod
23             #pod =cut
24              
25 0     0 1   sub abstract { "list your distribution's author dependencies" }
26              
27             sub opt_spec {
28             return (
29 0     0 1   [ 'root=s' => 'the root of the dist; defaults to .' ],
30             [ 'missing' => 'list only the missing dependencies' ],
31             [ 'versions' => 'include required version numbers in listing' ],
32             [ 'cpanm-versions' => 'format versions for consumption by cpanm' ],
33             );
34             }
35              
36             sub execute {
37 0     0 1   my ($self, $opt, $arg) = @_;
38              
39 0           require Dist::Zilla::Path;
40 0           require Dist::Zilla::Util::AuthorDeps;
41              
42 0   0       my $deps = Dist::Zilla::Util::AuthorDeps::_format_author_deps(
43             Dist::Zilla::Util::AuthorDeps::extract_author_deps(
44             Dist::Zilla::Path::path($opt->root // '.'),
45             $opt->missing,
46             ),
47             $opt->versions,
48             $opt->cpanm_versions
49             );
50              
51 0 0         $self->log($deps) if $deps;
52              
53 0           return;
54             }
55              
56             1;
57              
58             __END__
59              
60             =pod
61              
62             =encoding UTF-8
63              
64             =head1 NAME
65              
66             Dist::Zilla::App::Command::authordeps - List your distribution's author dependencies
67              
68             =head1 VERSION
69              
70             version 6.037
71              
72             =head1 SYNOPSIS
73              
74             $ dzil authordeps
75              
76             This will scan the F<dist.ini> file and print a list of plugin modules that
77             probably need to be installed for the dist to be buildable. This is a very
78             naive scan, but tends to be pretty accurate. Modules can be added to its
79             results by using special comments in the form:
80              
81             ; authordep Some::Package
82              
83             In order to add authordeps to all distributions that use a certain plugin bundle
84             (or plugin), just list them as prereqs of that bundle (e.g.: using
85             L<Dist::Zilla::Plugin::Prereqs> ).
86              
87             =head1 PERL VERSION
88              
89             This module should work on any version of perl still receiving updates from
90             the Perl 5 Porters. This means it should work on any version of perl
91             released in the last two to three years. (That is, if the most recently
92             released version is v5.40, then this module should work on both v5.40 and
93             v5.38.)
94              
95             Although it may work on older versions of perl, no guarantee is made that the
96             minimum required version will not be increased. The version may be increased
97             for any reason, and there is no promise that patches will be accepted to
98             lower the minimum required perl.
99              
100             =head1 AUTHOR
101              
102             Ricardo SIGNES 😏 <cpan@semiotic.systems>
103              
104             =head1 COPYRIGHT AND LICENSE
105              
106             This software is copyright (c) 2026 by Ricardo SIGNES.
107              
108             This is free software; you can redistribute it and/or modify it under
109             the same terms as the Perl 5 programming language system itself.
110              
111             =cut