Skip Menu |

This queue is for tickets about the Module-Pluggable CPAN distribution.

Report information
The Basics
Id: 46070
Status: resolved
Priority: 0/
Queue: Module-Pluggable

People
Owner: Nobody in particular
Requestors: maciej.pijanka [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



I found that there is no simple way to tell M::P::O to avoid looking in .svn dirs at all (especially when they are unreadable for uid executing code) i done such override for myself sub Module::Pluggable::Object::find_files { my $self = shift; my $search_path = shift; my $file_regex = $self->{'file_regex'} || qr/\.pm$/; # find all the .pm files in it # this isn't perfect and won't find multiple plugins per file #my $cwd = Cwd::getcwd; my @files = (); { # for the benefit of perl 5.6.1's Find, localize topic local $_; File::Find::find( { no_chdir => 1, wanted => sub { # Inlined from File::Find::Rule C< name => '*.pm' > return unless $File::Find::name =~ /$file_regex/; (my $path = $File::Find::name) =~ s#^\\./##; push @files, $path; }, preprocess => sub { return grep !/\.svn/, @_; }, }, $search_path ); } #chdir $cwd; return @files; } which fixed problem for me (besides complain about redefined sub).
On Thu May 14 07:44:32 2009, AGARAN wrote: Show quoted text
> which fixed problem for me (besides complain about redefined sub).
I think you can actually already achieve this using the file_regex param using something like file_regex => /((^|\/)\.svn(\/|$))/; # untested Alternatively you could subclass Module::Pluggable::Object and do the check there similar to this https://github.com/simonwistow/Module-Pluggable/blob/master/t/20dodgy_files.t