line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
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
|
|
|
|
|
|
|
$App::Prove::Elasticsearch::Indexer::MMDist::VERSION = '0.001'; |
6
|
1
|
|
|
1
|
|
1445
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
7
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
28
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
334
|
use parent qw{App::Prove::Elasticsearch::Indexer}; |
|
1
|
|
|
|
|
238
|
|
|
1
|
|
|
|
|
4
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $index = __CLASS__->SUPER::index; |
12
|
|
|
|
|
|
|
our $dfile //= 'Makefile.PL'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
if (open(my $dh, '<', $dfile)) { |
15
|
|
|
|
|
|
|
; |
16
|
|
|
|
|
|
|
while (<$dh>) { |
17
|
|
|
|
|
|
|
($index) = $_ =~ /DISTNAME.*\s*?=>\s*?["|'](.*)["|'],?/; |
18
|
|
|
|
|
|
|
if ($index) { |
19
|
|
|
|
|
|
|
$index =~ s/^\s+//; |
20
|
|
|
|
|
|
|
last; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
close $dh; |
24
|
|
|
|
|
|
|
} else { |
25
|
|
|
|
|
|
|
print |
26
|
|
|
|
|
|
|
"# WARNING: Could not open $dfile, falling back to index name '$index'\n"; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
__END__ |