line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::CLI::Extension::Component::Config; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=pod |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
App::CLI::Extension::Component::Config - for App::CLI::Extension config module |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 VERSION |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
1.421 |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=cut |
14
|
|
|
|
|
|
|
|
15
|
18
|
|
|
18
|
|
97
|
use strict; |
|
18
|
|
|
|
|
33
|
|
|
18
|
|
|
|
|
654
|
|
16
|
18
|
|
|
18
|
|
100
|
use base qw(Class::Accessor::Grouped); |
|
18
|
|
|
|
|
32
|
|
|
18
|
|
|
|
|
6171
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
our $VERSION = '1.421'; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
__PACKAGE__->mk_group_accessors( "inherited" => "_config" ); |
21
|
|
|
|
|
|
|
__PACKAGE__->_config({}); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub config { |
24
|
|
|
|
|
|
|
|
25
|
17
|
|
|
17
|
0
|
619
|
my $self = shift; |
26
|
|
|
|
|
|
|
|
27
|
17
|
|
|
|
|
44
|
my %hash; |
28
|
17
|
100
|
66
|
|
|
202
|
if(scalar(@_) == 1 && ref($_[0]) eq "HASH"){ |
|
|
50
|
|
|
|
|
|
29
|
16
|
|
|
|
|
37
|
%hash = %{$_[0]}; |
|
16
|
|
|
|
|
70
|
|
30
|
|
|
|
|
|
|
} elsif(scalar(@_) > 1) { |
31
|
0
|
|
|
|
|
0
|
%hash = @_; |
32
|
|
|
|
|
|
|
} |
33
|
17
|
|
|
|
|
96
|
my @keys = keys %hash; |
34
|
17
|
100
|
|
|
|
79
|
if (scalar(@keys) > 0) { |
35
|
7
|
|
|
|
|
17
|
map { $self->_config->{$_} = $hash{$_} } @keys; |
|
7
|
|
|
|
|
228
|
|
36
|
|
|
|
|
|
|
} |
37
|
17
|
|
|
|
|
3157
|
return $self->_config; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__END__ |