Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Alias (5735)

Alias
  (email not shown publicly)
http://ali.as/

Journal of Alias (5735)

Wednesday February 18, 2009
08:03 PM

File::Find::Rule::Perl now supports META.yml no_index

[ #38511 ]

http://svn.ali.as/cpan/releases/File-Find-Rule-Perl-1.05.tar.gz

After more than the usual mucking around with the API look, I've finally managed to get support for META.yml's no_index entry implemented in my "doin' Perl stuff" File::Find::Rule plugin, File::Find::Rule::Perl.

I've managed to get it to be very very easy to use in the simple cases, while being flexible enough for all the various things people might use it for.

The four different usages are demonstrated in the following sample code, taken from the module docs.

# Provide the rules directly
$rule->no_index(
        directory => [ 'inc', 't', 'examples', 'lib/ignore' ],
        file => [ 'Foo.pm', 'lib/Foo.pm' ],
);

# Provide a META.yml to use
$rule->no_index( 'META.yml' );

# Provide a dist root directory to look for a META.yml in
$rule->no_index( 'My-Distribution' );

# Automatically pick up a META.yml from the target directory
$rule->no_index->in( 'My-Distribution' );

As per the META.yml spec (once convention is codified) exclusions as root-relative multi-part Unix paths.

In this case, the "root-relative" part is always implemented relative to the directories provided to the ->in method, so this method isn't going to be useful for scanning an expanded minicpan or any other tree with multiple nested META.yml files.

But, when combined with File::Find::Rule::VCS, it should be trivial now to write your own tools for analysing Perl code in your modules in the same way PAUSE does, with something like this.

my @perl = File::Find::Rule->ignore_svn->no_index->perl_file;

Now I just need to go through and update all my stuff to use it.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.