« blib/lib/App/Prove/Elasticsearch/Versioner/Default.pm
↑ Summary
blib/lib/App/Prove/Elasticsearch/Harness.pm »
| 1 | # ABSTRACT: Determine the responsible for tests via Changes file for upload to elasticsearch | ||||||||||
| 2 | # PODNAME: App::Prove::Elasticsearch::Blamer::Default | ||||||||||
| 3 | |||||||||||
| 4 | package App::Prove::Elasticsearch::Blamer::Default; | ||||||||||
| 5 | 3 | $App::Prove::Elasticsearch::Blamer::Default::VERSION = '0.001'; | |||||||||
| 6 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 3 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 3 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 3 | ▶ | use File::Basename qw{dirname}; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 3 | ▶ | use Cwd qw{abs_path}; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | 3 | our $party = {}; | |||||||||
| 14 | |||||||||||
| 15 | 4 | ▶ | sub get_responsible_party { | ||||||||
|
Subroutine
get_responsible_party: called CC=6 SCAR=17.9
Pod
documented
| |||||||||||
| 16 | 4 | my $loc = abs_path(dirname(shift) . "/../Changes"); | |||||||||
| 17 | |||||||||||
| 18 | 4 | ▶ | return $party->{$loc} if $party->{$loc}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | 3 | my $ret; | |||||||||
| 20 | 3 | ▶ | open(my $fh, '<', $loc) or die "Could not open $loc"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | 2 | ▶ | while (<$fh>) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | 3 | ($ret) = $_ =~ m/\s*\w*\s*(\w*)$/; | |||||||||
| 23 | 3 | ▶ | last if $ret; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | } | ||||||||||
| 25 | 2 | close $fh; | |||||||||
| 26 | 2 | ▶ | die 'Could not determine the latest version from Changes!' unless $ret; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | 1 | $party->{$loc} = $ret; | |||||||||
| 28 | 1 | return $ret; | |||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | 3 | 1; | |||||||||
| 32 | |||||||||||
| 33 | __END__ | ||||||||||