| 1 | # Copyrights 2003-2015 by [Mark Overmeer]. | ||||||||||||||||||||||||||||||||||||||||||
| 2 | # For other contributors see ChangeLog. | ||||||||||||||||||||||||||||||||||||||||||
| 3 | # See the manual pages for details on the licensing terms. | ||||||||||||||||||||||||||||||||||||||||||
| 4 | # Pod stripped from pm file by OODoc 2.01. | ||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||
| 6 | package OODoc; | ||||||||||||||||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use vars '$VERSION'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | 1 | $VERSION = '2.01'; | |||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||
| 10 | 1 | ▶ | use base 'OODoc::Object'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||
| 12 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 13 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||
| 15 | 1 | ▶ | use Log::Report 'oodoc'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||
| 17 | 1 | ▶ | use OODoc::Manifest; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | 1 | ▶ | use File::Copy; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | 1 | ▶ | use File::Spec; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 21 | 1 | ▶ | use File::Basename; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | 1 | ▶ | use IO::File; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 23 | 1 | ▶ | use List::Util 'first'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||
| 26 | sub init($) | ||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | ▶ | { my ($self, $args) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
init: not called CC=11 SCAR=48.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | ▶ | $self->SUPER::init($args) or return; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||
| 31 | 0 | $self->{O_pkg} = {}; | |||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||
| 33 | 0 | my $distribution = $self->{O_distribution} = delete $args->{distribution}; | |||||||||||||||||||||||||||||||||||||||||
| 34 | 0 | ▶ | defined $distribution | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 35 | or error __x"the produced distribution needs a project description"; | ||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | ▶ | $self->{O_project} = delete $args->{project} || $distribution; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
delete $args->{'project'} || $distribution
MC/DC0%0/2
delete $args->{'project'} || $distribution
delete $args->{'project'}
$distribution
Truth table0%0/3
A || B
A= delete $args->{'project'}B= $distribution
| |||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||
| 39 | 0 | my $version = delete $args->{version}; | |||||||||||||||||||||||||||||||||||||||||
| 40 | 0 | ▶ | unless(defined $version) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 41 | 0 | ▶ | { my $fn = -f 'version' ? 'version' | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 42 | : -f 'VERSION' ? 'VERSION' | ||||||||||||||||||||||||||||||||||||||||||
| 43 | : undef; | ||||||||||||||||||||||||||||||||||||||||||
| 44 | 0 | ▶ | if(defined $fn) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 45 | 0 | ▶ | { my $v = IO::File->new($fn, 'r') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 46 | or fault __x"cannot read version from file {file}", file=> $fn; | ||||||||||||||||||||||||||||||||||||||||||
| 47 | 0 | $version = $v->getline; | |||||||||||||||||||||||||||||||||||||||||
| 48 | 0 | ▶ | $version = $1 if $version =~ m/(\d+\.[\d\.]+)/; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 49 | 0 | chomp $version; | |||||||||||||||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||
| 53 | 0 | ▶ | defined $version | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 54 | or error __x"no version specified for distribution '{dist}'" | ||||||||||||||||||||||||||||||||||||||||||
| 55 | , dist => $distribution; | ||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||
| 57 | 0 | $self->{O_version} = $version; | |||||||||||||||||||||||||||||||||||||||||
| 58 | 0 | $self; | |||||||||||||||||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||
| 61 | #------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||||||||||||
| 64 | 0 | ▶ | sub distribution() {shift->{O_distribution}} | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
distribution: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||||||||||||
| 67 | 0 | ▶ | sub version() {shift->{O_version}} | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
version: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||||||||||||||||
| 70 | 0 | ▶ | sub project() {shift->{O_project}} | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
project: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||||||||||
| 72 | #------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||||||||||||||||
| 75 | sub selectFiles($@) | ||||||||||||||||||||||||||||||||||||||||||
| 76 | 0 | ▶ | { my ($self, $files) = (shift, shift); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
selectFiles: not called CC=7 SCAR=40.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||||||||||
| 78 | my $select | ||||||||||||||||||||||||||||||||||||||||||
| 79 | 0 | ▶ | = ref $files eq 'Regexp' ? sub { $_[0] =~ $files } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||
| 80 | 0 | ▶ | : ref $files eq 'CODE' ? $files | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 81 | : ref $files eq 'ARRAY' ? $files | ||||||||||||||||||||||||||||||||||||||||||
| 82 | : error __x"use regex, code reference or array for file selection"; | ||||||||||||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||||||||||||
| 84 | 0 | ▶ | return ($select, []) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 85 | if ref $select eq 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||||
| 87 | 0 | my (@process, @copy); | |||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | foreach my $fn (@_) | |||||||||||||||||||||||||||||||||||||||||
| 89 | 0 | ▶ | { if($select->($fn)) {push @process, $fn} | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | else {push @copy, $fn} | |||||||||||||||||||||||||||||||||||||||||
| 91 | } | ||||||||||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||||||||||
| 93 | 0 | ( \@process, \@copy ); | |||||||||||||||||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||||||||||||||||
| 97 | sub processFiles(@) | ||||||||||||||||||||||||||||||||||||||||||
| 98 | 0 | ▶ | { my ($self, %args) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
processFiles: not called CC=36 SCAR=71.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||
| 100 | exists $args{workdir} | ||||||||||||||||||||||||||||||||||||||||||
| 101 | 0 | ▶ | or error __x"requires a directory to write the distribution to"; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||||||||||||
| 103 | 0 | my $dest = $args{workdir}; | |||||||||||||||||||||||||||||||||||||||||
| 104 | 0 | my $source = $args{source}; | |||||||||||||||||||||||||||||||||||||||||
| 105 | 0 | ▶ | my $distr = $args{distribution} || $self->distribution; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$args{'distribution'} || $self->distribution
MC/DC0%0/2
$args{'distribution'} || $self->distribution
$args{'distribution'}
$self->distribution
Truth table0%0/3
A || B
A= $args{'distribution'}B= $self->distribution
| |||||||||||||||||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||||||||||||||||
| 107 | 0 | my $version = $args{version}; | |||||||||||||||||||||||||||||||||||||||||
| 108 | 0 | ▶ | unless(defined $version) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 109 | 0 | ▶ | { my $fn = defined $source ? File::Spec->catfile($source, 'version') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 110 | : 'version'; | ||||||||||||||||||||||||||||||||||||||||||
| 111 | 0 | ▶ | $fn = -f $fn ? $fn | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 112 | : defined $source ? File::Spec->catfile($source, 'VERSION') | ||||||||||||||||||||||||||||||||||||||||||
| 113 | : 'VERSION'; | ||||||||||||||||||||||||||||||||||||||||||
| 114 | 0 | ▶ | if(defined $fn) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 115 | 0 | ▶ | { my $v = IO::File->new($fn, "r") | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 116 | or fault __x"cannot read version from {file}", file => $fn; | ||||||||||||||||||||||||||||||||||||||||||
| 117 | 0 | $version = $v->getline; | |||||||||||||||||||||||||||||||||||||||||
| 118 | 0 | ▶ | $version = $1 if $version =~ m/(\d+\.[\d\.]+)/; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 119 | 0 | chomp $version; | |||||||||||||||||||||||||||||||||||||||||
| 120 | } | ||||||||||||||||||||||||||||||||||||||||||
| 121 | elsif($version = $self->version) { ; } | ||||||||||||||||||||||||||||||||||||||||||
| 122 | else | ||||||||||||||||||||||||||||||||||||||||||
| 123 | 0 | { error __x"there is no version defined for the source files"; | |||||||||||||||||||||||||||||||||||||||||
| 124 | } | ||||||||||||||||||||||||||||||||||||||||||
| 125 | } | ||||||||||||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||||||||||||
| 127 | 0 | my $notice = ''; | |||||||||||||||||||||||||||||||||||||||||
| 128 | 0 | ▶ | if($notice = $args{notice}) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 129 | 0 | { $notice =~ s/^(\#\s)?/# /mg; # put comments if none | |||||||||||||||||||||||||||||||||||||||||
| 130 | } | ||||||||||||||||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||||||||||||||||
| 132 | # | ||||||||||||||||||||||||||||||||||||||||||
| 133 | # Split the set of files into those who do need special processing | ||||||||||||||||||||||||||||||||||||||||||
| 134 | # and those who do not. | ||||||||||||||||||||||||||||||||||||||||||
| 135 | # | ||||||||||||||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||||||||||||||
| 137 | my $manfile | ||||||||||||||||||||||||||||||||||||||||||
| 138 | = exists $args{manifest} ? $args{manifest} | ||||||||||||||||||||||||||||||||||||||||||
| 139 | 0 | ▶ | : defined $source ? File::Spec->catfile($source, 'MANIFEST') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 140 | : 'MANIFEST'; | ||||||||||||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||||||||||
| 142 | 0 | my $manifest = OODoc::Manifest->new(filename => $manfile); | |||||||||||||||||||||||||||||||||||||||||
| 143 | |||||||||||||||||||||||||||||||||||||||||||
| 144 | 0 | my $manout; | |||||||||||||||||||||||||||||||||||||||||
| 145 | 0 | ▶ | if(defined $dest) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 146 | 0 | { my $manif = File::Spec->catfile($dest, 'MANIFEST'); | |||||||||||||||||||||||||||||||||||||||||
| 147 | 0 | $manout = OODoc::Manifest->new(filename => $manif); | |||||||||||||||||||||||||||||||||||||||||
| 148 | 0 | $manout->add($manif); | |||||||||||||||||||||||||||||||||||||||||
| 149 | } | ||||||||||||||||||||||||||||||||||||||||||
| 150 | else | ||||||||||||||||||||||||||||||||||||||||||
| 151 | 0 | { $manout = OODoc::Manifest->new(filename => undef); | |||||||||||||||||||||||||||||||||||||||||
| 152 | } | ||||||||||||||||||||||||||||||||||||||||||
| 153 | |||||||||||||||||||||||||||||||||||||||||||
| 154 | 0 | ▶ | my $select = $args{select} || qr/\.(pm|pod)$/; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$args{'select'} || qr/\.(pm|pod)$/
MC/DC0%0/2
$args{'select'} || qr/\.(pm|pod)$/
$args{'select'}
qr/\.(pm|pod)$/
Truth table0%0/3
A || B
A= $args{'select'}B= qr/\.(pm|pod)$/
| |||||||||||||||||||||||||||||||||||||||||||
| 155 | 0 | my ($process, $copy) = $self->selectFiles($select, @$manifest); | |||||||||||||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||||||||||||||
| 157 | 0 | trace @$process." files to process and ".@$copy." files to copy"; | |||||||||||||||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||||||||||||||||
| 159 | # | ||||||||||||||||||||||||||||||||||||||||||
| 160 | # Copy all the files which do not contain pseudo doc | ||||||||||||||||||||||||||||||||||||||||||
| 161 | # | ||||||||||||||||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||||||||||||||||
| 163 | 0 | ▶ | if(defined $dest) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 164 | 0 | { foreach my $filename (@$copy) | |||||||||||||||||||||||||||||||||||||||||
| 165 | 0 | ▶ | { my $fn = defined $source ? File::Spec->catfile($source, $filename) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 166 | : $filename; | ||||||||||||||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||||||||||||||
| 168 | 0 | my $dn = File::Spec->catfile($dest, $fn); | |||||||||||||||||||||||||||||||||||||||||
| 169 | 0 | ▶ | unless(-f $fn) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 170 | 0 | { warning __x"no file {file} to include in the distribution" | |||||||||||||||||||||||||||||||||||||||||
| 171 | , file => $fn; | ||||||||||||||||||||||||||||||||||||||||||
| 172 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||
| 173 | } | ||||||||||||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||||||||||
| 175 | 0 | ▶ | unless(-e $dn && ( -M $dn < -M $fn ) && ( -s $dn == -s $fn )) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
-e $dn and -M $dn < -M $fn and -s $dn == -s $fn
-e $dn and -M $dn < -M $fn
MC/DC0%0/3
-e $dn and -M $dn < -M $fn and -s $dn == -s $fn
-e $dn
-M $dn < -M $fn
-s $dn == -s $fn
Truth table0%0/4
A and B and C
A= -e $dnB= -M $dn < -M $fnC= -s $dn == -s $fn
| |||||||||||||||||||||||||||||||||||||||||||
| 176 | 0 | { $self->mkdirhier(dirname $dn); | |||||||||||||||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||||||||||||||||
| 178 | 0 | ▶ | copy $fn, $dn | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 179 | or fault __x"cannot copy distribution file {from} to {to}" | ||||||||||||||||||||||||||||||||||||||||||
| 180 | , from => $fn, to => $dest; | ||||||||||||||||||||||||||||||||||||||||||
| 181 | |||||||||||||||||||||||||||||||||||||||||||
| 182 | 0 | trace " copied $fn to $dest"; | |||||||||||||||||||||||||||||||||||||||||
| 183 | } | ||||||||||||||||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||||||||||||||||
| 185 | 0 | $manout->add($dn); | |||||||||||||||||||||||||||||||||||||||||
| 186 | } | ||||||||||||||||||||||||||||||||||||||||||
| 187 | } | ||||||||||||||||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||||||||||||||||
| 189 | # | ||||||||||||||||||||||||||||||||||||||||||
| 190 | # Create the parser | ||||||||||||||||||||||||||||||||||||||||||
| 191 | # | ||||||||||||||||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||||||||||||||||
| 193 | 0 | ▶ | my $parser = $args{parser} || 'OODoc::Parser::Markov'; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$args{'parser'} || 'OODoc::Parser::Markov'
MC/DC0%0/1
$args{'parser'} || 'OODoc::Parser::Markov'
$args{'parser'}
Truth table0%0/2
A
A= $args{'parser'}
| |||||||||||||||||||||||||||||||||||||||||||
| 194 | 0 | my $skip_links = delete $args{skip_links}; | |||||||||||||||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||||||||||||||||
| 196 | 0 | ▶ | unless(ref $parser) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 197 | 0 | { eval "require $parser"; | |||||||||||||||||||||||||||||||||||||||||
| 198 | 0 | ▶ | error __x"cannot compile {pkg} class: {err}", pkg => $parser, err => $@ | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 199 | if $@; | ||||||||||||||||||||||||||||||||||||||||||
| 200 | |||||||||||||||||||||||||||||||||||||||||||
| 201 | 0 | ▶ | $parser = $parser->new(skip_links => $skip_links) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 202 | or error __x"parser {name} could not be instantiated", name=>$parser; | ||||||||||||||||||||||||||||||||||||||||||
| 203 | } | ||||||||||||||||||||||||||||||||||||||||||
| 204 | |||||||||||||||||||||||||||||||||||||||||||
| 205 | # | ||||||||||||||||||||||||||||||||||||||||||
| 206 | # Now process the rest | ||||||||||||||||||||||||||||||||||||||||||
| 207 | # | ||||||||||||||||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||||||||||||||||
| 209 | 0 | foreach my $filename (@$process) | |||||||||||||||||||||||||||||||||||||||||
| 210 | 0 | ▶ | { my $fn = $source ? File::Spec->catfile($source, $filename) : $filename; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 211 | |||||||||||||||||||||||||||||||||||||||||||
| 212 | 0 | ▶ | unless(-f $fn) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 213 | 0 | { warning __x"no file {file} to include in the distribution" | |||||||||||||||||||||||||||||||||||||||||
| 214 | , file => $fn; | ||||||||||||||||||||||||||||||||||||||||||
| 215 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||
| 216 | } | ||||||||||||||||||||||||||||||||||||||||||
| 217 | |||||||||||||||||||||||||||||||||||||||||||
| 218 | 0 | my $dn; | |||||||||||||||||||||||||||||||||||||||||
| 219 | 0 | ▶ | if($dest) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 220 | 0 | { $dn = File::Spec->catfile($dest, $fn); | |||||||||||||||||||||||||||||||||||||||||
| 221 | 0 | $self->mkdirhier(dirname $dn); | |||||||||||||||||||||||||||||||||||||||||
| 222 | 0 | $manout->add($dn); | |||||||||||||||||||||||||||||||||||||||||
| 223 | } | ||||||||||||||||||||||||||||||||||||||||||
| 224 | |||||||||||||||||||||||||||||||||||||||||||
| 225 | # do the stripping | ||||||||||||||||||||||||||||||||||||||||||
| 226 | 0 | my @manuals = $parser->parse | |||||||||||||||||||||||||||||||||||||||||
| 227 | ( input => $fn | ||||||||||||||||||||||||||||||||||||||||||
| 228 | , output => $dn | ||||||||||||||||||||||||||||||||||||||||||
| 229 | , distribution => $distr | ||||||||||||||||||||||||||||||||||||||||||
| 230 | , version => $version | ||||||||||||||||||||||||||||||||||||||||||
| 231 | , notice => $notice | ||||||||||||||||||||||||||||||||||||||||||
| 232 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 233 | |||||||||||||||||||||||||||||||||||||||||||
| 234 | 0 | ▶ | trace "stripped $fn into $dn" if defined $dn; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 235 | 0 | trace $_->stats for @manuals; | |||||||||||||||||||||||||||||||||||||||||
| 236 | |||||||||||||||||||||||||||||||||||||||||||
| 237 | 0 | foreach my $man (@manuals) | |||||||||||||||||||||||||||||||||||||||||
| 238 | 0 | ▶ | { $self->addManual($man) if $man->chapters; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 239 | } | ||||||||||||||||||||||||||||||||||||||||||
| 240 | } | ||||||||||||||||||||||||||||||||||||||||||
| 241 | |||||||||||||||||||||||||||||||||||||||||||
| 242 | # Some general subtotals | ||||||||||||||||||||||||||||||||||||||||||
| 243 | 0 | trace $self->stats; | |||||||||||||||||||||||||||||||||||||||||
| 244 | |||||||||||||||||||||||||||||||||||||||||||
| 245 | 0 | $self; | |||||||||||||||||||||||||||||||||||||||||
| 246 | } | ||||||||||||||||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||||||||||||||||
| 248 | #------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||
| 249 | |||||||||||||||||||||||||||||||||||||||||||
| 250 | |||||||||||||||||||||||||||||||||||||||||||
| 251 | sub prepare(@) | ||||||||||||||||||||||||||||||||||||||||||
| 252 | 0 | ▶ | { my ($self, %args) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
prepare: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 253 | |||||||||||||||||||||||||||||||||||||||||||
| 254 | 0 | info "collect package relations"; | |||||||||||||||||||||||||||||||||||||||||
| 255 | 0 | $self->getPackageRelations; | |||||||||||||||||||||||||||||||||||||||||
| 256 | |||||||||||||||||||||||||||||||||||||||||||
| 257 | 0 | info "expand manual contents"; | |||||||||||||||||||||||||||||||||||||||||
| 258 | 0 | foreach my $manual ($self->manuals) | |||||||||||||||||||||||||||||||||||||||||
| 259 | 0 | { trace " expand manual $manual"; | |||||||||||||||||||||||||||||||||||||||||
| 260 | 0 | $manual->expand; | |||||||||||||||||||||||||||||||||||||||||
| 261 | } | ||||||||||||||||||||||||||||||||||||||||||
| 262 | |||||||||||||||||||||||||||||||||||||||||||
| 263 | 0 | info "Create inheritance chapter"; | |||||||||||||||||||||||||||||||||||||||||
| 264 | 0 | foreach my $manual ($self->manuals) | |||||||||||||||||||||||||||||||||||||||||
| 265 | 0 | { trace " create inheritance for $manual"; | |||||||||||||||||||||||||||||||||||||||||
| 266 | 0 | $manual->createInheritance; | |||||||||||||||||||||||||||||||||||||||||
| 267 | } | ||||||||||||||||||||||||||||||||||||||||||
| 268 | |||||||||||||||||||||||||||||||||||||||||||
| 269 | 0 | $self; | |||||||||||||||||||||||||||||||||||||||||
| 270 | } | ||||||||||||||||||||||||||||||||||||||||||
| 271 | |||||||||||||||||||||||||||||||||||||||||||
| 272 | |||||||||||||||||||||||||||||||||||||||||||
| 273 | sub getPackageRelations($) | ||||||||||||||||||||||||||||||||||||||||||
| 274 | 0 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
getPackageRelations: not called CC=16 SCAR=56.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 275 | 0 | my @manuals = $self->manuals; # all | |||||||||||||||||||||||||||||||||||||||||
| 276 | |||||||||||||||||||||||||||||||||||||||||||
| 277 | # | ||||||||||||||||||||||||||||||||||||||||||
| 278 | # load all distributions (which are not loaded yet) | ||||||||||||||||||||||||||||||||||||||||||
| 279 | # | ||||||||||||||||||||||||||||||||||||||||||
| 280 | |||||||||||||||||||||||||||||||||||||||||||
| 281 | 0 | info "compile all packages"; | |||||||||||||||||||||||||||||||||||||||||
| 282 | |||||||||||||||||||||||||||||||||||||||||||
| 283 | 0 | foreach my $manual (@manuals) | |||||||||||||||||||||||||||||||||||||||||
| 284 | 0 | ▶ | { next if $manual->isPurePod; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 285 | 0 | trace " require package $manual"; | |||||||||||||||||||||||||||||||||||||||||
| 286 | |||||||||||||||||||||||||||||||||||||||||||
| 287 | 0 | eval "require $manual"; | |||||||||||||||||||||||||||||||||||||||||
| 288 | 0 | ▶ | warning __x"errors from {manual}: {err}", manual => $manual, err =>$@ | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$@ and not $@ =~ /can't locate/i and not $@ =~ /attempt to reload/i
$@ and not $@ =~ /can't locate/i
MC/DC0%0/3
$@ and not $@ =~ /can't locate/i and not $@ =~ /attempt to reload/i
$@
not $@ =~ /can't locate/i
not $@ =~ /attempt to reload/i
Truth table0%0/4
A and not(B) and not(C)
A= $@B= not $@ =~ /can't locate/iC= not $@ =~ /attempt to reload/i
| |||||||||||||||||||||||||||||||||||||||||||
| 289 | if $@ && $@ !~ /can't locate/i && $@ !~ /attempt to reload/i; | ||||||||||||||||||||||||||||||||||||||||||
| 290 | } | ||||||||||||||||||||||||||||||||||||||||||
| 291 | |||||||||||||||||||||||||||||||||||||||||||
| 292 | 0 | info "detect inheritance relationships"; | |||||||||||||||||||||||||||||||||||||||||
| 293 | |||||||||||||||||||||||||||||||||||||||||||
| 294 | 0 | foreach my $manual (@manuals) | |||||||||||||||||||||||||||||||||||||||||
| 295 | { | ||||||||||||||||||||||||||||||||||||||||||
| 296 | 0 | trace " relations for $manual"; | |||||||||||||||||||||||||||||||||||||||||
| 297 | |||||||||||||||||||||||||||||||||||||||||||
| 298 | 0 | ▶ | if($manual->name ne $manual->package) # autoloaded code | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 299 | 0 | { my $main = $self->mainManual("$manual"); | |||||||||||||||||||||||||||||||||||||||||
| 300 | 0 | ▶ | $main->extraCode($manual) if defined $main; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 301 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||
| 302 | } | ||||||||||||||||||||||||||||||||||||||||||
| 303 | 0 | my %uses = $manual->collectPackageRelations; | |||||||||||||||||||||||||||||||||||||||||
| 304 | |||||||||||||||||||||||||||||||||||||||||||
| 305 | 0 | ▶ | foreach (defined $uses{isa} ? @{$uses{isa}} : ()) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 306 | 0 | ▶ | { my $isa = $self->mainManual($_) || $_; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$self->mainManual($_) || $_
MC/DC0%0/2
$self->mainManual($_) || $_
$self->mainManual($_)
$_
Truth table0%0/3
A || B
A= $self->mainManual($_)B= $_
| |||||||||||||||||||||||||||||||||||||||||||
| 307 | |||||||||||||||||||||||||||||||||||||||||||
| 308 | 0 | $manual->superClasses($isa); | |||||||||||||||||||||||||||||||||||||||||
| 309 | 0 | ▶ | $isa->subClasses($manual) if ref $isa; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 310 | } | ||||||||||||||||||||||||||||||||||||||||||
| 311 | |||||||||||||||||||||||||||||||||||||||||||
| 312 | 0 | ▶ | if(my $realizes = $uses{realizes}) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 313 | 0 | ▶ | { my $to = $self->mainManual($realizes) || $realizes; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$self->mainManual($realizes) || $realizes
MC/DC0%0/2
$self->mainManual($realizes) || $realizes
$self->mainManual($realizes)
$realizes
Truth table0%0/3
A || B
A= $self->mainManual($realizes)B= $realizes
| |||||||||||||||||||||||||||||||||||||||||||
| 314 | |||||||||||||||||||||||||||||||||||||||||||
| 315 | 0 | $manual->realizes($to); | |||||||||||||||||||||||||||||||||||||||||
| 316 | 0 | ▶ | $to->realizers($manual) if ref $to; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 317 | } | ||||||||||||||||||||||||||||||||||||||||||
| 318 | } | ||||||||||||||||||||||||||||||||||||||||||
| 319 | |||||||||||||||||||||||||||||||||||||||||||
| 320 | 0 | $self; | |||||||||||||||||||||||||||||||||||||||||
| 321 | } | ||||||||||||||||||||||||||||||||||||||||||
| 322 | |||||||||||||||||||||||||||||||||||||||||||
| 323 | #------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||
| 324 | |||||||||||||||||||||||||||||||||||||||||||
| 325 | |||||||||||||||||||||||||||||||||||||||||||
| 326 | 1 | our %formatters = | |||||||||||||||||||||||||||||||||||||||||
| 327 | ( pod => 'OODoc::Format::Pod' | ||||||||||||||||||||||||||||||||||||||||||
| 328 | , pod2 => 'OODoc::Format::Pod2' | ||||||||||||||||||||||||||||||||||||||||||
| 329 | , pod3 => 'OODoc::Format::Pod3' | ||||||||||||||||||||||||||||||||||||||||||
| 330 | , html => 'OODoc::Format::Html' | ||||||||||||||||||||||||||||||||||||||||||
| 331 | , html2 => 'OODoc::Format::Html2' | ||||||||||||||||||||||||||||||||||||||||||
| 332 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 333 | |||||||||||||||||||||||||||||||||||||||||||
| 334 | sub create($@) | ||||||||||||||||||||||||||||||||||||||||||
| 335 | 0 | ▶ | { my ($self, $format, %args) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create: not called CC=14 SCAR=53.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 336 | |||||||||||||||||||||||||||||||||||||||||||
| 337 | my $dest = $args{workdir} | ||||||||||||||||||||||||||||||||||||||||||
| 338 | 0 | ▶ | or error __x"create requires a directory to write the manuals to"; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 339 | |||||||||||||||||||||||||||||||||||||||||||
| 340 | # | ||||||||||||||||||||||||||||||||||||||||||
| 341 | # Start manifest | ||||||||||||||||||||||||||||||||||||||||||
| 342 | # | ||||||||||||||||||||||||||||||||||||||||||
| 343 | |||||||||||||||||||||||||||||||||||||||||||
| 344 | my $manfile = exists $args{manifest} ? $args{manifest} | ||||||||||||||||||||||||||||||||||||||||||
| 345 | 0 | ▶ | : File::Spec->catfile($dest, 'MANIFEST'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 346 | 0 | my $manifest = OODoc::Manifest->new(filename => $manfile); | |||||||||||||||||||||||||||||||||||||||||
| 347 | |||||||||||||||||||||||||||||||||||||||||||
| 348 | # Create the formatter | ||||||||||||||||||||||||||||||||||||||||||
| 349 | |||||||||||||||||||||||||||||||||||||||||||
| 350 | 0 | ▶ | unless(ref $format) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 351 | { $format = $formatters{$format} | ||||||||||||||||||||||||||||||||||||||||||
| 352 | 0 | ▶ | if exists $formatters{$format}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 353 | |||||||||||||||||||||||||||||||||||||||||||
| 354 | 0 | eval "require $format"; | |||||||||||||||||||||||||||||||||||||||||
| 355 | 0 | ▶ | error __x"formatter {name} has compilation errors: {err}" | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 356 | , name => $format, err => $@ if $@; | ||||||||||||||||||||||||||||||||||||||||||
| 357 | |||||||||||||||||||||||||||||||||||||||||||
| 358 | 0 | ▶ | my $options = delete $args{format_options} || []; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
delete $args{'format_options'} || []
MC/DC0%0/1
delete $args{'format_options'} || []
delete $args{'format_options'}
Truth table0%0/2
A
A= delete $args{'format_options'}
| |||||||||||||||||||||||||||||||||||||||||||
| 359 | |||||||||||||||||||||||||||||||||||||||||||
| 360 | 0 | $format = $format->new | |||||||||||||||||||||||||||||||||||||||||
| 361 | ( manifest => $manifest | ||||||||||||||||||||||||||||||||||||||||||
| 362 | , workdir => $dest | ||||||||||||||||||||||||||||||||||||||||||
| 363 | , project => $self->distribution | ||||||||||||||||||||||||||||||||||||||||||
| 364 | , version => $self->version | ||||||||||||||||||||||||||||||||||||||||||
| 365 | , @$options | ||||||||||||||||||||||||||||||||||||||||||
| 366 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 367 | } | ||||||||||||||||||||||||||||||||||||||||||
| 368 | |||||||||||||||||||||||||||||||||||||||||||
| 369 | # | ||||||||||||||||||||||||||||||||||||||||||
| 370 | # Create the manual pages | ||||||||||||||||||||||||||||||||||||||||||
| 371 | # | ||||||||||||||||||||||||||||||||||||||||||
| 372 | |||||||||||||||||||||||||||||||||||||||||||
| 373 | 0 | ▶ | my $select = ! defined $args{select} ? sub {1} | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||
| 374 | : ref $args{select} eq 'CODE' ? $args{select} | ||||||||||||||||||||||||||||||||||||||||||
| 375 | 0 | ▶ | : sub { $_[0]->name =~ $args{select}}; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 376 | |||||||||||||||||||||||||||||||||||||||||||
| 377 | 0 | foreach my $package (sort $self->packageNames) | |||||||||||||||||||||||||||||||||||||||||
| 378 | { | ||||||||||||||||||||||||||||||||||||||||||
| 379 | 0 | foreach my $manual ($self->manualsForPackage($package)) | |||||||||||||||||||||||||||||||||||||||||
| 380 | 0 | ▶ | { next unless $select->($manual); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 381 | |||||||||||||||||||||||||||||||||||||||||||
| 382 | 0 | ▶ | unless($manual->chapters) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 383 | 0 | { trace " skipping $manual: no chapters"; | |||||||||||||||||||||||||||||||||||||||||
| 384 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||
| 385 | } | ||||||||||||||||||||||||||||||||||||||||||
| 386 | |||||||||||||||||||||||||||||||||||||||||||
| 387 | 0 | trace " creating manual $manual with ".(ref $format); | |||||||||||||||||||||||||||||||||||||||||
| 388 | |||||||||||||||||||||||||||||||||||||||||||
| 389 | $format->createManual | ||||||||||||||||||||||||||||||||||||||||||
| 390 | ( manual => $manual | ||||||||||||||||||||||||||||||||||||||||||
| 391 | , template => $args{manual_templates} | ||||||||||||||||||||||||||||||||||||||||||
| 392 | , append => $args{append} | ||||||||||||||||||||||||||||||||||||||||||
| 393 | 0 | ▶ | , format_options => ($args{manual_format} || []) | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$args{'manual_format'} || []
MC/DC0%0/1
$args{'manual_format'} || []
$args{'manual_format'}
Truth table0%0/2
A
A= $args{'manual_format'}
| |||||||||||||||||||||||||||||||||||||||||||
| 394 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 395 | } | ||||||||||||||||||||||||||||||||||||||||||
| 396 | } | ||||||||||||||||||||||||||||||||||||||||||
| 397 | |||||||||||||||||||||||||||||||||||||||||||
| 398 | # | ||||||||||||||||||||||||||||||||||||||||||
| 399 | # Create other pages | ||||||||||||||||||||||||||||||||||||||||||
| 400 | # | ||||||||||||||||||||||||||||||||||||||||||
| 401 | |||||||||||||||||||||||||||||||||||||||||||
| 402 | 0 | trace "creating other pages"; | |||||||||||||||||||||||||||||||||||||||||
| 403 | $format->createOtherPages | ||||||||||||||||||||||||||||||||||||||||||
| 404 | ( source => $args{other_templates} | ||||||||||||||||||||||||||||||||||||||||||
| 405 | , process => $args{process_files} | ||||||||||||||||||||||||||||||||||||||||||
| 406 | 0 | ); | |||||||||||||||||||||||||||||||||||||||||
| 407 | |||||||||||||||||||||||||||||||||||||||||||
| 408 | 0 | $format; | |||||||||||||||||||||||||||||||||||||||||
| 409 | } | ||||||||||||||||||||||||||||||||||||||||||
| 410 | |||||||||||||||||||||||||||||||||||||||||||
| 411 | |||||||||||||||||||||||||||||||||||||||||||
| 412 | sub stats() | ||||||||||||||||||||||||||||||||||||||||||
| 413 | 0 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
stats: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 414 | 0 | my @manuals = $self->manuals; | |||||||||||||||||||||||||||||||||||||||||
| 415 | 0 | my $manuals = @manuals; | |||||||||||||||||||||||||||||||||||||||||
| 416 | 0 | my $realpkg = $self->packageNames; | |||||||||||||||||||||||||||||||||||||||||
| 417 | |||||||||||||||||||||||||||||||||||||||||||
| 418 | 0 | my $subs = map {$_->subroutines} @manuals; | |||||||||||||||||||||||||||||||||||||||||
| 419 | 0 | my @options = map { map {$_->options} $_->subroutines } @manuals; | |||||||||||||||||||||||||||||||||||||||||
| 420 | 0 | my $options = @options; | |||||||||||||||||||||||||||||||||||||||||
| 421 | 0 | my $examples = map {$_->examples} @manuals; | |||||||||||||||||||||||||||||||||||||||||
| 422 | |||||||||||||||||||||||||||||||||||||||||||
| 423 | 0 | my $diags = map {$_->diagnostics} @manuals; | |||||||||||||||||||||||||||||||||||||||||
| 424 | 0 | my $distribution = $self->distribution; | |||||||||||||||||||||||||||||||||||||||||
| 425 | 0 | my $version = $self->version; | |||||||||||||||||||||||||||||||||||||||||
| 426 | |||||||||||||||||||||||||||||||||||||||||||
| 427 | 0 | <<STATS; | |||||||||||||||||||||||||||||||||||||||||
| 428 | $distribution version $version | ||||||||||||||||||||||||||||||||||||||||||
| 429 | Number of package manuals: $manuals | ||||||||||||||||||||||||||||||||||||||||||
| 430 | Real number of packages: $realpkg | ||||||||||||||||||||||||||||||||||||||||||
| 431 | documented subroutines: $subs | ||||||||||||||||||||||||||||||||||||||||||
| 432 | documented options: $options | ||||||||||||||||||||||||||||||||||||||||||
| 433 | documented diagnostics: $diags | ||||||||||||||||||||||||||||||||||||||||||
| 434 | shown examples: $examples | ||||||||||||||||||||||||||||||||||||||||||
| 435 | STATS | ||||||||||||||||||||||||||||||||||||||||||
| 436 | } | ||||||||||||||||||||||||||||||||||||||||||
| 437 | |||||||||||||||||||||||||||||||||||||||||||
| 438 | #------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||
| 439 | |||||||||||||||||||||||||||||||||||||||||||
| 440 | |||||||||||||||||||||||||||||||||||||||||||
| 441 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||