Info/Irix.pm

filter: Statementstmt 40.0% 12 / 30 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod 100% 2 / 2 totaltotal 39.5% 17 / 43 CC 6 SCAR 32.5
CC
6
Cov
33%
get_info
42.0
new
2.0
BEGIN
1.0
CRAP 25.7
« Info/BSD.pm ↑ Summary Info/SCO.pm »
1 package Devel::Platform::Info::Irix;
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 '_issue1' => 'cat /etc/issue',
13 '_issue2' => 'cat /etc/.issue',
14 '_uname' => 'uname -a',
15 'kname' => 'uname -s',
16 'kvers' => 'uname -r',
17 'osname' => 'uname -o',
18 'archname' => 'uname -m',
19  
20 '_irix1' => 'uname -R', # IRIX specific
21 );
22  
23 #----------------------------------------------------------------------------
24  
25 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
26 0 my ($class) = @_;
27 0 my $self = {};
28 0 bless $self, $class;
29  
30 0 return $self;
31 }
32  
33 0 ▶sub get_info {
Subroutine get_info: not called CC=6 SCAR=37.4
Pod documented
34 0 my $self = shift;
35  
36 0 for my $cmd (keys %commands) {
37 0 $self->{cmds}{$cmd} = `$commands{$cmd} 2>/dev/null`;
38 0 $self->{cmds}{$cmd} =~ s/\s+$//s;
39 0 ▶ $self->{info}{$cmd} = $self->{cmds}{$cmd} if($cmd !~ /^_/);
Branch: 1 branch
BranchTrueFalseTotal
unless $cmd =~ /^_/ 0 0 0
40 }
41  
42 0 $self->{info}{osflag} = $^O;
43 0 $self->{info}{kernel} = lc($self->{info}{kname}) . '-' . $self->{info}{kvers};
44 0 $self->{info}{osname} = 'IRIX';
45 0 $self->{info}{oslabel} = 'IRIX';
46 0 $self->{info}{osvers} = $self->{info}{kvers};
47 0 ▶ $self->{info}{is32bit} = $self->{info}{kname} !~ /64/ ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
!($self->{'info'}{'kname'} =~ /64/) ? : 0 0 0
48 0 ▶ $self->{info}{is64bit} = $self->{info}{kname} =~ /64/ ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$self->{'info'}{'kname'} =~ /64/ ? : 0 0 0
49  
50 0 $self->{info}{source}{$commands{$_}} = $self->{cmds}{$_} for(keys %commands);
51 0 return $self->{info};
52 }
53  
54 #----------------------------------------------------------------------------
55  
56 4 1;
57  
58 __END__
« Info/BSD.pm ↑ Summary Info/SCO.pm »