blib/lib/File/Find/Rule/DMIDecode.pm

filter: Statementstmt 83.3% 10 / 12 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 87.5% 14 / 16 CC 1 SCAR 0.7
CC
1
Cov
83%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
↑ Summary
1 package File::Find::Rule::DMIDecode;
2  
3 3 ▶use base qw(File::Find::Rule);
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 ▶use Perl6::Slurp;
Subroutine BEGIN: called CC=1 SCAR=2.6
8 use Parse::DMIDecode;
9  
10 our $VERSION = 0.01;
11  
12 # Detect dmidecode file.
13 sub File::Find::Rule::dmidecode_file {
14 my $file_find_rule = shift;
15 my $self = $file_find_rule->_force_object;
16 return $self->file->exec(sub{
17 my $file = shift;
18  
19 my $data = slurp($file);
20 my $dmidecode = Parse::DMIDecode->new;
21 $dmidecode->parse($data);
22  
23 return $dmidecode->dmidecode_version ? 1 : 0;
24 });
25 }
26  
27 1;
28  
29 __END__
↑ Summary