1Rex::Config(3)        User Contributed Perl Documentation       Rex::Config(3)
2
3
4

NAME

6       Rex::Config - Handles the configuration.
7

DESCRIPTION

9       This module holds all configuration parameters for Rex.
10
11       With this module you can specify own configuration parameters for your
12       modules.
13

EXPORTED METHODS

15   register_set_handler($handler_name, $code)
16       Register a handler that gets called by set.
17
18        Rex::Config->register_set_handler("foo", sub {
19          my ($value) = @_;
20          print "The user set foo -> $value\n";
21        });
22
23       And now you can use this handler in your Rexfile like this:
24
25        set foo => "bar";
26
27   register_config_handler($topic, $code)
28       With this function it is possible to register own sections in the users
29       config file ($HOME/.rex/config.yml).
30
31       Example:
32
33        Rex::Config->register_config_handler("foo", sub {
34         my ($param) = @_;
35         print "bar is: " . $param->{bar} . "\n";
36        });
37
38       And now the user can set this in his configuration file:
39
40        base:
41          user: theuser
42          password: thepassw0rd
43        foo:
44          bar: baz
45
46
47
48perl v5.28.0                      2017-03-01                    Rex::Config(3)
Impressum