Name

SPVM::Builder::Config::Util - Config Utilities

Description

SPVM::Builder::Config::Util module has utilities for SPVM::Builder::Config class.

Functions

load_config

my $config = SPVM::Builder::Config::Util::load_config($config_file);

Loads the config file $config_file and returns an SPVM::Builder::Config::Base object.

Examples:

my $config = SPVM::Builder::Config::Util::load_config($config_file);

file field of the returned config object is set to $config_file.

load_mode_config

my $config = SPVM::Builder::Config::Util::load_mode_config($config_file, $mode);

Loads the mode config from the config file $config_file and the mode $mode and returns an SPVM::Builder::Config::Base object.

$config_file is a config file path, such as path/MyClass.config and path/MyClass.debug.config.

A mode config file is a config file with a mode.

# Mode config file
MyClass.debug.config

The mode config file path such as path/MyClass.$mode.config is created from $config_file and $mode.

mode field of the returned config object is set to $mode.

This function calls "load_config" function internally.

See also "Config Mode" in SPVM::Builder::Config::Base.

Examples:

my $config = SPVM::Builder::Config::Util::load_mode_config(__FILE__, "debug");

load_base_config

my $config = SPVM::Builder::Config::Util::load_base_config($config_file);

Loads the base config from the config file $config_file and returns an SPVM::Builder::Config::Base object.

A base config file is the config file that removes its mode. If $config_file is path/MyClass.debug.config, the base config file is path/MyClass.config.

This function calls "load_mode_config" function internally.

Examples:

my $config = SPVM::Builder::Config::Util::load_base_config(__FILE__);

remove_ext_from_config_file

my $config_file_without_ext = SPVM::Builder::Config::Util::remove_ext_from_config_file($config_file);

Removes the all extension from the config file path $config_file and returns it.