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 the lib/ directory for .pm files.

look_in_cwd

Look for .pm files in the current workign directory (and not in sub-directories). This is more common in older Perl modules.

look_in_meta_yml_provides

As an almost-last-ditch effort, decide to beleive META.yml if it has a provides entry. There's no reason to trust that the module author has told the truth since he is only interested in advertising the parts he wants you to use.

look_for_pm

This is a last ditch effort to find modules by looking everywhere, starting in the current working directory.

parse_meta_files

Parses the META.yml and returns the YAML object.

Sets these items in dist_info: META.yml

find_module_techniques

Returns a list of 2-element anonymous arrays that lists method names and string descriptions of the way that the find_modules should look for module files.

If you don't like the techniques, such as run_build_file, you can overload this and return a different set of techniques.

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 current 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_tasks

Returns a list of anonymous arrays that tell get_module_info what to do. Each anonymous array holds:

0. method to call
1. description of technique

The default list includes extract_module_namespaces, exract_module_version, and extract_module_dependencies. If you don't like that list, you can prune or expand it in a subclass.

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 $logger->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

getppid

Get the parent process ID. This is a method because I have to do special things for Windows. For Windows, just return -1 for now.

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-2009, brian d foy, All Rights Reserved.

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

Module Install Instructions

To install MyCPAN::Indexer, simply copy and paste either of the commands in to your terminal