blib/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 blib/lib/Code/TidyAll/CacheModel.pm »
1 package Code::TidyAll::Config::INI::Reader;
2  
3 35 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 35 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 35 ▶use base qw(Config::INI::Reader);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 35 our $VERSION = '0.83';
9  
10 35 my %multi_value = map { $_ => 1 } qw( ignore inc ok_exit_codes select shebang );
11  
12 sub set_value {
13 60 ▶ my ( $self, $name, $value ) = @_;
Subroutine set_value: called CC=3 SCAR=11.0
Pod documented
14  
15 60 ▶ if ( $multi_value{$name} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($multi_value{$name}) 36 24 60
16 36 $value =~ s/^\s+|\s+$//g;
17 36 push @{ $self->{data}{ $self->current_section }{$name} }, split /\s+/, $value;
18 36 return;
19 }
20  
21 die qq{cannot list multiple config values for '$name'}
22 24 ▶ if exists $self->{data}{ $self->current_section }{$name};
Branch: 1 branch
BranchTrueFalseTotal
if exists $self->{"data"}{$self->current_section}{$name} 0 24 24
23  
24 24 $self->{data}{ $self->current_section }{$name} = $value;
25 }
26  
27 35 1;
28  
29 # ABSTRACT: A L<Config::INI::Reader> subclass which can handle a key appearing more than once
30  
31 __END__
32  
33 =pod
34  
35 =encoding UTF-8
36  
37 =head1 NAME
38  
39 Code::TidyAll::Config::INI::Reader - A L<Config::INI::Reader> subclass which can handle a key appearing more than once
40  
41 =head1 VERSION
42  
43 version 0.83
44  
45 =head1 SUPPORT
46  
47 Bugs may be submitted at L<https://github.com/houseabsolute/perl-code-tidyall/issues>.
48  
49 =head1 SOURCE
50  
51 The source code repository for Code-TidyAll can be found at L<https://github.com/houseabsolute/perl-code-tidyall>.
52  
53 =head1 AUTHORS
54  
55 =over 4
56  
57 =item *
58  
59 Jonathan Swartz <swartz@pobox.com>
60  
61 =item *
62  
63 Dave Rolsky <autarch@urth.org>
64  
65 =back
66  
67 =head1 COPYRIGHT AND LICENSE
68  
69 This software is copyright (c) 2011 - 2022 by Jonathan Swartz.
70  
71 This is free software; you can redistribute it and/or modify it under
72 the same terms as the Perl 5 programming language system itself.
73  
74 The full text of the license can be found in the
75 F<LICENSE> file included with this distribution.
76  
77 =cut
« blib/lib/Code/TidyAll/SVN/Util.pm ↑ Summary blib/lib/Code/TidyAll/CacheModel.pm »