Rex::Config - Handles the configuration.
This module holds all configuration parameters for Rex.
With this module you can specify own configuration parameters for your modules.
Register a handler that gets called by set.
Rex::Config->register_set_handler("foo", sub { my ($value) = @_; print "The user set foo -> $value\n"; });
And now you can use this handler in your Rexfile like this:
set foo => "bar";
With this function it is possible to register own sections in the users config file ($HOME/.rex/config.yml).
Example:
Rex::Config->register_config_handler("foo", sub { my ($param) = @_; print "bar is: " . $param->{bar} . "\n"; });
And now the user can set this in his configuration file:
base: user: theuser password: thepassw0rd foo: bar: baz
To install Rex, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Rex
CPAN shell
perl -MCPAN -e shell install Rex
For more information on module installation, please visit the detailed CPAN module installation guide.