Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
CPAN::Testers::Common:UsereContributedCPAN::Testers::Common::Client::Config(3)

NAME
       CPAN::Testers::Common::Client::Config - basic configuration for CPAN
       Testers clients

WARNING!!!
       C:T:C:C:Config is a *very* early	module and a *highly* EXPERIMENTAL one
       for that	matter.	The API	WILL CHANGE. We're still moving	stuff around,
       so please only use it if	you understand and accept the consequences.

       If you have any questions, please contact the author.

SYNOPSIS
	   my $config =	CPAN::Testers::Common::Client::Config->new(
	       prompt => \&IO::Prompt::Tiny::prompt,
	   );

	   if (	-e $config->get_config_filename	) {
	       $config->read or	return;
	   }
	   else	{
	       print "CPAN Testers config file not found. Creating...";
	       $config->setup;
	   }

	   ## perform your test	logging	according to $config's data

	   ## send the report!
	   my $reporter	= Test::Reporter->new(
	       from	      => $config->email_from,
	       transport      => $config->transport_name,
	       transport_args => $config->transport_args,
	       ...
	   );

METHODS
   new
       Instantiates a new CPAN::Testers::Common::Client::Config	object.	It may
       receive the following (optional)	parameters:

       o   warn	=> \&my_warn_function

	   Inject your own warning function. Defaults to CORE::warn.

       o   print => \&my_print_function

	   Inject your own printing function. Defaults to "sub { print @_ }".

       o   prompt => \&my_prompt_function

	   Inject your own prompt function. Does not have a default. The
	   function is expected	to receive two values: "( $question,
	   $default_value )", and return a scalar containing the answer. Take
	   a look at IO::Prompt::Tiny and ExtUtils::MakeMaker's	"prompt()"
	   functions for suitable candidates.

	   If you plan on calling "setup", make	sure you pass the 'prompt'
	   argument to "new()".

   read
       Reads and parses	the existing CPAN Tester's configuration file (usually
       "$HOME/.cpanreporter/config.ini"	into the main object.

   setup
       Prompts the user	and sets up the	CPAN Tester's configuration file
       (usually	"$HOME/.cpanreporter/config.ini"). This	method requires	you to
       have set	a proper "prompt" function when	you instantiated the object.

   get_config_dir()
       The base	directory in which your	'"config.ini"' and other files reside.
       Defaults	to the '.cpanreporter' directory  under	your home directory
       (if you're using	Linux or OS X) or under	the 'my	documents' folder (if
       you're running Windows).

   get_config_filename()
       Returns the full	path for the '"config.ini"' file.

   CONFIGURATION AND ENVIRONMENT
       o   PERL_CPAN_REPORTER_DIR

	   Overrides the value for "get_config_dir()".

       o   PERL_CPAN_REPORTER_CONFIG

	   Overrides the value for "get_config_filename()".

   Other methos	& accessors
       This class also provides	some semi-public methods and accessors that
       most likely will	move around even more than the others, but that	are
       listed here for completeness sake. You should really not	use nor	rely
       on those:

       o   edit_report - accessor for the 'edit_report'	setting.

       o   email_from -	accessor for the 'email_from' setting.

       o   myprint - accessor for the print function.

       o   myprompt - accessor for the prompt function.

       o   mywarn - accessor for the warn function.

       o   send_duplicates - accessor for the 'send_duplicates'	setting.

       o   send_report - accessor for the 'send_report'	setting.

       o   transport - accessor	for the	'transport' setting.

       o   transport_name - returns the	transport name.

       o   transport_args - returns the	transport arguments.

perl v5.32.0			  2018CPAN::Testers::Common::Client::Config(3)

NAME | WARNING!!! | SYNOPSIS | METHODS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=CPAN::Testers::Common::Client::Config&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help