« blib/lib/App/RecordStream/Operation/fromapache.pm
↑ Summary
blib/lib/App/RecordStream/Operation/toptable.pm »
| 1 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||||||
| 4 | package App::RecordStream::Operation::help::FromManual; | ||||||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use base qw(App::RecordStream::Operation::help); | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use Pod::Perldoc; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use File::Temp qw< tempfile >; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 9 | 1 | ▶ | use Scalar::Util qw< blessed >; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||
| 11 | 0 | ▶ | sub init_help {} | ||||||||||||||||||||||||||||||
|
Subroutine
init_help: not called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 12 | 0 | ▶ | sub init { | ||||||||||||||||||||||||||||||
|
Subroutine
init: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 13 | 0 | my $this = shift; | |||||||||||||||||||||||||||||||
| 14 | 0 | local @ARGV = ('-F', $this->pod_file); | |||||||||||||||||||||||||||||||
| 15 | 0 | Pod::Perldoc->run(); | |||||||||||||||||||||||||||||||
| 16 | } | ||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||
| 18 | 0 | ▶ | sub pod_file { | ||||||||||||||||||||||||||||||
|
Subroutine
pod_file: not called CC=8 SCAR=42.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 19 | 0 | my $this = shift; | |||||||||||||||||||||||||||||||
| 20 | 0 | my ($class, $pm) = $this->manual_class; | |||||||||||||||||||||||||||||||
| 21 | 0 | my $source = $INC{$pm}; | |||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||
| 23 | # Simple case: manual class is on disk already | ||||||||||||||||||||||||||||||||
| 24 | 0 | ▶ | if (not ref $source and -e $source) { | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/3
not ref $source and -e $source
MC/DC0%0/2
not ref $source and -e $source
not ref $source
-e $source
Truth table0%0/3
not(A) and B
A= not ref $sourceB= -e $source
| |||||||||||||||||||||||||||||||||
| 25 | 0 | return $source; | |||||||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||||||
| 27 | # Fatpacked: read from the @INC hook | ||||||||||||||||||||||||||||||||
| 28 | ▶ | elsif (ref $source and blessed($source) =~ /^FatPacked::/) { | |||||||||||||||||||||||||||||||
|
Condition0%0/3
ref $source and builtin::blessed($source) =~ /^FatPacked::/
MC/DC0%0/2
ref $source and builtin::blessed($source) =~ /^FatPacked::/
ref $source
builtin::blessed($source) =~ /^FatPacked::/
Truth table0%0/3
A and B
A= ref $sourceB= builtin::blessed($source) =~ /^FatPacked::/
| |||||||||||||||||||||||||||||||||
| 29 | 0 | ▶ | my $source_fh = $source->INC($pm) | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 30 | or die "FatPacked INC entry failed?!"; | ||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||
| 32 | 0 | my ($tmp, $tmpfile) = tempfile( UNLINK => 1, TMPDIR => 1, SUFFIX => '.pm' ); | |||||||||||||||||||||||||||||||
| 33 | 0 | ▶ | print { $tmp } $_ while <$source_fh>; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 34 | 0 | ▶ | close $tmp | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 35 | or die "failed to close tempfile $tmpfile after writing: $!"; | ||||||||||||||||||||||||||||||||
| 36 | 0 | return $tmpfile; | |||||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||||||
| 38 | else { | ||||||||||||||||||||||||||||||||
| 39 | 0 | die "Don't know how to read source of $class where \$INC{$pm} = $source"; | |||||||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||
| 43 | 0 | ▶ | sub manual_class { | ||||||||||||||||||||||||||||||
|
Subroutine
manual_class: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 44 | 0 | my $this = shift; | |||||||||||||||||||||||||||||||
| 45 | 0 | my $page = (split /::/, ref $this)[-1]; | |||||||||||||||||||||||||||||||
| 46 | 0 | my $class = "App::RecordStream::Manual::\u$page"; | |||||||||||||||||||||||||||||||
| 47 | 0 | my $pm = "$class.pm"; | |||||||||||||||||||||||||||||||
| 48 | 0 | $pm =~ s{::}{/}g; | |||||||||||||||||||||||||||||||
| 49 | 0 | ▶ | require $pm | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 50 | or die "Can't locate manual class $class: $!"; | ||||||||||||||||||||||||||||||||
| 51 | 0 | ▶ | return wantarray ? ($class, $pm) : $class; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||
| 54 | 1 | 1; | |||||||||||||||||||||||||||||||