CPAN::Testers::Config - Manage CPAN Testers configuration data
version 0.002
use CPAN::Testers::Config;
$config = CPAN::Testers::Config->read;
$config->{global}{profile} = 'my_profile.json';
$config->write;
CPAN::Testers::Config provides a very simple interface to load and save CPAN Testers configuration data using only core Perl modules.
By default, configuration is stored in '.cpantesters/config.pl' in the user's home directory. Data is serialized using Data::Dumper.
Configuration is provided as a hash of hashes. No formal schema has been defined yet for CPAN Testers configuration and thus there is no validation by this module.
The top-level key global
is reserved for data that will be used by multiple CPAN Testers modules. Only keys listed in the "Global Configuration Keys" section should be used in the global
hash.
Module-specific configuration data should be stored under a top-level key corresponding to the module name. For example:
# global
$metabase_profile = $config->{global}{profile};
# module-specific
$config->{'CPAN::Testers::Client'}{send_duplicates} = 1;
The following key(s) are defined. No other keys should be added or expected.
Proposed new global keys should be sent to the maintainer(s) of this module and/or the CPAN Testers Discussion mailing list.
A path to a filename containing a CPAN Testers 2.0 user profile; if not an absolute path, it should be treated as a path relative to the CPAN Testers configuration directory
$config = CPAN::Testers::Config->new( %data );
Creates and returns a new configuration object with optional starting data or dies.
$config = CPAN::Tester::Config->read;
# ... modify $config ...
$config->read; # reload
Returns a configuration object with data loaded from the configuration file or dies. May be called either as a class method or an object method.
$config->write;
Serializes a configuration object to the the configuration file or dies. Returns the object as a convenience on success.
$dir = CPAN::Testers::Config->config_dir;
Returns a path to the CPAN Testers configuration directory. See "ENVIRONMENT".
$file = CPAN::Testers::Config->config_file;
Returns a path to the CPAN Testers configuration file. See "ENVIRONMENT".
Specifies an alternate directory to search for CPAN Testers configuration files instead of the default '.cpantesters' in the user's home directory.
Specifies an alternate file for configuration data instead of 'config.pl' in the default or alternate configuration directory.
Please report any bugs or feature requests through the issue tracker at https://github.com/dagolden/cpan-testers-config/issues. You will be notified automatically of any progress on your issue.
This is open source software. The code repository is available for public review and contribution under the terms of the license.
https://github.com/dagolden/cpan-testers-config
git clone git://github.com/dagolden/cpan-testers-config.git
David Golden <[email protected]>
This software is Copyright (c) 2013 by David Golden.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004