| 1 | 6 | ▶ | use v5.14.0; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | 6 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | |||
| 4 | package OS::Package::System; | ||
| 5 | |||
| 6 | # ABSTRACT: Determine OS version and type. | ||
| 7 | 6 | our $VERSION = '0.2.6'; # VERSION | |
| 8 | |||
| 9 | 6 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 6 | ▶ | use Types::Standard qw( Str Enum ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 6 | ▶ | use Config; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | 6 | ▶ | use POSIX qw( uname ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | |||
| 14 | has 'os' => ( | ||
| 15 | is => 'rw', | ||
| 16 | isa => Str, | ||
| 17 | 7 | ▶ | default => sub { return $Config{osname} }, |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 18 | 6 | required => 1 | |
| 19 | ); | ||
| 20 | |||
| 21 | has 'version' => ( | ||
| 22 | is => 'rw', | ||
| 23 | isa => Str, | ||
| 24 | 7 | ▶ | default => sub { my @uname = uname(); return $uname[2] }, |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 25 | 6 | required => 1 | |
| 26 | ); | ||
| 27 | |||
| 28 | has 'type' => ( | ||
| 29 | is => 'rw', | ||
| 30 | isa => Str, | ||
| 31 | 7 | ▶ | default => sub { my @uname = uname(); return $uname[4] }, |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 32 | 6 | required => 1 | |
| 33 | ); | ||
| 34 | |||
| 35 | #has 'bits' => ( is => 'rw', isa => Enum[qw[ 32 64 ]], required => 1 ); | ||
| 36 | |||
| 37 | 6 | 1; | |
| 38 | |||
| 39 | __END__ | ||
| 40 | |||
| 41 | =pod | ||
| 42 | |||
| 43 | =encoding UTF-8 | ||
| 44 | |||
| 45 | =head1 NAME | ||
| 46 | |||
| 47 | OS::Package::System - Determine OS version and type. | ||
| 48 | |||
| 49 | =head1 VERSION | ||
| 50 | |||
| 51 | version 0.2.6 | ||
| 52 | |||
| 53 | =head1 METHODS | ||
| 54 | |||
| 55 | =head2 os | ||
| 56 | |||
| 57 | Host operating system. | ||
| 58 | |||
| 59 | =head2 type | ||
| 60 | |||
| 61 | Host type. | ||
| 62 | |||
| 63 | =head1 AUTHOR | ||
| 64 | |||
| 65 | James F Wilkus <jfwilkus@cpan.org> | ||
| 66 | |||
| 67 | =head1 COPYRIGHT AND LICENSE | ||
| 68 | |||
| 69 | This software is Copyright (c) 2014 by James F Wilkus. | ||
| 70 | |||
| 71 | This is free software, licensed under: | ||
| 72 | |||
| 73 | The (three-clause) BSD License | ||
| 74 | |||
| 75 | =cut | ||