NAME
CPAN::Testers::Config - Manage CPAN Testers configuration data
VERSION
version 0.002
SYNOPSIS
use CPAN::Testers::Config;
$config = CPAN::Testers::Config->read;
$config->{global}{profile} = 'my_profile.json';
$config->write;
DESCRIPTION
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.
SCHEMA
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;
Global Configuration Keys
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.
profile
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
USAGE
new
$config = CPAN::Testers::Config->new( %data );
Creates and returns a new configuration object with optional starting data or dies.
read
$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.
write
$config->write;
Serializes a configuration object to the the configuration file or dies. Returns the object as a convenience on success.
config_dir
$dir = CPAN::Testers::Config->config_dir;
Returns a path to the CPAN Testers configuration directory. See "ENVIRONMENT".
config_file
$file = CPAN::Testers::Config->config_file;
Returns a path to the CPAN Testers configuration file. See "ENVIRONMENT".
ENVIRONMENT
CPAN_TESTERS_DIR
Specifies an alternate directory to search for CPAN Testers configuration files instead of the default '.cpantesters' in the user's home directory.
CPAN_TESTERS_CONFIG
Specifies an alternate file for configuration data instead of 'config.pl' in the default or alternate configuration directory.
SUPPORT
Bugs / Feature Requests
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.
Source Code
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
AUTHOR
David Golden <dagolden@cpan.org>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2013 by David Golden.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004