| 1 | # ABSTRACT: Determine the version of a system under test via git for upload to elasticsearch | ||
| 2 | # PODNAME: App::Prove::Elasticsearch::Versioner::Git | ||
| 3 | |||
| 4 | package App::Prove::Elasticsearch::Versioner::Git; | ||
| 5 | 2 | $App::Prove::Elasticsearch::Versioner::Git::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 | 2 | ▶ | use utf8; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 2 | ▶ | use Git; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 1 | ▶ | sub get_version { |
|
Subroutine
get_version: called CC=1 SCAR=0.0
Pod
documented
| |||
| 13 | 1 | my $out = Git::command_oneline('log', '--format=format:%H'); | |
| 14 | 1 | my @shas = split(/\n/, $out); | |
| 15 | 1 | return shift(@shas); | |
| 16 | } | ||
| 17 | |||
| 18 | 1 | ▶ | sub get_file_version { |
|
Subroutine
get_file_version: called CC=1 SCAR=0.0
Pod
documented
| |||
| 19 | 1 | my $input = shift; | |
| 20 | 1 | my $out = | |
| 21 | Git::command_oneline('log', '--format=format:%H', '--follow', $input); | ||
| 22 | 1 | my @shas = split(/\n/, $out); | |
| 23 | 1 | return shift(@shas); | |
| 24 | } | ||
| 25 | |||
| 26 | 2 | 1; | |
| 27 | |||
| 28 | __END__ | ||