Subject: | Load config files in alphanumeric order |
This is a simple patch to sort config files alphanumerically before
loading them, to allow intentional ordering of config files, such that
overrides can be more useful, particularly in a development environment.
For example:
myapp.conf
myapp_10_devel.conf
myapp_20_experimental.conf
myapp_local.conf
Subject: | CL.patch |
--- /usr/share/perl5/Catalyst/Plugin/ConfigLoader.pm 2007-11-21 12:53:05.000000000 -0600
+++ ConfigLoader.pm 2007-12-13 13:23:46.000000000 -0600
@@ -73,7 +73,7 @@
# load all the normal cfgs, then the local cfgs last so they can override
# normal cfgs
- $c->load_config( $_ ) for @cfg, @localcfg;
+ $c->load_config( $_ ) for (reverse sort @cfg), (reverse sort @localcfg);
$c->finalize_config;
$c->NEXT::setup( @_ );