App-lcpan-Call

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

0.06    2016-01-05  Released-By: PERLANCAR

	- Allow configuring maximum index age via argument (max_age) or env
	  LCPAN_MAX_AGE before defaulting to 14 days.


0.05    2015-12-17  Released-By: PERLANCAR

	- No functional changes.

	- [build] Re-build with updated Perinci::To::POD (0.70) which fixes
          rendering of modules' POD with regard to result_naked=1/args_as !=
          'hash'.


0.04    2015-10-20  Released-By: PERLANCAR

	- Fix/tweak Rinci metadata: add result_naked=>1. UPDATE 2016-02-14: this
          has been reversed in 0.07 because it's not very flexible. Sometimes we
          want to get the error code/status.

README  view on Meta::CPAN

  check_lcpan
    Usage:

     check_lcpan(%args) -> [$status_code, $reason, $payload, \%result_meta]

    Check that local CPAN mirror exists and is fairly recent.

    Will return status 200 if "lcpan" script is installed (available from
    PATH), local CPAN mirror exists, and is fairly recent and queryable.
    This routine will actually attempt to run "lcpan stats-last-index-time"
    and return the result if the result is 200 *and* the index is updated
    quite recently. By default "quite recently" is defined as not older than
    2 weeks or whatever LCPAN_MAX_AGE says (in seconds).

    This function is not exported by default, but exportable.

    Arguments ('*' denotes required arguments):

    *   max_age => *duration*

        Maximum index age (in seconds).

lib/App/lcpan/Call.pm  view on Meta::CPAN

}

$SPEC{check_lcpan} = {
    v => 1.1,
    summary => "Check that local CPAN mirror exists and is fairly recent",
    description => <<'_',

Will return status 200 if `lcpan` script is installed (available from PATH),
local CPAN mirror exists, and is fairly recent and queryable. This routine will
actually attempt to run "lcpan stats-last-index-time" and return the result if
the result is 200 *and* the index is updated quite recently. By default "quite
recently" is defined as not older than 2 weeks or whatever LCPAN_MAX_AGE says
(in seconds).

_
    args => {
        %common_args,
    },
};
sub check_lcpan {
    require File::Which;

lib/App/lcpan/Call.pm  view on Meta::CPAN


Usage:

 check_lcpan(%args) -> [$status_code, $reason, $payload, \%result_meta]

Check that local CPAN mirror exists and is fairly recent.

Will return status 200 if C<lcpan> script is installed (available from PATH),
local CPAN mirror exists, and is fairly recent and queryable. This routine will
actually attempt to run "lcpan stats-last-index-time" and return the result if
the result is 200 I<and> the index is updated quite recently. By default "quite
recently" is defined as not older than 2 weeks or whatever LCPAN_MAX_AGE says
(in seconds).

This function is not exported by default, but exportable.

Arguments ('*' denotes required arguments):

=over 4

=item * B<max_age> => I<duration>



( run in 0.254 second using v1.01-cache-2.11-cpan-05444aca049 )