NAME

Dist::Surveyor::Inquiry - Handling the meta-cpan API access for Dist::Surveyor

VERSION

version 0.017

DESCRIPTION

There are a few things that needed to be known in this module:

  • $metacpan_size - internally defined global to limit the maximum size of every API call

  • $metacpan_calls - internally defined global counting how many API call happen.

  • This module checks $::DEBUG and $::VERBOSE for obvious proposes.

  • For initating cache-on-disk, call Dist::Surveyor::Inquiry->perma_cache() (this should be usually done, except in testing environment)

CLASS METHODS

Dist::Surveyor::Inquiry->perma_cache()

Enable caching to disk of all the MetaCPAN API requests. This cache can grew to be quite big - 40MB is one case, but it worth it, as if you will need to run this program again, it will run much faster.

FUNCTIONS

get_release_info($author, $release)

Receive release info, such as:

get_release_info('SEMUELF', 'Dist-Surveyor-0.009')

Returns a hashref containing all that release meta information, returned by https://fastapi.metacpan.org/v1/release/$author/$release (but not information on the files inside the module)

Dies on HTTP error, and warns on empty response.

get_candidate_cpan_dist_releases($module, $version, $file_size)

Return a hashref containing all the releases that contain this module (with the specific version and file size combination)

The keys are the release name (i.e. 'Dist-Surveyor-0.009') and the value is a hashref containing release information and file information:

'Dist-Surveyor-0.009' => {
    # release information
    'date' => '2013-02-20T06:48:35.000Z',
    'version' => '0.009',
    'author' => 'SEMUELF',
    'version_numified' => '0.009',
    'release' => 'Dist-Surveyor-0.009',
    'distribution' => 'Dist-Surveyor',
    'version_obj' => <version object 0.009>,

    # File information
    'path' => 'lib/Dist/Surveyor/DB_File.pm',
    'stat.mtime' => 1361342736,
    'module.version' => '0.009'
    'module.version_numified' => '0.009',
}

get_candidate_cpan_dist_releases_fallback($module, $version)

Similar to get_candidate_cpan_dist_releases, but getting called when get_candidate_cpan_dist_releases fails for find matching file and release.

Maybe the file was tempared somehow, so the file size does not match anymore.

get_module_versions_in_release($author, $release)

Receive release info, such as:

get_module_versions_in_release('SEMUELF', 'Dist-Surveyor-0.009')

And returns a hashref, that contains one entry for each module that exists in the release. module information is the format:

'Dist::Surveyor' => {
    'version' => '0.009',
    'name' => 'Dist::Surveyor',
    'path' => 'lib/Dist/Surveyor.pm',
    'size' => 43879
},

this function can be called for all sorts of releases that are only vague possibilities and aren't actually installed, so generally it's quiet

License, Copyright

Please see Dist::Surveyor for details