The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

DESCRIPTION

Methods for accessing files from cover_db database.

WARNING

Consider this module to be an early ALPHA. It does the job for me, so it's here.

This is my first CPAN module, so I expect that some things may be a bit rough around edges.

The plan is, to fix both those issues, and remove this warning in next immediate release.

API

new

Constructor for Devel::CoverReport::DB.

is_valid

Check if specified cover_db database seems to be valid.

Returns true, if DB seems to be OK.

Returns false, if problems with DB are found, additionally carp'ing about them along the way.

get_digest_to_run

Analize contents of 'runs' directory, and prepare mapping that shows which runs cover which files (from structure).

Returned data structure is as follows:

 %digest_to_run = (
    $file_1_digest => [
        $run_1_id,
        $run_2_id,
        ...
        $run_n_id,
    ],
    $file_2_digest => [
        ...
    ],
    ...
    $file_n_digest => [
        ...
    ],
 );
digests

Return all digests (structure IDs), from current cover_db.

runs

Return all run ID, from current cover_db.

get_structure_data

Slurp and deserialize data for single structure element, identified by $digest.

Parameters: $self $digest

Returns: $digest_data - hashref.

get_run_data

Slurp and deserialize data for single run, identified by $run.

Parameters: $self $run

Returns: $run_data - hashref.

make_file_digest

Generate cover_db-compatile file digest.

Parameters: $self $path

Returns: $digest - scalar (string)

read_db_file

Read and parse DB file, then return data structure as it is in the file.

Bu default, it assumes, that file is a storeble data dump. When storable fails, it will try to use JSON to load the data.

This method supports reading .12 and .13 file formats. It can auto-detect if it was serialized with storable or JSON.

LICENCE

Copyright 2009-2011, Bartłomiej Syguła (perl@bs502.pl)

This is free software. It is licensed, and can be distributed under the same terms as Perl itself.

For more, see my website: http://bs502.pl/