« blib/lib/App/Prove/Elasticsearch/Blamer/System.pm
↑ Summary
blib/lib/App/Prove/Elasticsearch/Indexer/DzilDist.pm »
| 1 | # ABSTRACT: Names your elasticsearch index after your distribution as defined in Makefile.PL | ||||||||||||
| 2 | # PODNAME: App::Prove::Elasticsearch::Indexer::MMDist | ||||||||||||
| 3 | |||||||||||||
| 4 | package App::Prove::Elasticsearch::Indexer::MMDist; | ||||||||||||
| 5 | 2 | $App::Prove::Elasticsearch::Indexer::MMDist::VERSION = '0.001'; | |||||||||||
| 6 | 2 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | 2 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | |||||||||||||
| 9 | 2 | ▶ | use parent qw{App::Prove::Elasticsearch::Indexer}; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 10 | |||||||||||||
| 11 | 2 | our $index = __CLASS__->SUPER::index; | |||||||||||
| 12 | 2 | ▶ | our $dfile //= 'Makefile.PL'; | ||||||||||
|
Condition100%2/2
our $dfile //= "Makefile.PL"
MC/DC100%1/1
our $dfile //= "Makefile.PL"
our $dfile
Truth table100%2/2
A
A= our $dfile
| |||||||||||||
| 13 | |||||||||||||
| 14 | 2 | ▶ | if (open(my $dh, '<', $dfile)) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 15 | ; | ||||||||||||
| 16 | 2 | ▶ | while (<$dh>) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 17 | 30 | ($index) = $_ =~ /DISTNAME.*\s*?=>\s*?["|'](.*)["|'],?/; | |||||||||||
| 18 | 30 | ▶ | if ($index) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 19 | 2 | $index =~ s/^\s+//; | |||||||||||
| 20 | 2 | last; | |||||||||||
| 21 | } | ||||||||||||
| 22 | } | ||||||||||||
| 23 | 2 | close $dh; | |||||||||||
| 24 | } else { | ||||||||||||
| 25 | 0 | ||||||||||||
| 26 | "# WARNING: Could not open $dfile, falling back to index name '$index'\n"; | ||||||||||||
| 27 | } | ||||||||||||
| 28 | |||||||||||||
| 29 | 2 | 1; | |||||||||||
| 30 | |||||||||||||
| 31 | __END__ | ||||||||||||