Gears/Config/Reader.pm

filter: Statementstmt 80.0% 12 / 15 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 71.4% 5 / 7 Podpod 100% 3 / 3 totaltotal 77.7% 21 / 27 CC 3 SCAR 7.3
CC
3
Cov
76%
handles
3.6
handled_extensions
2.0
parse
2.0
CRAP 2.1
« Gears/Router/Pattern/Match.pm ↑ Summary Gears/Router.pm »
1 package Gears::Config::Reader;
2 2 $Gears::Config::Reader::VERSION = '0.105';
3 2 ▶use v5.40;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use Mooish::Base -standard;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶use Path::Tiny qw(path);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 4 ▶sub _get_contents ($self, $filename)
Subroutine _get_contents: called CC=1 SCAR=0.0
9 {
10 4 return path($filename)->slurp({binmode => ':encoding(UTF-8)'});
11 }
12  
13 4 ▶sub handles ($self, $filename)
Subroutine handles: called CC=3 SCAR=12.7
Pod documented
14 {
15 4 foreach my $ex ($self->handled_extensions) {
16 4 ▶ return true if $filename =~ m/\.\Q$ex\E$/;
Branch: 1 branch
BranchTrueFalseTotal
if $filename =~ /\.\Q$ex\E$/u 4 0 4
17 }
18  
19 0 return false;
20 }
21  
22 # plain array, strings inside must not contain a dot
23 0 ▶sub handled_extensions ($self)
Subroutine handled_extensions: not called CC=1 SCAR=6.9
Pod documented
24 {
25 0 ...;
26 }
27  
28 0 ▶sub parse ($self, $filename)
Subroutine parse: not called CC=1 SCAR=6.9
Pod documented
29 {
30 0 ...;
31 }
32  
33 __END__
« Gears/Router/Pattern/Match.pm ↑ Summary Gears/Router.pm »