From: Sartak Date: Sun, 25 May 2008 17:54:20 +0000 (+0000) Subject: Comment on what each piece of the INC driver is doing X-Git-Tag: v1.003015~108 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=16d29e4242cfb095bdcd65a16fb3b4d4d0013240;p=p5sagit%2FDevel-REPL.git Comment on what each piece of the INC driver is doing git-svn-id: http://dev.catalyst.perl.org/repos/bast/trunk/Devel-REPL@4401 bd8105ee-0ff8-0310-8827-fb3f25b6796d --- diff --git a/lib/Devel/REPL/Plugin/CompletionDriver/INC.pm b/lib/Devel/REPL/Plugin/CompletionDriver/INC.pm index 0166c8c..6b882dd 100644 --- a/lib/Devel/REPL/Plugin/CompletionDriver/INC.pm +++ b/lib/Devel/REPL/Plugin/CompletionDriver/INC.pm @@ -57,6 +57,9 @@ around complete => sub { my @found; + # most VCSes don't litter every single fucking directory with garbage. if you + # know of any other, just stick them in here. noone wants to complete + # Devel::REPL::Plugin::.svn my %ignored = ( '.' => 1, @@ -64,6 +67,7 @@ around complete => sub { '.svn' => 1, ); + # this will take a directory and add to @found all of the possible matches my $add_recursively; $add_recursively = sub { my ($path, $iteration, @more) = @_; @@ -90,9 +94,13 @@ around complete => sub { } }; + # look through all of INC: for (@INC) { my $path = $_; + + # match all of the fragments they have, so "use Moose::Meta::At" + # will only begin looking in ../Moose/Meta/ for my $subdir (@directories) { $path = File::Spec->catdir($path, $subdir);