| 1 | package PLS::Parser::Pod::Package; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | 1 | ▶ | use parent 'PLS::Parser::Pod'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | =head1 NAME | ||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | PLS::Parser::Pod::Package | ||||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | =head1 DESCRIPTION | ||||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | This is a subclass of L<PLS::Parser::Pod>, used to find POD for a package. | ||||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | =cut | ||||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | sub new | ||||||||||||||||||||
| 19 | { | ||||||||||||||||||||
| 20 | 0 | ▶ | my ($class, @args) = @_; | ||||||||||||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | 0 | my %args = @args; | |||||||||||||||||||
| 23 | 0 | my $self = $class->SUPER::new(%args); | |||||||||||||||||||
| 24 | 0 | $self->{package} = $args{package}; | |||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | 0 | return $self; | |||||||||||||||||||
| 27 | } ## end sub new | ||||||||||||||||||||
| 28 | |||||||||||||||||||||
| 29 | sub name | ||||||||||||||||||||
| 30 | { | ||||||||||||||||||||
| 31 | 0 | ▶ | my ($self) = @_; | ||||||||||||||||||
|
Subroutine
name: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | 0 | return $self->{package}; | |||||||||||||||||||
| 34 | } | ||||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | sub find | ||||||||||||||||||||
| 37 | { | ||||||||||||||||||||
| 38 | 0 | ▶ | my ($self) = @_; | ||||||||||||||||||
|
Subroutine
find: not called CC=7 SCAR=40.3
Pod
undocumented
| |||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | 0 | my $definitions = $self->{index}->find_package($self->{package}); | |||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | 0 | ▶ | if (ref $definitions eq 'ARRAY' and scalar @$definitions) | ||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
ref $definitions eq "ARRAY" and scalar @$definitions
MC/DC0%0/1
ref $definitions eq "ARRAY" and scalar @$definitions
ref $definitions eq "ARRAY"
Truth table0%0/2
A
A= ref $definitions eq "ARRAY"
| |||||||||||||||||||||
| 43 | { | ||||||||||||||||||||
| 44 | 0 | foreach my $definition (@$definitions) | |||||||||||||||||||
| 45 | { | ||||||||||||||||||||
| 46 | 0 | my $path = URI->new($definition->{uri})->file; | |||||||||||||||||||
| 47 | 0 | ▶ | open my $fh, '<', $path or next; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 48 | 0 | my $text = do { local $/; <$fh> }; | |||||||||||||||||||
| 49 | 0 | my ($ok, $markdown) = $self->get_markdown_from_text(\$text); | |||||||||||||||||||
| 50 | |||||||||||||||||||||
| 51 | 0 | ▶ | if ($ok) | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 52 | { | ||||||||||||||||||||
| 53 | 0 | $self->{markdown} = $markdown; | |||||||||||||||||||
| 54 | 0 | return 1; | |||||||||||||||||||
| 55 | } | ||||||||||||||||||||
| 56 | } ## end foreach my $definition (@$definitions...) | ||||||||||||||||||||
| 57 | } ## end if (ref $definitions eq...) | ||||||||||||||||||||
| 58 | |||||||||||||||||||||
| 59 | 0 | my ($ok, $markdown) = $self->get_markdown_for_package($self->{package}); | |||||||||||||||||||
| 60 | 0 | ▶ | $self->{markdown} = $markdown if $ok; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 61 | |||||||||||||||||||||
| 62 | 0 | return $ok; | |||||||||||||||||||
| 63 | } ## end sub find | ||||||||||||||||||||
| 64 | |||||||||||||||||||||
| 65 | 1 | 1; | |||||||||||||||||||