File Coverage

blib/lib/System/Info/Haiku.pm
Criterion Covered Total %
statement 9 22 40.9
branch 0 2 0.0
condition n/a
subroutine 3 4 75.0
pod 1 1 100.0
total 13 29 44.8


line stmt bran cond sub pod time code
1             package System::Info::Haiku;
2              
3 2     2   13 use strict;
  2         3  
  2         62  
4 2     2   9 use warnings;
  2         3  
  2         51  
5              
6 2     2   9 use base "System::Info::Base";
  2         4  
  2         547  
7              
8             our $VERSION = "0.050";
9              
10             =head1 NAME
11              
12             System::Info::Haiku - Object for specific Haiku info.
13              
14             =head1 DESCRIPTION
15              
16             =head2 $si->prepare_sysinfo
17              
18             Use os-specific tools to find out more about the system.
19              
20             =cut
21              
22             sub prepare_sysinfo {
23 0     0 1   my $self = shift;
24 0           $self->SUPER::prepare_sysinfo;
25              
26 0           eval { local $^W = 0; require Haiku::SysInfo };
  0            
  0            
27 0 0         $@ and return $self;
28              
29 0           my $hsi = Haiku::SysInfo->new;
30 0           (my $cbs = $hsi->cpu_brand_string) =~ s/^\s+//;
31 0           $self->{__cpu_type} = sprintf "0x%x", $hsi->cpu_type;
32 0           $self->{__cpu} = $cbs;
33 0           $self->{__cpu_count} = $hsi->cpu_count;
34              
35 0           $self->{__os} = join " - " => $hsi->kernel_name, $hsi->kernel_version;
36 0           return $self;
37             } # prepare_sysinfo
38              
39             1;
40              
41             __END__