Info/BeOS.pm

filter: Statementstmt 36.3% 12 / 33 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 3 / 6 Podpod 100% 2 / 2 totaltotal 36.1% 17 / 47 CC 6 SCAR 31.6
CC
6
Cov
31%
get_info
42.0
new
2.0
_beos_versions
2.0
CRAP 23.5
« Info/SCO.pm ↑ Summary Info/Linux.pm »
1 package Devel::Platform::Info::BeOS;
2  
3 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 4 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 4 $VERSION = '1.00';
8  
9 #----------------------------------------------------------------------------
10  
11 4 my %commands = (
12 '_uname1' => 'uname -a',
13 '_uname2' => 'uname -mrr',
14 'kname' => 'uname -s',
15 'kvers' => 'uname -r',
16 'osname' => 'uname -o',
17 'archname' => 'uname -m',
18 );
19  
20 #----------------------------------------------------------------------------
21  
22 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
23 0 my ($class) = @_;
24 0 my $self = {};
25 0 bless $self, $class;
26  
27 0 return $self;
28 }
29  
30 0 ▶sub get_info {
Subroutine get_info: not called CC=6 SCAR=37.4
Pod documented
31 0 my $self = shift;
32  
33 0 for my $cmd (keys %commands) {
34 0 $self->{cmds}{$cmd} = `$commands{$cmd} 2>/dev/null`;
35 0 $self->{cmds}{$cmd} =~ s/\s+$//s;
36 0 ▶ $self->{info}{$cmd} = $self->{cmds}{$cmd} if($cmd !~ /^_/);
Branch: 1 branch
BranchTrueFalseTotal
unless $cmd =~ /^_/ 0 0 0
37 }
38  
39 0 $self->{info}{osflag} = $^O;
40 0 $self->{info}{kvers} = lc $self->{info}{kvers};
41 0 $self->{info}{kernel} = lc($self->{info}{kname}) . '-' . $self->{info}{kvers};
42 0 $self->{info}{osname} = $self->{info}{kname};
43 0 $self->{info}{oslabel} = $self->{info}{kname};
44 0 $self->{info}{osvers} = $self->{info}{kvers};
45 0 $self->{info}{osvers} =~ s/-release.*//;
46 0 ▶ $self->{info}{is32bit} = $self->{info}{archname} !~ /(64|alpha)/ ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
!($self->{'info'}{'archname'} =~ /(64|alpha)/) ? : 0 0 0
47 0 ▶ $self->{info}{is64bit} = $self->{info}{archname} =~ /(64|alpha)/ ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$self->{'info'}{'archname'} =~ /(64|alpha)/ ? : 0 0 0
48  
49 0 $self->{info}{source}{$commands{$_}} = $self->{cmds}{$_} for(keys %commands);
50 0 return $self->{info};
51 }
52  
53 0 ▶sub _beos_versions {
Subroutine _beos_versions: not called CC=1 SCAR=6.9
54 return {
55 0 'R4.5' => 'Genki',
56 'R5' => 'Maui',
57 'R5.1' => 'Dano',
58 };
59 }
60  
61  
62 #----------------------------------------------------------------------------
63  
64 4 1;
65  
66 __END__
« Info/SCO.pm ↑ Summary Info/Linux.pm »