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