[Catalyst-commits] r11782 - Catalyst-Devel/1.00/trunk/lib/Catalyst
dew at dev.catalyst.perl.org
dew at dev.catalyst.perl.org
Sat Nov 7 19:19:40 GMT 2009
Author: dew
Date: 2009-11-07 19:19:38 +0000 (Sat, 07 Nov 2009)
New Revision: 11782
Modified:
Catalyst-Devel/1.00/trunk/lib/Catalyst/Restarter.pm
Log:
Don't monitor t/, root/ and hidden dirs
Modified: Catalyst-Devel/1.00/trunk/lib/Catalyst/Restarter.pm
===================================================================
--- Catalyst-Devel/1.00/trunk/lib/Catalyst/Restarter.pm 2009-11-07 16:50:59 UTC (rev 11781)
+++ Catalyst-Devel/1.00/trunk/lib/Catalyst/Restarter.pm 2009-11-07 19:19:38 UTC (rev 11782)
@@ -4,6 +4,7 @@
use Cwd qw( abs_path );
use File::ChangeNotify;
+use File::Spec;
use FindBin;
use namespace::clean -except => 'meta';
@@ -55,8 +56,19 @@
delete $p->{start_sub};
$p->{filter} ||= qr/(?:\/|^)(?![.#_]).+(?:\.yml$|\.yaml$|\.conf|\.pm)$/;
- $p->{directories} ||= abs_path( File::Spec->catdir( $FindBin::Bin, '..' ) );
+ my $app_root = abs_path( File::Spec->catdir( $FindBin::Bin, '..' ) );
+
+ # Monitor application root dir
+ $p->{directories} ||= $app_root;
+
+ # exclude t/, root/ and hidden dirs
+ $p->{exclude} ||= [
+ File::Spec->catdir($app_root, 't'),
+ File::Spec->catdir($app_root, 'root'),
+ qr(/\.[^/]*/?$), # match hidden dirs
+ ];
+
# We could make this lazily, but this lets us check that we
# received valid arguments for the watcher up front.
$self->_watcher( File::ChangeNotify->instantiate_watcher( %{$p} ) );
More information about the Catalyst-commits
mailing list