Rand Stats

Pod::To::Cached

github:perl6

Pod::To::Cached

Build Status Appveyor Build Status

Create and Maintain a cache of precompiled pod files

Module to take a collection of pod files and create a precompiled cache. Methods / functions to add a pod file to a cache.

Install

This module is in the Raku ecosystem, so you install it in the usual way:

zef install Pod::To::Cached

Although this module is usable, it will be soon substituted by Pod::From::Cached. So it's probably better if you try and adapt to that new module.

The module is now in maintenance mode, and only bugfixes will be released.

SYNOPSIS

use Pod::To::Cached;

my Pod::To::Cached $cache .= new(:path<path-to-cache>, :source<path-to-directory-with-pod-files>);

$cache.update-cache;

for $cache.hash-files.kv -> $source-name, $status {
    given $status {
        when 'Current' {say "$source-name」 is up to date with POD source"}
        when 'Valid' {say "$source-name」 has valid POD, but newer POD source contains invalid POD"}
        when 'Failed' {say "$source-name」 is not in cache, and source file contains invalid POD"}
        when 'New' { say "$source-name」 is not in cache and cache has not been updated"}
        when 'Old' { say "$source-name」 is in cache, but has no associated pod file in DOC"}
    }
    user-supplied-routine-for-processing-pod( $cache.pod( $source-name ) );
}

# Find files with status
say 'These pod files failed:';
.say for $cache.list-files( 'Failed' );
say 'These sources have valid pod:';
.say for $cache.list-files(<Current Valid>);

# Find date when pod added to cache
my $source = 'language/pod'; # name of a documentation source
say "$source」 was added on 「{ $cache.cache-timestamp( $source ) }";

# Remove the dependence on the pod source
$cache.freeze;

Notes

LICENSE

You can use and distribute this module under the terms of the The Artistic License 2.0. See the LICENSE file included in this distribution for complete details.

The META6.json file of this distribution may be distributed and modified without restrictions or attribution.