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

NAME

MyCPAN::Indexer - Index a Perl distribution

SYNOPSIS

        use MyCPAN::Indexer;

DESCRIPTION

run
examine_dist

Given a distribution, unpack it, look at it, and report the findings. It does everything except the looking right now, so it merely croaks. Most of this needs to move out of run and into this method.

clear_run_info

Clear anything recorded about the run.

setup_run_info( DISTPATH )

Given a distribution path, record various data about it, such as its size, mtime, and so on.

Sets these items in dist_info: dist_file dist_size dist_basename dist_basename dist_author

set_run_info( KEY, VALUE )

Set something to record about the run. This should only be information specific to the run. See set_dist_info to record dist info.

run_info( KEY )

Fetch some run info.

clear_dist_info

Clear anything recorded about the distribution.

setup_dist_info( DISTPATH )

Given a distribution path, record various data about it, such as its size, mtime, and so on.

Sets these items in dist_info: dist_file dist_size dist_basename dist_basename dist_author

set_dist_info( KEY, VALUE )

Set something to record about the distribution. This should only be information specific to the distribution. See set_run_info to record run info.

dist_info( KEY )

Fetch some distribution info.

unpack_dist( DISTPATH )

Given a distribution path, this determines the archive type, unpacks it into a temporary directory, and records what it did.

Sets these items in run_info:

Sets these items in dist_info: dist_archive_type dist_extract_path

get_unpack_dir

Get a directory where you can unpack the archive.

Sets these items in dist_info: unpack_dir

find_dist_dir

Looks at dist_info's unpack_dir and guesses where the module distribution is. This accounts for odd archiving people may have used, like putting all the good stuff in a subdirectory.

Sets these items in dist_info: dist_dir

get_file_list

Returns as an array reference the list of files in MANIFEST.

Sets these items in dist_info: manifest

get_file_info( FILE )

Collect various meta-information about a file and store it in a hash. Returns the hash reference.

get_blib_file_list

Returns as an array reference the list of files in blib. You need to call something like run_build_file first.

Sets these items in dist_info: blib

look_in_lib
look_in_cwd
parse_meta_files

Parses the META.yml and returns the YAML object.

Sets these items in dist_info: META.yml

find_modules

Find the module files. First, look in blib/. IF there are no files in blib/, look in lib/. IF there are still none, look in the currnet working directory.

find_tests

Find the test files. Look for test.pl or .t files under t/.

run_build_file

This method is one stop shopping for calls to choose_build_file, setup_build, run_build.

choose_build_file

Guess what the build file for the distribution is, using Distribution::Guess::BuildSystem.

Sets these items in dist_info: build_file

setup_build

Runs the build setup file (Build.PL, Makefile.PL) to prepare for the build. You need to run choose_build_file first.

Sets these items in dist_info: build_file_output

run_build

Run the build file (Build.PL, Makefile). Run setup_build first.

Sets these items in dist_info: build_output

run_something( COMMAND, KEY )

Run the shell command and record the output in the dist_info for KEY. This merges the outputs into stdout and closes stdin by redirecting /dev/null into COMMAND.

get_module_info( FILE )

Collect meta informantion and package information about a module file. It starts by calling get_file_info, then adds more to the hash, including the version and package information.

get_test_info( FILE )

Collect meta informantion and package information about a test file. It starts by calling get_file_info, then adds more to the hash, including the version and package information.

count_lines( FILE )
file_magic( FILE )

Guesses and returns the MIME type for the file.

Utility functions

These functions aren't related to examining a distribution directly.

cleanup

Removes the unpack_dir. You probably don't need this if File::Temp cleans up its own files.

report_dist_info

Write a nice report. This isn't anything useful yet. From your program, take the object and dump it in some way.

get_caller_info

This method is mostly for the TRACE method in Log4perl. It figures out which information to report in the log message, acconting for all the levels or magic in between.

get_md5

TO DO

Count the lines in the files
Code stats? Lines of code, lines of pod, lines of comments

SOURCE AVAILABILITY

This code is in Github:

        git://github.com/briandfoy/mycpan-indexer.git

AUTHOR

brian d foy, <bdfoy@cpan.org>

COPYRIGHT AND LICENSE

Copyright (c) 2008, brian d foy, All Rights Reserved.

You may redistribute this under the same terms as Perl itself.