lib/Code/TidyAll/Config/INI/Reader.pm

filter: Statementstmt 100% 21 / 21 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 96.6% 29 / 30 CC 3 SCAR 6.9
CC
3
Cov
96%
set_value
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« blib/lib/Code/TidyAll/SVN/Util.pm ↑ Summary lib/Code/TidyAll/CacheModel.pm »
1 package Code::TidyAll::Config::INI::Reader;
2  
3 58 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 58 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 58 ▶use base qw(Config::INI::Reader);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 58 our $VERSION = '0.85';
9  
10 58 my %multi_value = map { $_ => 1 } qw( ignore inc ok_exit_codes select shebang );
11  
12 93 ▶sub set_value {
Subroutine set_value: called CC=3 SCAR=11.0
Pod documented
13 93 my ( $self, $name, $value ) = @_;
14  
15 93 ▶ if ( $multi_value{$name} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($multi_value{$name}) 63 30 93
16 63 $value =~ s/^\s+|\s+$//g;
17 63 push @{ $self->{data}{ $self->current_section }{$name} }, split /\s+/, $value;
18 63 return;
19 }
20  
21 die qq{cannot list multiple config values for '$name'}
22 30 ▶ if exists $self->{data}{ $self->current_section }{$name};
Branch: 1 branch
BranchTrueFalseTotal
if exists $self->{"data"}{$self->current_section}{$name} 0 30 30
23  
24 30 $self->{data}{ $self->current_section }{$name} = $value;
25 }
26  
27 58 1;
28  
29 # ABSTRACT: A L<Config::INI::Reader> subclass which can handle a key appearing more than once
30  
31 __END__
« blib/lib/Code/TidyAll/SVN/Util.pm ↑ Summary lib/Code/TidyAll/CacheModel.pm »