[Config-loader] [Config Loader] Proposed interface was updated
Config Loader
noreply at google.com
Sat Aug 30 17:04:15 BST 2008
Clinton Gormley updated the page Proposed interface. View the changes below.
Color key: Insertion | Deletion
You need to read Proposed functionality before considering this page.
The intention is to:
be able to use Config::Loader in default mode with minimal code, and have =
it do the sane thing
be flexible enough to turn Config::Loader to your needs / style
So for instance, you could do:
my $c =3D Config::Loader->new($file);
my $c =3D Config::Loader->new($dir);
my $c =3D Config::Loader->new($file,$dir,$dir,$file);
my $c =3D Config::Loader->new([$file,$dir,$dir,$file]);
A list or array ref containing scalars would load each dir (recursively) or=
=
file and merge them into a single hash, with the path name (including =
directory names and file name) as the insertion point into a hash, as =
Config::Merge does now.
If you wanted to override default behaviour, you would pass in a hash ref.
my $c =3D Config::Loader->new({
add_loaders =3D> { 'conf' =3D> 'Config::Loader::YAML' },
load_level =3D> 'top',
sources =3D> [ $file_1, $file_2 ]
});
Default options could be specified at the top level, but could be overriden=
=
with more specific parameters below that (javascript prototype style) :
my $c =3D Config::Loader->new({
add_loaders =3D> { 'conf' =3D> 'Config::Loader::YAML' },
load_level =3D> 'top',
sources =3D> [
$file_1,
{
load_level =3D> 'file',
source =3D> $file_2
post_process =3D> \&code_ref,
}
]
});
Detailed interface discussion:
Default / Simple usage
Adding / overriding config file loaders
Controlling which files / dirs are loaded
Controlling which files / dirs are merged
Controlling the level at which a file is loaded
Controlling the level at which a file is merged or merged
Translating dir/file names to keys
???
Go to page: Proposed interface
-------------
You requested this notification from Google Sites. You can unsubscribe at =
any time.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/config-loader/attachments/20080830/=
c7be65f9/attachment.htm
More information about the Config-loader
mailing list