NAME
Config::Generator::Hook - Config::Generator hook support
DESCRIPTION
This module eases the manipulation of the hooks (i.e. code references) that are used internally by the yacg command.
The check
hooks are executed (in module dependency order) after the high level configuration has been read (and partially validated) but before it has been used. These hooks usually perform additional validation (not performed by the schema based validation) and set default values.
The generate
hooks are executed after the final high level configuration validation. These hooks usually generate files, mainly with the help of the Config::Generator::File module.
Here is what the yacg command does, in order:
- 1. read and partially validate the configuration
- 2. run the
check
hooks - 3. perform the final configuration validation
- 4. run the
generate
hooks - 5. cleanup (e.g. handle the "manifest" file)
Note: module dependencies are handled by Perl when it loads them so the hooks will be executed in the correct order: the check
hook of a given module will be executed after the check
hooks of all the modules it depends on.
FUNCTIONS
This module provides the following functions (none of them being exported by default):
- register_hook(
check
|generate
, CODE) -
register the given
check
orgenerate
hook - run_hooks(
check
|generate
) -
run all the previously registered
check
orgenerate
hooks
AUTHOR
Lionel Cons http://cern.ch/lionel.cons
Copyright (C) CERN 2013-2016