File Coverage

blib/lib/Gears/Config/Reader.pm
Criterion Covered Total %
statement 19 29 65.5
branch 1 2 50.0
condition n/a
subroutine 5 7 71.4
pod 3 3 100.0
total 28 41 68.2


line stmt bran cond sub pod time code
1             package Gears::Config::Reader;
2             $Gears::Config::Reader::VERSION = '0.101';
3 2     2   1580 use v5.40;
  2         8  
4 2     2   14 use Mooish::Base -standard;
  2         7  
  2         25  
5              
6 2     2   29947 use Path::Tiny qw(path);
  2         5  
  2         652  
7              
8 4         6 sub _get_contents ($self, $filename)
9 4     4   8 {
  4         7  
  4         7  
10 4         15 return path($filename)->slurp({binmode => ':encoding(UTF-8)'});
11             }
12              
13 4         9 sub handles ($self, $filename)
14 4     4 1 8 {
  4         6  
  4         8  
15 4         17 foreach my $ex ($self->handled_extensions) {
16 4 50       65 return true if $filename =~ m/\.\Q$ex\E$/;
17             }
18              
19 0           return false;
20             }
21              
22             # plain array, strings inside must not contain a dot
23             sub handled_extensions ($self)
24 0     0 1   {
  0            
  0            
25 0           ...;
26             }
27              
28 0           sub parse ($self, $filename)
29 0     0 1   {
  0            
  0            
30 0           ...;
31             }
32              
33             __END__