| 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::Object; | ||||||||||||||||||||||||||||
| 7 | 2 | ▶ | use vars '$VERSION'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 2 | $VERSION = '2.01'; | |||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 2 | ▶ | use Log::Report 'oodoc'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | sub new(@) | ||||||||||||||||||||||||||||
| 18 | 0 | ▶ | { my $class = shift; | ||||||||||||||||||||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 0 | my %args = @_; | |||||||||||||||||||||||||||
| 21 | 0 | my $self = (bless {}, $class)->init(\%args); | |||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 0 | ▶ | if(my @missing = keys %args) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 24 | 0 | { error __xn"unknown option {options}", "unknown options {options}" | |||||||||||||||||||||||||||
| 25 | , scalar @missing, options => @missing; | ||||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 0 | $self; | |||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | sub init($) | ||||||||||||||||||||||||||||
| 32 | 0 | ▶ | { my ($self, $args) = @_; | ||||||||||||||||||||||||||
|
Subroutine
init: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 33 | 0 | $self->{OO_extends} = []; | |||||||||||||||||||||||||||
| 34 | 0 | $self; | |||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | #------------------------------------------- | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | sub extends(;$) | ||||||||||||||||||||||||||||
| 41 | 0 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
extends: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 42 | 0 | my $ext = $self->{OO_extends}; | |||||||||||||||||||||||||||
| 43 | 0 | push @$ext, @_; | |||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | 0 | ▶ | wantarray ? @$ext : $ext->[0]; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | #------------------------------------------- | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | sub mkdirhier($) | ||||||||||||||||||||||||||||
| 52 | 0 | ▶ | { my $thing = shift; | ||||||||||||||||||||||||||
|
Subroutine
mkdirhier: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||
| 53 | 0 | my @dirs = File::Spec->splitdir(shift); | |||||||||||||||||||||||||||
| 54 | 0 | ▶ | my $path = $dirs[0] eq '' ? shift @dirs : '.'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | 0 | ▶ | while(@dirs) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 57 | 0 | { $path = File::Spec->catdir($path, shift @dirs); | |||||||||||||||||||||||||||
| 58 | 0 | ▶ | -d $path || mkdir $path | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
-d $path or mkdir $path
MC/DC0%0/2
-d $path or mkdir $path
-d $path
mkdir $path
Truth table0%0/3
A or B
A= -d $pathB= mkdir $path
| |||||||||||||||||||||||||||||
| 59 | or fault __x"cannot create {dir}", dir => $path; | ||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | 0 | $thing; | |||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | sub filenameToPackage($) | ||||||||||||||||||||||||||||
| 67 | 0 | ▶ | { my ($thing, $package) = @_; | ||||||||||||||||||||||||||
|
Subroutine
filenameToPackage: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 68 | 0 | $package =~ s!^lib/!!; | |||||||||||||||||||||||||||
| 69 | 0 | $package =~ s#/#::#g; | |||||||||||||||||||||||||||
| 70 | 0 | $package =~ s/\.(pm|pod)$//g; | |||||||||||||||||||||||||||
| 71 | 0 | $package; | |||||||||||||||||||||||||||
| 72 | } | ||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||
| 74 | #------------------------------------------- | ||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||
| 77 | 2 | my %packages; | |||||||||||||||||||||||||||
| 78 | my %manuals; | ||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||
| 80 | sub addManual($) | ||||||||||||||||||||||||||||
| 81 | 0 | ▶ | { my ($self, $manual) = @_; | ||||||||||||||||||||||||||
|
Subroutine
addManual: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||
| 83 | 0 | ▶ | ref $manual && $manual->isa('OODoc::Manual') | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
ref $manual and $manual->isa("OODoc::Manual")
MC/DC0%0/2
ref $manual and $manual->isa("OODoc::Manual")
ref $manual
$manual->isa("OODoc::Manual")
Truth table0%0/3
A and B
A= ref $manualB= $manual->isa("OODoc::Manual")
| |||||||||||||||||||||||||||||
| 84 | or panic "manual definition requires manual object"; | ||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||
| 86 | 0 | push @{$packages{$manual->package}}, $manual; | |||||||||||||||||||||||||||
| 87 | 0 | $manuals{$manual->name} = $manual; | |||||||||||||||||||||||||||
| 88 | 0 | $self; | |||||||||||||||||||||||||||
| 89 | } | ||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||
| 92 | sub mainManual($) | ||||||||||||||||||||||||||||
| 93 | 0 | ▶ | { my ($self, $name) = @_; | ||||||||||||||||||||||||||
|
Subroutine
mainManual: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 94 | 0 | (grep {$_ eq $_->package} $self->manualsForPackage($name))[0]; | |||||||||||||||||||||||||||
| 95 | } | ||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||
| 98 | sub manualsForPackage($) | ||||||||||||||||||||||||||||
| 99 | 0 | ▶ | { my ($self,$name) = @_; | ||||||||||||||||||||||||||
|
Subroutine
manualsForPackage: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 100 | 0 | ▶ | $name ||= 'doc'; | ||||||||||||||||||||||||||
|
Condition0%0/2
$name ||= "doc"
MC/DC0%0/1
$name ||= "doc"
$name
Truth table0%0/2
A
A= $name
| |||||||||||||||||||||||||||||
| 101 | 0 | ▶ | defined $packages{$name} ? @{$packages{$name}} : (); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 102 | } | ||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||
| 105 | 0 | ▶ | sub manuals() { values %manuals } | ||||||||||||||||||||||||||
|
Subroutine
manuals: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||
| 108 | 0 | ▶ | sub manual($) { $manuals{ $_[1] } } | ||||||||||||||||||||||||||
|
Subroutine
manual: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||
| 111 | 0 | ▶ | sub packageNames() { keys %packages } | ||||||||||||||||||||||||||
|
Subroutine
packageNames: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||
| 113 | 2 | 1; | |||||||||||||||||||||||||||