line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
6
|
|
|
6
|
|
15522
|
use v5.14.0; |
|
6
|
|
|
|
|
18
|
|
|
6
|
|
|
|
|
214
|
|
2
|
6
|
|
|
6
|
|
84
|
use warnings; |
|
6
|
|
|
|
|
58
|
|
|
6
|
|
|
|
|
300
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package OS::Package::System; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: Determine OS version and type. |
7
|
|
|
|
|
|
|
our $VERSION = '0.2.7'; # VERSION |
8
|
|
|
|
|
|
|
|
9
|
6
|
|
|
6
|
|
943
|
use Moo; |
|
6
|
|
|
|
|
23945
|
|
|
6
|
|
|
|
|
35
|
|
10
|
6
|
|
|
6
|
|
5566
|
use Types::Standard qw( Str Enum ); |
|
6
|
|
|
|
|
215835
|
|
|
6
|
|
|
|
|
60
|
|
11
|
6
|
|
|
6
|
|
3660
|
use Config; |
|
6
|
|
|
|
|
7
|
|
|
6
|
|
|
|
|
208
|
|
12
|
6
|
|
|
6
|
|
3315
|
use POSIX qw( uname ); |
|
6
|
|
|
|
|
27534
|
|
|
6
|
|
|
|
|
32
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has 'os' => ( |
15
|
|
|
|
|
|
|
is => 'rw', |
16
|
|
|
|
|
|
|
isa => Str, |
17
|
|
|
|
|
|
|
default => sub { return $Config{osname} }, |
18
|
|
|
|
|
|
|
required => 1 |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
has 'version' => ( |
22
|
|
|
|
|
|
|
is => 'rw', |
23
|
|
|
|
|
|
|
isa => Str, |
24
|
|
|
|
|
|
|
default => sub { my @uname = uname(); return $uname[2] }, |
25
|
|
|
|
|
|
|
required => 1 |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
has 'type' => ( |
29
|
|
|
|
|
|
|
is => 'rw', |
30
|
|
|
|
|
|
|
isa => Str, |
31
|
|
|
|
|
|
|
default => sub { my @uname = uname(); return $uname[4] }, |
32
|
|
|
|
|
|
|
required => 1 |
33
|
|
|
|
|
|
|
); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
#has 'bits' => ( is => 'rw', isa => Enum[qw[ 32 64 ]], required => 1 ); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |