/usr/share/perl5/CPAN/Reporter/API.pm is in libcpan-reporter-perl 1.2011-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | use strict; # make CPANTS happy
package CPAN::Reporter::API;
our $VERSION = '1.2011'; # VERSION
1;
# ABSTRACT: Programmer's interface to CPAN::Reporter
__END__
=pod
=encoding UTF-8
=head1 NAME
CPAN::Reporter::API - Programmer's interface to CPAN::Reporter
=head1 VERSION
version 1.2011
=head1 FUNCTIONS
CPAN::Reporter provides only a few public function for use within CPAN.pm.
They are not imported during C<<< use >>>. Ordinary users will never need them.
=head2 C<<< configure() >>>
CPAN::Reporter::configure();
Prompts the user to edit configuration settings stored in the CPAN::Reporter
C<<< config.ini >>> file. It will create the configuration file if it does not exist.
It is automatically called by CPAN.pm when initializing the 'test_report'
option, e.g.:
cpan> o conf init test_report
=head2 C<<< record_command() >>>
($output, $exit_value) = CPAN::Reporter::record_command( $cmd, $secs );
Takes a command to be executed via system(), but wraps and tees it to
show the output to the console, capture the output, and capture the
exit code. Returns an array reference of output lines (merged STDOUT and
STDERR) and the return value from system(). Note that this is C<<< $? >>>, so the
actual exit value of the command will need to be extracted as described in
L<perlvar>.
If the command matches E<sol>\b(?:MakefileE<verbar>Build)\.PL\bE<sol>, then L<Devel::Autoflush>
is added to C<<< PERL5OPT >>> to force autoflushing of user prompts.
If the command includes a pipe character ('E<verbar>'), only the part of the
command prior to the pipe will be wrapped and teed. The pipe will be
applied to the execution of the wrapper script. This is essential to
capture the exit value of the command and should be otherwise transparent.
If a non-zero C<<< $secs >>> argument is provided, the command will be run with a
timeout of C<<< $secs >>> (seconds) if the appropriate process management modules are
available. On Win32, L<Win32::Job> must be available; on Unix, L<Proc::Killfam>
must be available. Otherwise, code will fall-back to running without a
timeout.
Also, on Win32, the first space-separated element of the command must be
absolute, or else ".exe" will be appended and the PATH searched for a matching
command.
If the attempt to record fails, a warning will be issued and one or more of
C<<< $output >>> or C<<< $exit_value >>> will be undefined.
=head2 C<<< grade_make() >>>
CPAN::Reporter::grade_make( $dist, $command, \@output, $exit);
Given a CPAN::Distribution object, the system command used to build the
distribution (e.g. "make", "perl Build"), an array of lines of output from the
command and the exit value from the command, C<<< grade_make() >>> determines a grade
for this stage of distribution installation. If the grade is "pass",
C<<< grade_make() >>> does B<not> send a CPAN Testers report for this stage and returns
true to signal that the build was successful. Otherwise, a CPAN Testers report
is sent and C<<< grade_make() >>> returns false.
=head2 C<<< grade_PL() >>>
CPAN::Reporter::grade_PL( $dist, $command, \@output, $exit);
Given a CPAN::Distribution object, the system command used to run Makefile.PL
or Build.PL (e.g. "perl Makefile.PL"), an array of lines of output from the
command and the exit value from the command, C<<< grade_PL() >>> determines a grade
for this stage of distribution installation. If the grade is "pass",
C<<< grade_PL() >>> does B<not> send a CPAN Testers report for this stage and returns
true to signal that the Makefile.PL or Build.PL ran successfully. Otherwise, a
CPAN Testers report is sent and C<<< grade_PL() >>> returns false.
=head2 C<<< grade_test() >>>
CPAN::Reporter::grade_test( $dist, $command, \@output, $exit);
Given a CPAN::Distribution object, the system command used to run tests (e.g.
"make test"), an array of lines of output from testing and the exit value from
the system command, C<<< grade_test() >>> determines a grade for distribution tests.
A CPAN Testers report is then sent unless specified prerequisites were not
satisfied, in which case the report is discarded. This function returns true
if the grade is "pass" or "unknown" and returns false, otherwise.
=head2 C<<< test() >>> -- DEPRECATED
CPAN::Reporter::test( $cpan_dist, $system_command );
This function is maintained for backwards compatibility. It effectively
wraps the functionality of C<<< record_command() >>> and C<<< grade_test() >>> into
a single function call. It takes a CPAN::Distribution object and the system
command to run distribution tests.
=head1 SEE ALSO
=over
=item *
L<CPAN::Reporter>
=item *
L<CPAN::Reporter::Config>
=item *
L<CPAN::Reporter::FAQ>
=back
=head1 AUTHOR
David Golden <dagolden@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is Copyright (c) 2006 by David Golden.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
=cut
|