lib/Dist/Zilla/Plugin/AbstractFromPOD.pm

filter: Statementstmt 56.7% 21 / 37 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 85.7% 6 / 7 Podpod 100% 1 / 1 totaltotal 48.2% 28 / 58 CC 6 SCAR 30.7
CC
6
Cov
44%
before_build
42.0
BEGIN
1.0
BEGIN
1.0
CRAP 21.5
↑ Summary
1 package Dist::Zilla::Plugin::AbstractFromPOD;
2  
3 1 ▶use 5.008;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use version; our $VERSION = qv( sprintf '0.3.%d', q$Rev: 1 $ =~ /\d+/gmx );
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use English qw( -no_match_vars );
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use File::Spec::Functions qw( catfile );
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 with 'Dist::Zilla::Role::BeforeBuild';
11  
12 0 ▶sub before_build {
Subroutine before_build: not called CC=6 SCAR=37.4
Pod documented
13 0 my $self = shift;
14 0 my $name = $self->zilla->name;
15 0 my $class = $name; $class =~ s{ [\-] }{::}gmx;
16 0 ▶ my $file = $self->zilla->_main_module_override
Condition0%0/3
$self->zilla->_main_module_override || catfile('lib', split(/ [\-] /mx, "$name.pm", 0))
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->zilla->_main_module_override || catfile('lib', split(/ [\-] /mx, "$name.pm", 0))
$self->zilla->_main_module_override catfile('lib', split(/ [\-] /mx, "$name.pm", 0))
Truth table0%0/3
A || B
A= $self->zilla->_main_module_overrideB= catfile('lib', split(/ [\-] /mx, "$name.pm", 0))
ABresult
1X1
011
000
17 || catfile( 'lib', split m{ [\-] }mx, "${name}.pm" );
18  
19 0 ▶ $file or die 'No main module specified';
Branch: 1 branch
BranchTrueFalseTotal
$file or die "No main module specified" 0 0 0
20 0 ▶ -f $file or die "Path ${file} does not exist or not a file";
Branch: 1 branch
BranchTrueFalseTotal
-f $file or die "Path $file does not exist or not a file" 0 0 0
21 0 ▶ open my $fh, '<', $file or die "File ${file} cannot open: ${OS_ERROR}";
Branch: 1 branch
BranchTrueFalseTotal
open my $fh, "<", $file or die "File $file cannot open: $Dist::Zilla::Plugin::AbstractFromPOD::OS_ERROR" 0 0 0
22  
23 0 my $content = do { local $RS; <$fh> }; $fh->close;
24 0 my ($abstract) = $content
25 =~ m{ =head1 \s+ Name \s* [\n] \s* $class \s* [\-] \s* ([^\n]+) }imsx;
26  
27 0 ▶ $abstract or die "File ${file} contains no abstract";
Branch: 1 branch
BranchTrueFalseTotal
$abstract or die "File $file contains no abstract" 0 0 0
28 0 $self->zilla->abstract( $abstract );
29 0 return;
30 }
31  
32 1 __PACKAGE__->meta->make_immutable;
33  
34 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
35  
36 1 1;
37  
38 __END__
↑ Summary