File Coverage

blib/lib/Config/Any/Perl.pm
Criterion Covered Total %
statement 11 11 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod 2 2 100.0
total 17 17 100.0


line stmt bran cond sub pod time code
1             package Config::Any::Perl;
2              
3 6     6   105 use strict;
  6         57  
  6         88  
4 6     6   104 use warnings;
  6         55  
  6         92  
5              
6             =head1 NAME
7            
8             Config::Any::Perl - Load Perl config files
9            
10             =head1 DESCRIPTION
11            
12             Loads Perl files. Example:
13            
14             {
15             name => 'TestApp',
16             'Controller::Foo' => {
17             foo => 'bar'
18             },
19             'Model::Baz' => {
20             qux => 'xyzzy'
21             }
22             }
23            
24             =head1 METHODS
25            
26             =head2 extensions( )
27            
28             return an array of valid extensions (C<pl>, C<perl>).
29            
30             =cut
31              
32             sub extensions {
33 6     6 1 78     return qw( pl perl );
34             }
35              
36             =head2 load( $file )
37            
38             Attempts to load C<$file> as a Perl file.
39            
40             =cut
41              
42             sub load {
43 6     6 1 109     my $class = shift;
44 6         57     my $file = shift;
45 6         58     return eval { require $file };
  6         3906  
46             }
47              
48             =head1 AUTHOR
49            
50             =over 4
51            
52             =item * Brian Cassidy E<lt>bricas@cpan.orgE<gt>
53            
54             =back
55            
56             =head1 COPYRIGHT AND LICENSE
57            
58             Copyright 2006 by Brian Cassidy
59            
60             This library is free software; you can redistribute it and/or modify
61             it under the same terms as Perl itself.
62            
63             =head1 SEE ALSO
64            
65             =over 4
66            
67             =item * L<Catalyst>
68            
69             =item * L<Config::Any>
70            
71             =back
72            
73             =cut
74              
75             1;
76