NAME

Config::ROFL - Yet another config module

SYNOPSIS

use Config::ROFL;
my $config = Config::ROFL->new;
$config->get("frobs");
$config->get(qw/mail server host/);

$config->share_file("system.yml");

DESCRIPTION

Subclassable and auto-magic config module utilizing Config::ZOMG. It looks up which config path to use based on current mode, share dir and class name. Falls back to a relative share dir when run as part of tests.

ATTRIBUTES

config

Returns a hashref representation of the config

dist

The dist name used to find a share dir where the config file is located.

global_path

Global path overriding any lookup by dist, relative or by class of object.

mode

String used as part of name to lookup up config merged on top of general config. For instance if mode is set to "production", the config used will be: config.production.yml merged on top of config.yml Default is 'dev', except when HARNESS_ACTIVE env-var is set for instance when running tests, then mode is 'test'.

name

Name of config file, default is "config"

config_path

Path where to look for config files.

lookup_order

Order of config lookup. Default is ['by_dist', 'by_self', 'relative'], except when under tests when it is ['relative', 'by_dist', 'by_self']

envvar_prefix

Allowe overriding config values with environment variables starting with a given prefix. Setting envvar_prefix to 'MYPREFIX', will allow setting the environment variable 'MYPREFIX_MYKEY' to override the config key 'mykey'.

METHODS

get

Gets a config value, supports an array of strings to traverse down to a certain child hash value.

new

Create a new config instance

new

Get an existing config instance if already created see MooX::Singleton. Beware that altering env-vars between invocations will not affect the instance init args.

share_file

Gets the full path to a file residing in the share folder relative to the config.

SEE ALSO

Config::Merge

Config::General

Config::JFDI

Config::ZOMG

COPYRIGHT

Nicolas Mendoza 2023 - All rights reserved