| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Config::Any::General; |
|
2
|
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
92
|
use strict; |
|
|
5
|
|
|
|
|
80
|
|
|
|
5
|
|
|
|
|
82
|
|
|
4
|
5
|
|
|
5
|
|
80
|
use warnings; |
|
|
5
|
|
|
|
|
46
|
|
|
|
5
|
|
|
|
|
946
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
Config::Any::General - Load Config::General files |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Loads Config::General files. Example: |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
name = TestApp |
|
15
|
|
|
|
|
|
|
<Component Controller::Foo> |
|
16
|
|
|
|
|
|
|
foo bar |
|
17
|
|
|
|
|
|
|
</Component> |
|
18
|
|
|
|
|
|
|
<Model Baz> |
|
19
|
|
|
|
|
|
|
qux xyzzy |
|
20
|
|
|
|
|
|
|
</Model> |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 METHODS |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head2 extensions( ) |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
return an array of valid extensions (C<cnf>, C<conf>). |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=cut |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub extensions { |
|
31
|
12
|
|
|
12
|
1
|
169
|
return qw( cnf conf ); |
|
32
|
|
|
|
|
|
|
} |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head2 load( $file ) |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Attempts to load C<$file> via Config::General. |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=cut |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub load { |
|
41
|
8
|
|
|
8
|
1
|
111
|
my $class = shift; |
|
42
|
8
|
|
|
|
|
74
|
my $file = shift; |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
|
47
|
8
|
|
|
|
|
202
|
require Config::General; |
|
48
|
8
|
|
|
|
|
146
|
my $configfile = Config::General->new( $file ); |
|
49
|
8
|
|
|
|
|
102
|
my $config = { $configfile->getall }; |
|
50
|
|
|
|
|
|
|
|
|
51
|
8
|
|
|
|
|
441
|
return $config; |
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub _test_perl { |
|
61
|
0
|
|
|
0
|
|
|
my ($class, $file) = @_; |
|
62
|
0
|
|
|
|
|
|
my $is_perl_src; |
|
63
|
0
|
|
|
|
|
|
eval { $is_perl_src = do "$file"; }; |
|
|
0
|
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
delete $INC{$file}; |
|
65
|
0
|
|
|
|
|
|
return defined $is_perl_src; |
|
66
|
|
|
|
|
|
|
} |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 AUTHOR |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=over 4 |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=item * Brian Cassidy E<lt>bricas@cpan.orgE<gt> |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=back |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 CONTRIBUTORS |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=over 4 |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=item * Joel Bernstein C<< <rataxis@cpan.org> >> |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=back |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
Copyright 2006 by Brian Cassidy |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Portions Copyright 2006 Portugal Telecom |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
|
91
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=over 4 |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=item * L<Catalyst> |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=item * L<Config::Any> |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=item * L<Config::General> |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=back |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=cut |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
1; |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
|