API/BuildInfo.pm untested

filter: Statementstmt 0.0% 0 / 36 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 9 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 56 CC 3 SCAR 15.5
CC
3
Cov
0%
version
12.0
botocore_version
2.0
BEGIN
2.0
CRAP 4.7
1 package Amazon::API::BuildInfo;
2  
3 use strict;
4 use warnings;
5  
6 use Carp;
7 use Amazon::API::Utils qw(slurp_json);
8 use English qw(-no_match_vars);
9  
10 use File::ShareDir qw(dist_file);
11 use JSON;
12  
13 our $GIT_SHA = 'a579e96d3cea75fae728b31a50a98530f1c274a4';
14 our $GIT_DIRTY = 'a579e96d3cea75fae728b31a50a98530f1c274a4';
15 our $VERSION = '2.8.2';
16  
17 ########################################################################
18 sub version {
19 ########################################################################
20 my ($self) = @_;
21  
22 my $botocore_version_file = eval {
23 return 'botocore-version.json'
24 if -e 'botocore-version.json';
25  
26 return dist_file( 'Amazon-API', 'botocore-version.json' );
27 };
28  
29 croak "ERROR: could not read botocore-version.json\n$EVAL_ERROR"
30 if !$botocore_version_file || $EVAL_ERROR;
31  
32 my $botocore_version = slurp_json($botocore_version_file);
33  
34 return { commit => $GIT_SHA, version => $VERSION, dirty => $GIT_DIRTY, botocore_version => $botocore_version };
35 }
36  
37 ########################################################################
38 sub botocore_version {
39 ########################################################################
40 my ($self) = @_;
41  
42 my $version = $self->version();
43  
44 return @{ $version->{botocore_version} }{qw(version commit)};
45 }
46  
47 1;
48  
49 __END__