File Coverage

blib/lib/Code/TidyAll/Config/INI/Reader.pm
Criterion Covered Total %
statement 17 17 100.0
branch 3 4 75.0
condition n/a
subroutine 4 4 100.0
pod 1 1 100.0
total 25 26 96.1


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