File-Find-Rule-Perl-1.16/000750 000766 000024 00000000000 14220753024 015250 5ustar00etherstaff000000 000000 File-Find-Rule-Perl-1.16/Changes000644 000766 000024 00000003253 14220752663 016563 0ustar00etherstaff000000 000000 Revision history for Perl extension File-Find-Rule-Perl 1.16 2022-03-29 - fix test when run after 'make clean' (RT#142008) 1.15 2015-04-05 - fix tests from 1.14 release 1.14 2015-04-05 - fix tests for ExtUtils::MakeMaker 7.05_* (ETHER) - use warnings in module and tests - switch off of Module::Install again 1.13 Wed 30 Oct 2012 - Updating Module::Install (ADAMK) 1.12 Mon 31 Oct 2011 - Ignore debian directory in tests (ADAMK) - Ignore all dot dirs in tests (ADAMK) 1.11 Mon 31 Oct 2011 - Updating to Module::Install::DSL 1.04 (ADAMK) - Skip MYMETA.json too (CHORNY) - Do not import from Params::Util (ADAMK) 1.10 Wed 6 Sep 2010 - Upgrading to Module::Install::DSL 1.00 (ADAMK) - Removing nasty evil use UNIVERSAL (ADAMK) - Fix 03_noindex.t to ignore MYMETA.yml (MIYAGAWA) 1.09 Thu 30 Jul 2009 - 1.08 broke Windows. This unbreaks it again (ADAMK) 1.08 Thu 16 Jul 2009 - Added the debian/ directory to the list of skipped paths (RT#47921) 1.07 Wed 15 Jul 2009 - Fix no_index regression with absolute paths (RT#47633) 1.06 Mon 13 Apr 2009 - Upgraded to Module::Install 0.82 (ADAMK) - Additional test (without new) (Alexandr Ciornii) - We can now use non-curdir() ->in targets (ADAMK) 1.05 Thu 19 Feb 2009 - Updating to Module::Install 0.79 - Adding support for no_index exclusions 1.04 Sat 10 May 2008 - Switching to a production version. - Move ->name before ->file to significantly reduce the IO load when running a search. 0.03 Mon 16 Oct 2006 - Adding support for empty files 0.02 Mon 4 Sep 2006 - Upgrading to Module::Install 0.64 0.01 Sat 8 Apr 2006 - Created the initial version of the module File-Find-Rule-Perl-1.16/MANIFEST000644 000766 000024 00000000546 14220753024 016413 0ustar00etherstaff000000 000000 Changes lib/File/Find/Rule/Perl.pm Makefile.PL MANIFEST This list of files MANIFEST.SKIP t/01_compile.t t/02_main.t t/03_no_index.t t/dist/lib/Foo.pm t/dist/META.yml t/dist/t/01_compile.t META.yml Module YAML meta-data (added by MakeMaker) META.json Module JSON meta-data (added by MakeMaker) File-Find-Rule-Perl-1.16/MANIFEST.SKIP000644 000766 000024 00000002713 14220752731 017162 0ustar00etherstaff000000 000000 #!start included /Volumes/amaretto/Users/ether/perl5/perlbrew/perls/35.10/lib/5.35.10/ExtUtils/MANIFEST.SKIP # Avoid version control files. \bRCS\b \bCVS\b \bSCCS\b ,v$ \B\.svn\b \B\.git\b ^\.github\b \B\.gitignore\b \b_darcs\b \B\.cvsignore$ # Avoid VMS specific MakeMaker generated files \bDescrip.MMS$ \bDESCRIP.MMS$ \bdescrip.mms$ # Avoid Makemaker generated and utility files. \bMANIFEST\.bak \bMakefile$ \bblib/ \bMakeMaker-\d \bpm_to_blib\.ts$ \bpm_to_blib$ \bblibdirs\.ts$ # 6.18 through 6.25 generated this \b_eumm/ # 7.05_05 and above # Avoid Module::Build generated and utility files. \bBuild$ \b_build/ \bBuild.bat$ \bBuild.COM$ \bBUILD.COM$ \bbuild.com$ # and Module::Build::Tiny generated files \b_build_params$ # Avoid temp and backup files. ~$ \.old$ \#$ \b\.# \.bak$ \.tmp$ \.# \.rej$ \..*\.sw.?$ # Avoid OS-specific files/dirs # Mac OSX metadata \B\.DS_Store # Mac OSX SMB mount metadata files \B\._ # Placeholder files created when iCloud will "optimize Mac storage" \.i[cC]loud$ # Avoid Devel::Cover and Devel::CoverX::Covered files. \bcover_db\b \bcovered\b # Avoid prove files \B\.prove$ # Avoid MYMETA files ^MYMETA\. # Temp files for new META ^META_new\.(?:json|yml) # Avoid travis-ci.org file ^\.travis\.yml # Avoid AppVeyor file ^\.?appveyor.yml #!end included /Volumes/amaretto/Users/ether/perl5/perlbrew/perls/35.10/lib/5.35.10/ExtUtils/MANIFEST.SKIP File-Find-Rule-Perl-.*/ File-Find-Rule-Perl-.*\.tar\.gz$ ^\.ackrc File-Find-Rule-Perl-1.16/META.json000660 000766 000024 00000003574 14220753024 016705 0ustar00etherstaff000000 000000 { "abstract" : "Common rules for searching for Perl things", "author" : [ "Adam Kennedy " ], "dynamic_config" : 0, "generated_by" : "ExtUtils::MakeMaker version 7.64, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "File-Find-Rule-Perl", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : { "File::Find::Rule" : "0.20", "File::Spec" : "0.82", "Params::Util" : "0.38", "Parse::CPAN::Meta" : "1.38", "perl" : "5.006" } }, "test" : { "requires" : { "Test::More" : "0" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "mailto" : "bug-File-Find-Rule-Perl@rt.cpan.org", "web" : "https://rt.cpan.org/Public/Dist/Display.html?Name=File-Find-Rule-Perl" }, "homepage" : "https://github.com/karenetheridge/File-Find-Rule-Perl", "repository" : { "type" : "git", "url" : "https://github.com/karenetheridge/File-Find-Rule-Perl.git", "web" : "https://github.com/karenetheridge/File-Find-Rule-Perl" } }, "version" : "1.16", "x_authority" : "cpan:ADAMK", "x_contributors" : [ "Adam Kennedy ", "Alexandr Ciornii ", "Ash Berlin ", "Jonathan Yu ", "Karen Etheridge ", "Tatsuhiko Miyagawa " ], "x_serialization_backend" : "JSON::MaybeXS version 1.004003" } File-Find-Rule-Perl-1.16/META.yml000660 000766 000024 00000002237 14220753024 016530 0ustar00etherstaff000000 000000 --- abstract: 'Common rules for searching for Perl things' author: - 'Adam Kennedy ' build_requires: Test::More: '0' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 0 generated_by: 'ExtUtils::MakeMaker version 7.64, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: File-Find-Rule-Perl no_index: directory: - t - inc requires: File::Find::Rule: '0.20' File::Spec: '0.82' Params::Util: '0.38' Parse::CPAN::Meta: '1.38' perl: '5.006' resources: bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=File-Find-Rule-Perl homepage: https://github.com/karenetheridge/File-Find-Rule-Perl repository: https://github.com/karenetheridge/File-Find-Rule-Perl.git version: '1.16' x_authority: cpan:ADAMK x_contributors: - 'Adam Kennedy ' - 'Alexandr Ciornii ' - 'Ash Berlin ' - 'Jonathan Yu ' - 'Karen Etheridge ' - 'Tatsuhiko Miyagawa ' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' File-Find-Rule-Perl-1.16/Makefile.PL000644 000766 000024 00000006265 14220752363 017245 0ustar00etherstaff000000 000000 use strict; use warnings; use ExtUtils::MakeMaker; my $developer = -f '.gitignore'; my %WriteMakefileArgs = ( NAME => 'File::Find::Rule::Perl', AUTHOR => 'Adam Kennedy ', LICENSE => 'perl_5', ABSTRACT_FROM => 'lib/File/Find/Rule/Perl.pm', VERSION_FROM => 'lib/File/Find/Rule/Perl.pm', META_MERGE => { 'meta-spec' => { version => 2 }, dynamic_config => 0, resources => { homepage => 'https://github.com/karenetheridge/File-Find-Rule-Perl', repository => { url => 'https://github.com/karenetheridge/File-Find-Rule-Perl.git', web => 'https://github.com/karenetheridge/File-Find-Rule-Perl', type => 'git', }, bugtracker => { mailto => 'bug-File-Find-Rule-Perl@rt.cpan.org', web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=File-Find-Rule-Perl', }, }, x_authority => 'cpan:ADAMK', x_contributors => [ # manually added, from git shortlog -e -s -n 'Adam Kennedy ', 'Alexandr Ciornii ', 'Ash Berlin ', 'Jonathan Yu ', 'Karen Etheridge ', 'Tatsuhiko Miyagawa ', ], }, META_ADD => { 'meta-spec' => { version => 2 }, prereqs => { configure => { requires => { 'ExtUtils::MakeMaker' => '0', }, }, runtime => { requires => { 'File::Find::Rule' => '0.20', 'File::Spec' => '0.82', 'Params::Util' => '0.38', 'Parse::CPAN::Meta' => '1.38', 'perl' => '5.006', }, }, test => { requires => { 'Test::More' => '0', }, }, }, }, test => { TESTS => 't/*.t' . ( $developer ? ' xt/*/*.t' : '' ) }, ); my $eumm_version = eval $ExtUtils::MakeMaker::VERSION; ExtUtils::MakeMaker->VERSION(6.98) if $developer; for (qw(configure build test runtime)) { my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES'; next unless exists $WriteMakefileArgs{META_ADD}{prereqs}{$_} or exists $WriteMakefileArgs{$key}; my $r = $WriteMakefileArgs{$key} = { %{$WriteMakefileArgs{META_ADD}{prereqs}{$_}{requires} || {}}, %{delete $WriteMakefileArgs{$key} || {}}, }; defined $r->{$_} or delete $r->{$_} for keys %$r; } # dynamic prereqs get added here. $WriteMakefileArgs{MIN_PERL_VERSION} = delete $WriteMakefileArgs{PREREQ_PM}{perl} || 0; die 'attention developer: you need to do a sane meta merge here!' if keys %{$WriteMakefileArgs{BUILD_REQUIRES}}; $WriteMakefileArgs{BUILD_REQUIRES} = { %{$WriteMakefileArgs{BUILD_REQUIRES} || {}}, %{delete $WriteMakefileArgs{TEST_REQUIRES}} } if $eumm_version < 6.63_03; $WriteMakefileArgs{PREREQ_PM} = { %{$WriteMakefileArgs{PREREQ_PM}}, %{delete $WriteMakefileArgs{BUILD_REQUIRES}} } if $eumm_version < 6.55_01; delete $WriteMakefileArgs{CONFIGURE_REQUIRES} if $eumm_version < 6.51_03; delete $WriteMakefileArgs{MIN_PERL_VERSION} if $eumm_version < 6.48; delete @WriteMakefileArgs{qw(META_ADD META_MERGE)} if not $developer; delete $WriteMakefileArgs{LICENSE} if $eumm_version < 6.31; WriteMakefile(%WriteMakefileArgs); File-Find-Rule-Perl-1.16/lib/000750 000766 000024 00000000000 14220753024 016016 5ustar00etherstaff000000 000000 File-Find-Rule-Perl-1.16/t/000750 000766 000024 00000000000 14220753024 015513 5ustar00etherstaff000000 000000 File-Find-Rule-Perl-1.16/t/01_compile.t000644 000766 000024 00000000274 12510314670 017640 0ustar00etherstaff000000 000000 # Load testing for File::Find::Rule::Perl use strict; use warnings; use Test::More tests => 2; use_ok( 'File::Find::Rule::Perl' ); ok( defined &find, 'Exported the expected symbol' ); File-Find-Rule-Perl-1.16/t/02_main.t000644 000766 000024 00000001177 12510314670 017140 0ustar00etherstaff000000 000000 # Testing for File::Find::Rule::Perl use strict; use warnings; use lib (); use File::Spec::Functions ':ALL'; use Test::More tests => 7; use File::Find::Rule (); use File::Find::Rule::Perl (); use constant FFR => 'File::Find::Rule'; # Check the methods are added foreach my $method ( qw{ perl_file perl_module perl_script perl_test perl_installer } ) { ok( FFR->can($method), "->$method exists" ); } # Make an object containing all of them my $Rule = File::Find::Rule->new->perl_file; isa_ok( $Rule, 'File::Find::Rule' ); my $Rule1 = File::Find::Rule->perl_file; #used in perlver isa_ok( $Rule1, 'File::Find::Rule' ); exit(0); File-Find-Rule-Perl-1.16/t/03_no_index.t000644 000766 000024 00000007242 14220752462 020024 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More tests => 22; use File::Spec::Functions ':ALL'; use File::Find::Rule (); use File::Find::Rule::Perl (); use constant FFR => 'File::Find::Rule'; ##################################################################### # Run four variations of the standard query SCOPE: { my @params = ( [ ], [ curdir() ], [ 'META.yml' ], [ { directory => [ 'inc', 't', 'xt' ] } ], ); foreach my $p ( @params ) { my $rule = FFR->relative->no_index(@$p)->file; isa_ok( $rule, 'File::Find::Rule' ); my %ignore = map { $_ => 1 } qw{ Makefile MANIFEST MANIFEST.SKIP LICENSE README pm_to_blib MYMETA.yml MYMETA.json Makefile.old }; my @files = sort grep { ! /^debian\b/ and ! /(?:^|\W)\.\w/ and ! /\bblib\b/ and ! /\b_eumm\b/ and ! $ignore{$_} } $rule->in( curdir() ); is_deeply( \@files, [ qw{ Changes META.json META.yml Makefile.PL lib/File/Find/Rule/Perl.pm } ], 'Found the expected files' ); } } ################################################################### # Several variations of absolute path and relative path , both # in no_index and in search prefix. SCOPE: { my @params = ( { name => 'Relative Path', path => 'lib/File/Find/Rule/Perl.pm', dir => curdir(), check => [ 'Rule', 'Perl.pm' ], }, { name => 'Absolute path, Absolute Dir', path => rel2abs(curdir()) . '/lib/File/Find/Rule/Perl.pm', dir => rel2abs(curdir()), check => [ 'Rule', 'Perl.pm' ], }, ); foreach my $p ( @params ) { my $check = quotemeta File::Spec->catfile( @{$p->{check}} ); my $regex = qr/$check/; my $rule = FFR->relative->no_index( { file => [ $p->{path} ] } )->file; my @files = sort grep { $_ !~ m/\bblib\b/ and $_ =~ $regex } $rule->in( $p->{dir} ); if ( @files ) { ok( 0, 'No_index + filename ' . $p->{name} ); for ( @files ) { diag( "File Found: $_ \n , no_index file was <$p->{path}>"); } } else { ok( 1, 'No_index + filename ' . $p->{name} ); } } } ##################################################################### # Run a test in a relative subdirectory # Test with and without ->relative, and with and without a relative ->in # With relative enabled SCOPE: { my $dir = catdir('t', 'dist'); ok( -d $dir, 'Found testing directory' ); my $rule = FFR->relative->no_index->file; isa_ok( $rule, 'File::Find::Rule' ); my @files = sort grep { ! /\.svn\b/ and ! /\bblib\b/ } $rule->in($dir); is_deeply( \@files, [ qw{ META.yml lib/Foo.pm } ], 'Found the expected files' ); } # With relative disabled SCOPE: { my $dir = catdir('t', 'dist'); ok( -d $dir, 'Found testing directory' ); my $rule = FFR->no_index->file; isa_ok( $rule, 'File::Find::Rule' ); my @files = sort grep { ! /\.svn\b/ and ! /\bblib\b/ } $rule->in($dir); is( scalar(@files), 2, 'Found the same file quantity' ); } # With relative enabled SCOPE: { my $dir = rel2abs(catdir('t', 'dist')); ok( -d $dir, 'Found testing directory' ); my $rule = FFR->relative->no_index->file; isa_ok( $rule, 'File::Find::Rule' ); my @files = sort grep { ! /\.svn\b/ and ! /\bblib\b/ } $rule->in($dir); is_deeply( \@files, [ qw{ META.yml lib/Foo.pm } ], 'Found the expected files' ); } # With relative disabled SCOPE: { my $dir = rel2abs(catdir('t', 'dist')); ok( -d $dir, 'Found testing directory' ); my $rule = FFR->no_index->file; isa_ok( $rule, 'File::Find::Rule' ); my @files = sort grep { ! /\.svn\b/ and ! /\bblib\b/ } $rule->in($dir); is( scalar(@files), 2, 'Found the same file quantity' ); } File-Find-Rule-Perl-1.16/t/dist/000750 000766 000024 00000000000 14220753024 016456 5ustar00etherstaff000000 000000 File-Find-Rule-Perl-1.16/t/dist/META.yml000644 000766 000024 00000001300 12507405414 017731 0ustar00etherstaff000000 000000 --- abstract: 'Common rules for searching for Perl things' author: - 'Adam Kennedy ' build_requires: ExtUtils::MakeMaker: 6.42 Test::More: 0.47 configure_requires: ExtUtils::MakeMaker: 6.42 distribution_type: module generated_by: 'Module::Install version 0.82' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 module_name: File::Find::Rule::Perl name: File-Find-Rule-Perl no_index: directory: - inc - t requires: File::Find::Rule: 0.20 File::Spec: 3.27 Params::Util: 0.38 Parse::CPAN::Meta: 0.04 perl: 5.00503 resources: license: http://dev.perl.org/licenses/ version: 1.05 File-Find-Rule-Perl-1.16/t/dist/lib/000750 000766 000024 00000000000 14220753024 017224 5ustar00etherstaff000000 000000 File-Find-Rule-Perl-1.16/t/dist/t/000750 000766 000024 00000000000 14220753024 016721 5ustar00etherstaff000000 000000 File-Find-Rule-Perl-1.16/t/dist/t/01_compile.t000644 000766 000024 00000000047 12507405414 021047 0ustar00etherstaff000000 000000 #!/usr/bin/perl use strict; exit(0); File-Find-Rule-Perl-1.16/t/dist/lib/Foo.pm000644 000766 000024 00000000021 12507405414 020306 0ustar00etherstaff000000 000000 package Foo; 1; File-Find-Rule-Perl-1.16/lib/File/000750 000766 000024 00000000000 14220753024 016675 5ustar00etherstaff000000 000000 File-Find-Rule-Perl-1.16/lib/File/Find/000750 000766 000024 00000000000 14220753024 017555 5ustar00etherstaff000000 000000 File-Find-Rule-Perl-1.16/lib/File/Find/Rule/000750 000766 000024 00000000000 14220753024 020464 5ustar00etherstaff000000 000000 File-Find-Rule-Perl-1.16/lib/File/Find/Rule/Perl.pm000644 000766 000024 00000015766 14220752673 021761 0ustar00etherstaff000000 000000 package File::Find::Rule::Perl; =pod =head1 NAME File::Find::Rule::Perl - Common rules for searching for Perl things =head1 SYNOPSIS use File::Find::Rule (); use File::Find::Rule::Perl (); # Find all Perl files smaller than 10k my @files = File::Find::Rule->perl_file ->size('<10Ki') ->in('dir'); # Locate all the modules that PAUSE will index my @mod = File::Find::Rule->no_index ->perl_module ->in('My-Distribution'); =head1 DESCRIPTION I write a lot of things that muck with Perl files. And it always annoyed me that finding "perl files" requires a moderately complex L pattern. B provides methods for finding various types Perl-related files, or replicating search queries run on a distribution in various parts of the CPAN ecosystem. =head1 METHODS =cut use 5.006; use strict; use warnings; use Carp; use File::Spec 0.82 (); use File::Spec::Unix (); use File::Find::Rule 0.20 (); use Params::Util 0.38 (); use Parse::CPAN::Meta 1.38 (); our $VERSION = '1.16'; use base 'File::Find::Rule'; our @EXPORT = @File::Find::Rule::EXPORT; use constant FFR => 'File::Find::Rule'; ##################################################################### # File::Find::Rule Method Addition =pod =head2 perl_module The C rule locates perl modules. That is, files that are named C<*.pm>. This rule is equivalent to C<-E>file-Ename( '*.pm' )> and is included primarily for completeness. =cut sub File::Find::Rule::perl_module { my $find = $_[0]->_force_object; return $find->name('*.pm')->file; } =pod =head2 perl_test The C rule locates perl test scripts. That is, files that are named C<*.t>. This rule is equivalent to C<-E>file-Ename( '*.t' )> and is included primarily for completeness. =cut sub File::Find::Rule::perl_test { my $find = $_[0]->_force_object; return $find->name('*.t')->file; } =pod =head2 perl_installer The C rule locates perl distribution installers. That is, it locates C and C files. =cut sub File::Find::Rule::perl_installer { my $self = shift()->_force_object; return $self->file->name( 'Makefile.PL', 'Build.PL' ); } =pod =head2 perl_script The C rule locates perl scripts. This is any file that ends in F<.pl>, or any files without extensions that have a perl "hash-bang" line. =cut sub File::Find::Rule::perl_script { my $self = shift()->_force_object; $self->or( FFR->name( '*.pl' )->file, FFR->name( qr/^[^.]+$/ )->file ->exec( \&File::Find::Rule::Perl::_shebang ), ); } sub File::Find::Rule::Perl::_shebang { local *SEARCHFILE; open SEARCHFILE, $_ or return !1; my $first_line = ; close SEARCHFILE; return !1 unless defined $first_line; return $first_line =~ /^#!.*\bperl\b/; } =pod =head2 perl_file The C rule locates all files containing Perl code. This includes all the files matching the above C, C, C and C rules. =cut sub File::Find::Rule::perl_file { my $self = shift()->_force_object; $self->or( FFR->name('*.pm', '*.t', '*.pl', 'Makefile.PL', 'Build.PL')->file, FFR->name( qr/^[^.]+$/ )->file ->exec( \&File::Find::Rule::Perl::_shebang ), ); } =pod =head2 no_index # Provide the rules directly $rule->no_index( directory => [ 'inc', 't', 'examples' ], 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' ); The C method applies a set of rules as per the no_index section in a C file. =cut # There's probably some bugs in this process somewhere, sub File::Find::Rule::no_index { my $find = shift()->_force_object; # Variables we'll need in the closure my $rule = undef; my $root = undef; # Handle the various param options if ( @_ == 0 ) { # No params means we auto-calculate $rule = undef; } elsif ( Params::Util::_HASHLIKE($_[0]) ) { $rule = _no_index($_[0]); } elsif ( defined Params::Util::_STRING($_[0]) ) { my $path = shift; if ( -d $path ) { # This is probably a dist directory my $meta = File::Spec->catfile($path, 'META.yml'); $path = $meta if -f $meta; } if ( -f $path ) { # This is a META.yml file my $meta = Parse::CPAN::Meta::LoadFile($path); # Shortcut if there's nothing to do my $no_index = $meta->{no_index}; if ( $no_index ) { $rule = _no_index($no_index); } } } else { Carp::croak("Invalid or unsupported parameter type"); } # Generate the subroutine in advance my $function = sub { my $shortname = $_[0]; my $fullname = $_[2]; # In the automated case the first time we are # called we are passed the META.yml-relative root. unless ( defined $root ) { if ( File::Spec->file_name_is_absolute($fullname) ) { $root = $fullname; } else { $root = File::Spec->rel2abs( File::Spec->curdir ); } } unless ( defined $rule ) { $rule = ''; my $meta = File::Spec->catfile( $root, 'META.yml' ); if ( -f $meta ) { my $yaml = Parse::CPAN::Meta::LoadFile($meta); if ( $yaml and $yaml->{no_index} ) { $rule = _no_index( $yaml->{no_index} ); } } } # Shortcut when there is no META.yml return 0 unless $rule; # Derive the META.yml-relative unix path my $absname = File::Spec->file_name_is_absolute($fullname) ? $fullname : File::Spec->rel2abs($shortname); my $relpath = File::Spec->abs2rel($absname, $root); # Attempt to match a META.yml entry if ( ($rule->{directory}->{$relpath} or $rule->{directory}->{$absname} ) and -d $absname ) { return 1; } if ( ( $rule->{file}->{$relpath} or $rule->{file}->{$absname} ) and -f $absname ) { return 1; } return 0; }; # Generate the rule return $find->or( FFR->exec( $function )->prune->discard, FFR->new, ); } sub _no_index { my $param = shift; # Index the directory and file entries for faster access my %file = $param->{file} ? ( map { $_ => 1 } @{$param->{file}} ) : (); my %directory = $param->{directory} ? ( map { $_ => 1 } @{$param->{directory}} ) : (); return { file => \%file, directory => \%directory, }; } 1; =pod =head1 SUPPORT Bugs should always be submitted via the CPAN bug tracker L For other issues, contact the maintainer =head1 AUTHOR Adam Kennedy Eadamk@cpan.orgE =head1 SEE ALSO L, L, L =head1 COPYRIGHT Copyright 2006 - 2012 Adam Kennedy. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. =cut