Plugin/SurgicalPkgVersion.pm untested

filter: Statementstmt 0.0% 0 / 26 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 44 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Dist::Zilla::Plugin::SurgicalPkgVersion;
2 BEGIN {
3 $Dist::Zilla::Plugin::SurgicalPkgVersion::VERSION = '0.0019';
4 }
5 # ABSTRACT: Surgically apply PkgVersion
6  
7  
8 use Moose;
9 extends qw/ Dist::Zilla::Plugin::PkgVersion /;
10  
11 require Dist::Zilla::PluginBundle::ROKR;
12  
13 around munge_perl => sub {
14 my $inner = shift;
15 my ( $self, $file ) = @_;
16  
17 my $content = $file->content;
18  
19 my $yes = 0;
20 if ( my $hint = Dist::Zilla::PluginBundle::ROKR->parse_hint( $content ) ) {
21 if ( exists $hint->{PkgVersion} ) {
22 return unless $hint->{PkgVersion};
23 $yes = 1;
24 }
25 }
26  
27 if ( $yes || $content =~ m/^\s*#+\s*(?:ABSTRACT):\s*(.+)$/m ) { }
28 else { return }
29  
30 return $inner->( @_ )
31 };
32  
33 __PACKAGE__->meta->make_immutable;
34 no Moose;
35 1;
36  
37 __END__