cpangrep icon indicating copy to clipboard operation
cpangrep copied to clipboard

Search code on CPAN with Regexps. No longer maintained, I suggest using http://grep.metacpan.org/ instead.

=head1 CPAN Grep

This is the code behind Lhttp://grep.cpan.me. Unless you want to add something you probably want to use the site, not try and install this ;-)

The default development configuration will index a sample CPAN from L<fakecpan|http://www.fakecpan.org>. Indexing the whole CPAN doesn't take long, although you'll need around 8GB of RAM spare to get a decent level of performance.

=head2 Quick start

For a very quick development setup you should be able to:

=over 4

=item * Ensure you have Perl 5.14 or later

=item * Install redis

You just need a redis-server binary around, C below will start it for you.

=item * Run the following:

cpanm --installdeps . tools/run-test

=item * Visit Lhttp://localhost:5000

=item * Hack!

Starman will pick up changes automatically, so web frontend changes should be picked up right away.

=back

=head2 Components

If you want to work on the indexing or other aspects you might need to run these, to start with C may well be enough though.

=over 4

=item * cpangrep-index

Run this to start with:

bin/cpangrep-index [--cpan_dir /path/to/cpan --slab_dir /data/cpangrep/extract]

If you omit the --cpan_dir and --slab_dir options you'll get the fakecpan configured in etc/config and shipped with this.

=item * WWW::CPANGrep

The web frontend. Run with:

starman -Ilib lib/WWW/CPANGrep.pm

(or other plack server.)

There's also a version that wraps this in LPlack::Debug in F<debug.psgi>.

=item * cpangrep-matcher

Backend workers that do the matching, based on a redis queue. This should be running along with the web frontend, all the time:

bin/cpangrep-matcher

=item * Redis

A Redis server (or several for the live version) are used for queuing jobs and also resolving matches.

=back

=head2 Deployment

Currently the C<"live"> tag refers to the version that is live. To push a new version:

git tag -f live git push --tags

(See the handler for /githook for how this works.)