App/Pinto/Command/doc.pm

filter: Statementstmt 62.5% 15 / 24 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 57.1% 4 / 7 Podpod 100% 3 / 3 totaltotal 55.0% 22 / 40 CC 4 SCAR 21.7
CC
4
Cov
50%
validate_args
20.0
command_names
2.0
opt_spec
2.0
CRAP 8.8
↑ Summary Pinto/Action/Doc.pm »
1 package App::Pinto::Command::doc;
2 {
3 1 $App::Pinto::Command::doc::VERSION = '0.004';
4 }
5  
6 # ABSTRACT: generate html docs from the dists in a stack
7  
8 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 ▶use Pinto::Util qw(interpolate);
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 #-----------------------------------------------------------------------------
14  
15 1 ▶use base 'App::Pinto::Command';
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 #------------------------------------------------------------------------------
18  
19 0 ▶sub command_names { return qw( doc ) }
Subroutine command_names: not called CC=1 SCAR=6.9
Pod documented
20  
21 #------------------------------------------------------------------------------
22  
23 0 ▶sub opt_spec {
Subroutine opt_spec: not called CC=1 SCAR=6.9
Pod documented
24 0 my ( $self, $app ) = @_;
25  
26 return (
27 0 [ "out|o=s", "Destination for generated HTML" ],
28 [ "title=s", "Your project's title" ],
29 [ "desc=s", "Your project's description" ],
30 [ "charset=s", "This is used in meta tag in html. default 'UTF-8'" ],
31 [ "noindex!", "Don't create index on each pod pages." ],
32 [ "forcegen!", "Generate documents each time" ],
33 [ "lang=s", "Set this language as xml:lang. default 'en'" ],
34 [],
35 [ "root|r=s", "Path to pinto root" ],
36 [ "author|A=s", "Limit to distributions by author" ],
37 [ "distributions|D=s", "Limit to matching distribution names" ],
38 [ "packages|P=s", "Limit to matching package names" ],
39 [ "pinned!", "Limit to pinned packages (negatable)" ],
40 [ "stack|s=s", "List contents of this stack" ],
41 [ "local", "Limit to local distributions" ],
42 [ 'help|h', "print usage message and exit" ],
43 );
44 }
45  
46 #------------------------------------------------------------------------------
47  
48 0 ▶sub validate_args {
Subroutine validate_args: not called CC=4 SCAR=30.0
Pod documented
49 0 my ( $self, $opts, $args ) = @_;
50  
51 $self->usage_error('Multiple arguments are not allowed')
52 0 ▶ if @{$args} > 1;
Branch: 1 branch
BranchTrueFalseTotal
if @{$args;} > 1 0 0 0
53  
54 0 ▶ $opts->{stack} = $args->[0]
Branch: 1 branch
BranchTrueFalseTotal
if $args->[0] 0 0 0
55 if $args->[0];
56  
57 $self->usage_error('missing required options: output')
58 0 ▶ unless $opts->{out};
Branch: 1 branch
BranchTrueFalseTotal
unless $opts->{"out"} 0 0 0
59
60 0 return 1;
61 }
62  
63 #------------------------------------------------------------------------------
64  
65 1 1;
66  
67 __END__
↑ Summary Pinto/Action/Doc.pm »