File Coverage

blib/lib/Sys/Info/Driver/Linux/Constants.pm
Criterion Covered Total %
statement 42 42 100.0
branch n/a
condition n/a
subroutine 14 14 100.0
pod n/a
total 56 56 100.0


line stmt bran cond sub pod time code
1             package Sys::Info::Driver::Linux::Constants;
2             $Sys::Info::Driver::Linux::Constants::VERSION = '0.7905';
3 2     2   31 use strict;
  2         4  
  2         47  
4 2     2   8 use warnings;
  2         4  
  2         46  
5 2     2   9 use base qw( Exporter );
  2         4  
  2         166  
6              
7             # uptime
8 2     2   14 use constant UP_TIME => 0;
  2         3  
  2         86  
9 2     2   8 use constant IDLE_TIME => 1;
  2         4  
  2         93  
10              
11             # fstab entries
12 2     2   11 use constant FS_SPECIFIER => 0;
  2         3  
  2         77  
13 2     2   9 use constant MOUNT_POINT => 1;
  2         4  
  2         79  
14 2     2   9 use constant FS_TYPE => 2;
  2         22  
  2         89  
15 2     2   11 use constant MOUNT_OPTS => 3;
  2         4  
  2         77  
16 2     2   10 use constant DUMP_FREQ => 4;
  2         3  
  2         74  
17 2     2   10 use constant FS_CHECK_ORDER => 5;
  2         3  
  2         64  
18              
19             # getpwnam()
20 2     2   9 use constant REAL_NAME_FIELD => 6;
  2         15  
  2         146  
21              
22             # format: 'Linux version 1.2.3 (foo@bar.com)'
23             # format: 'Linux version 1.2.3 (foo@bar.com) (gcc 1.2.3)'
24             # format: 'Linux version 1.2.3 (foo@bar.com) (gcc 1.2.3 (Redhat blah blah))'
25 2         186 use constant RE_LINUX_VERSION => qr{
26             \A
27             Linux \s+ version \s
28             (.+?)
29             \s
30             [(] .+? \@ .+? [)]
31             (.*?)
32             \z
33 2     2   12 }xmsi;
  2         4  
34              
35             # format: 'linux foo.domain.bar 1.2.3-foo'
36 2         261 use constant RE_LINUX_VERSION2 => qr{
37             \A
38             linux \s+ [a-zA-Z0-9.]+ \s+
39             ([a-zA-Z0-9.]+)?
40 2     2   19 }xmsi;
  2         3  
41              
42             our %EXPORT_TAGS = (
43             uptime => [qw/
44             UP_TIME
45             IDLE_TIME
46             /],
47             fstab => [qw/
48             FS_SPECIFIER
49             MOUNT_POINT
50             FS_TYPE
51             MOUNT_OPTS
52             DUMP_FREQ
53             FS_CHECK_ORDER
54             /],
55             user => [qw/
56             REAL_NAME_FIELD
57             /],
58             general => [qw/
59             RE_LINUX_VERSION
60             RE_LINUX_VERSION2
61             /],
62             );
63              
64             our @EXPORT_OK = map { @{ $_ } } values %EXPORT_TAGS;
65             $EXPORT_TAGS{all} = \@EXPORT_OK;
66              
67             1;
68              
69             __END__
70              
71             =pod
72              
73             =encoding UTF-8
74              
75             =head1 NAME
76              
77             Sys::Info::Driver::Linux::Constants
78              
79             =head1 VERSION
80              
81             version 0.7905
82              
83             =head1 SYNOPSIS
84              
85             =head1 DESCRIPTION
86              
87             Constants for Linux driver.
88              
89             =head1 NAME
90              
91             Sys::Info::Driver::Linux::Constants - Constants for Linux driver
92              
93             =head1 METHODS
94              
95             None.
96              
97             =head1 AUTHOR
98              
99             Burak Gursoy <burak@cpan.org>
100              
101             =head1 COPYRIGHT AND LICENSE
102              
103             This software is copyright (c) 2006 by Burak Gursoy.
104              
105             This is free software; you can redistribute it and/or modify it under
106             the same terms as the Perl 5 programming language system itself.
107              
108             =cut