HTMLEmbed.pm

filter: Statementstmt 88.2% 30 / 34 Branchbran 33.3% 2 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 2 / 2 totaltotal 83.6% 41 / 49 CC 4 SCAR 9.8
CC
4
Cov
80%
find
5.2
BEGIN
1.0
BEGIN
1.0
CRAP 2.7
« HTMLEmbed/Entry.pm ↑ Summary
1 package Pod::HTMLEmbed;
2 4 ▶use Any::Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 4 our $VERSION = '0.04';
5  
6 4 ▶use Carp::Clan '^(Mo[ou]se::|Pod::HTMLEmbed(::)?)';
Subroutine BEGIN: called CC=1 SCAR=0.0
7 4 ▶use Pod::Simple::Search;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 4 ▶use Pod::HTMLEmbed::Entry;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 4 has search_dir => (
11 is => 'rw',
12 isa => 'ArrayRef',
13 predicate => 'has_search_dir',
14 );
15  
16 4 has url_prefix => (
17 is => 'rw',
18 isa => 'Str',
19 predicate => 'has_url_prefix',
20 );
21  
22 4 ▶no Any::Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
23  
24 3 ▶sub load {
Subroutine load: called CC=1 SCAR=0.0
Pod documented
25 3 my ($self, $file) = @_;
26 3 Pod::HTMLEmbed::Entry->new( file => $file, _context => $self );
27 }
28  
29 2 ▶sub find {
Subroutine find: called CC=4 SCAR=16.5
Pod documented
30 2 my ($self, $name) = @_;
31  
32 2 my $file;
33 2 my $finder = Pod::Simple::Search->new;
34  
35 2 ▶ if ($self->has_search_dir) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->has_search_dir) { } 2 0 2
36 2 $finder->inc(0);
37 2 $file = $finder->find( $name, @{ $self->search_dir } );
38 }
39 else {
40 0 $file = $finder->find( $name );
41 }
42  
43 2 ▶ unless ($file) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($file) 0 2 2
44 my $dirs = join ':', $self->has_search_dir ?
45 0 ▶ (@{ $self->search_dir }) : (@INC);
Branch: 1 branch
BranchTrueFalseTotal
$self->has_search_dir ? : 0 0 0
46  
47 0 croak qq[No pod found by name "$name" in $dirs];
48 }
49  
50 2 $self->load($file);
51 }
52  
53 4 __PACKAGE__->meta->make_immutable;
54  
55 __END__
« HTMLEmbed/Entry.pm ↑ Summary