[Config-loader] [Config Loader] Controlling the level at which a
file is loaded or merged was updated
Config Loader
noreply at google.com
Sat Aug 30 17:01:13 BST 2008
Clinton Gormley updated the page Controlling the level at which a file is =
loaded or merged. View the changes below.
Color key: Insertion | Deletion
Once we have decided to load a file (and possibly to merge it), we need to =
know at which level this operates, ie do we take the dir name or the file =
name into account?
We can use load_level and merge_level to control the level at which the =
contents of each file are inserted into the config hash.
load_level would default to ' path ' and merge_level would default to ' =
dir '.
If the user sets: arent_dir
load_level to ' dir ', then merge_level would default to ' parent_dir '.
load_level to ' file ', then merge_level would default to ' top '.
load_level to ' top ', then merge_level would default to ' top '.
load_level to ' parent_dir ', then merge_level would default to ' =
parent_dir '.
(Not sure if the above is correct)
Proposed levels
Given this tree structure:
-----------------------------------
config/
db/
main/
creds.yml:
host: db1.domain.com
username: dbuser
password: mypass
-----------------------------------
top
$config =3D {
host =3D> 'db1.domain.com',
username =3D> 'dbuser',
password =3D> 'mypass',
};
file
$config =3D {
creds =3D> {
host =3D> 'db1.domain.com',
username =3D> 'dbuser',
password =3D> 'mypass',
}
};
dir
$config =3D {
db =3D> {
main =3D> {
host =3D> 'db1.domain.com',
username =3D> 'dbuser',
password =3D> 'mypass',
}
}
};
path
$config =3D {
db =3D> {
main =3D> {
creds =3D> {
host =3D> 'db1.domain.com',
username =3D> 'dbuser',
password =3D> 'mypass',
}
}
}
};
parent_dir
$config =3D {
db =3D> {
host =3D> 'db1.domain.com',
username =3D> 'dbuser',
password =3D> 'mypass',
}
};
Go to page: Controlling the level at which a file is loaded or merged
-------------
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/=
cca23811/attachment-0001.htm
More information about the Config-loader
mailing list