[Catalyst-dev] Catalyst::Plugin::ConfigLoader patch

Joel Bernstein joel at fysh.org
Sat Aug 19 00:56:26 CEST 2006


Hi,

I've committed Config::Any into the Catalyst svn tree at:

trunk/Config-Any

I'm attaching a patch for approval, to Catalyst::Plugin::ConfigLoader.
Not knowing the etiquette, and in a fit of hubris, I committed about a
week ago a patchset into trunk, to make ConfigLoader use Config::Any. I
have since discovered some bugs which have been fixed in both
Config::Any and ConfigLoader - the attached patch is against trunk. 

Having discussed with marcus and jrockway on IRC, it seems that given
that trunk/Catalyst-Plugin-ConfigLoader is currently broken (for which I
apologise - I won't commit anything to this again without asking
permission first, since Marcus has explained that it is considered part
of the core) the right thing to do is to branch ConfigLoader, revert my
commits from last week, and then commit ConfigLoader again... Although
I'm worried that this will leave Config::Any in an inconsistent state.

Anyway I'm attaching the patch, please let me know how to proceed from
here.

/joel
-------------- next part --------------
Index: Catalyst-Plugin-ConfigLoader/lib/Catalyst/Plugin/ConfigLoader.pm
===================================================================
--- Catalyst-Plugin-ConfigLoader/lib/Catalyst/Plugin/ConfigLoader.pm	(revision 4868)
+++ Catalyst-Plugin-ConfigLoader/lib/Catalyst/Plugin/ConfigLoader.pm	(working copy)
@@ -45,10 +45,12 @@
 
 sub setup {
     my $c = shift;
- 
+
     my @files = $c->find_files;
-    my $cfg = Config::Any->load_stems({stems => \@files, filter => \&_fix_syntax});
-    
+
+    #my $cfg = Config::Any->load_stems({stems => \@files, filter => \&_fix_syntax});
+    my $cfg = Config::Any->load_files({files => \@files, filter => \&_fix_syntax});
+
     for my $ref (@$cfg) {
         my ($file, $config) = each %$ref;
         $c->config($config);
@@ -202,4 +204,72 @@
     $v->visit( $c->config );
 }
 
-1;
+=head1 DEPENDENCIES
+
+L<Config::Any|Config::Any>
+L<Data::Visitor|Data::Visitor>
+
+=head1 INCOMPATIBILITIES
+
+None reported.
+
+=head1 BUGS AND LIMITATIONS
+
+No bugs have been reported.
+
+Please report any bugs or feature requests to
+C<bug-catalyst-plugin-configloader at rt.cpan.org>, or through the web interface at
+L<http://rt.cpan.org>.
+
+=head1 AUTHOR
+
+Joel Bernstein  C<< <rataxis at cpan.org> >>
+
+=head1 CONTRIBUTORS
+
+This module was based on the original 
+L<Catalyst::Plugin::ConfigLoader|Catalyst::Plugin::ConfigLoader>
+module by Brian Cassidy C<< <bricas at cpan.org> >>.
+
+With ideas and support from Matt S Trout C<< <mst at shadowcatsystems.co.uk> >>.
+
+=head1 LICENCE AND COPYRIGHT
+
+Copyright (c) 2006, Portugal Telecom C<< http://www.sapo.pt/ >>. All rights reserved.
+
+Portions Copyright 2006 Brian Cassidy C<< <bricas at cpan.org> >>.
+
+This module is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself. See L<perlartistic>.
+
+=head1 DISCLAIMER OF WARRANTY
+
+BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
+EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
+ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
+YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
+NECESSARY SERVICING, REPAIR, OR CORRECTION.
+
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE
+LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL,
+OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
+THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+=head1 SEE ALSO
+
+L<Config::Any|Config::Any>
+
+=cut
+
+1; # Magic true value required at end of module
+


More information about the Catalyst-dev mailing list