App::Sqitch::Config3pm
Sqitch configuration management
Usage
my $config = App::Sqitch::Config->new;say scalar $config->dump;
Overview
This class provides the interface to Sqitch configuration. It inherits from Config::GitLike, and therefore provides the complete interface of that module.
Interface
Instance Methods
"confname"
Returns the configuration file base name, which is sqitch.conf.
"system_dir"
Returns the path to the system configuration directory, which is $(prefix)/etc/sqitch/templates. Call "sqitch --etc-path" to find out where, exactly (e.g., "$(sqitch --etc-path)/sqitch.plan").
"user_dir"
Returns the path to the user configuration directory, which is ~/.sqitch/.
"system_file"
Returns the path to the system configuration file. The value returned will be the contents of the $SQITCH_SYSTEM_CONFIG environment variable, if it's defined, or else $(prefix)/etc/sqitch/templates. Call "sqitch --etc-path" to find out where, exactly (e.g., "$(sqitch --etc-path)/sqitch.plan").
"global_file"
An alias for system_file() for use by the parent class.
"user_file"
Returns the path to the user configuration file. The value returned will be the contents of the $SQITCH_USER_CONFIG environment variable, if it's defined, or else "~/.sqitch/sqitch.conf".
"local_file"
Returns the path to the local configuration file, which is just ./sqitch.conf, unless $SQITCH_CONFIG is set, in which case its value will be returned.
"dir_file"
An alias for local_file() for use by the parent class.
"initialized"
say 'Project not initialized' unless $config->initialized;
Returns true if the project configuration file was found, and false if it was not. Useful for detecting when a command has been run from a directory with no Sqitch configuration.
"get_section"
my $core = $config->get_section(section => 'core');my $pg = $config->get_section(section => 'engine.pg');
Returns a hash reference containing only the keys within the specified section or subsection.
"add_comment"
Adds a comment to the configuration file.
"initial_key"
my $key = $config->initial_key($data_key);
Given the lowercase key from the loaded data, this method returns it in its original case. This is like "original_key", only in the case where there are multiple keys (for multivalue keys), only the first key is returned.
Releases
6 releases since Debian 8 (Jessie); the text changed 5 times.