| 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))
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))
| |||||||||||||||||||||
| 17 | || catfile( 'lib', split m{ [\-] }mx, "${name}.pm" ); | ||||||||||||||||||||
| 18 | |||||||||||||||||||||
| 19 | 0 | ▶ | $file or die 'No main module specified'; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 20 | 0 | ▶ | -f $file or die "Path ${file} does not exist or not a file"; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 21 | 0 | ▶ | open my $fh, '<', $file or die "File ${file} cannot open: ${OS_ERROR}"; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 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
| |||||||||||||||||||||
| 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__ | ||||||||||||||||||||