NetApp/Filer/Version.pm

filter: Statementstmt 100% 40 / 40 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 1 totaltotal 96.0% 49 / 51 CC 2 SCAR 2.0
CC
2
Cov
98%
BUILD
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« NetApp/Aggregate/RAIDGroup.pm ↑ Summary NetApp/Filer/License.pm »
1  
2 package NetApp::Filer::Version;
3  
4 7 our $VERSION = '500.002';
5 7 $VERSION = eval $VERSION; ## no critic: StringyEval
6  
7 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 7 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 7 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 7 ▶use Class::Std;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 7 ▶use Params::Validate qw( :all );
Subroutine BEGIN: called CC=1 SCAR=0.0
13 7 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 7 ▶use overload '""' => 'get_string';
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 {
18  
19 7 my %string_of :ATTR( get => 'string' );
20  
21 7 my %release_of :ATTR( get => 'release' );
22  
23 7 my %major_of :ATTR( get => 'major' );
24 7 my %minor_of :ATTR( get => 'minor' );
25 7 my %subminor_of :ATTR( get => 'subminor' );
26 7 my %patchlevel_of :ATTR( get => 'patchlevel' );
27  
28 7 my %date_of :ATTR( get => 'date' );
29  
30 3 ▶ sub BUILD {
Subroutine BUILD: called CC=2 SCAR=7.0
Pod undocumented
31  
32 3 my ($self,$ident,$args_ref) = @_;
33  
34 3 my @args = %$args_ref;
35  
36 3 my (%args) = validate( @args, {
37 string => { type => SCALAR },
38 });
39  
40 3 $string_of{$ident} = $args{string};
41  
42 $args{string} =~
43 3 ▶ m{ NetApp \s+ Release \s+ (\S+) : \s+ (.*) }gmx ||
Branch: 1 branch
BranchTrueFalseTotal
$args{"string"} =~ / NetApp \s+ Release \s+ (\S+) : \s+ (.*) /gmx or croak(qq[Invalid version string: $args{"string"}\n]) 3 0 3
44 croak ("Invalid version string: $args{string}\n");
45  
46 3 $release_of{$ident} = $1;
47 3 $date_of{$ident} = $2;
48  
49 ( $major_of{$ident}, $minor_of{$ident},
50 $subminor_of{$ident}, $patchlevel_of{$ident} ) =
51 3 split( /[\.L]+/, $release_of{$ident} );
52  
53 }
54  
55 }
56  
57 7 1;
« NetApp/Aggregate/RAIDGroup.pm ↑ Summary NetApp/Filer/License.pm »