X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FRestarter.pm;h=e83b46a8033f24e0998839c345db97fc677e9876;hb=dbe481fecf31ba1e78c8cb32d65b03d624cf20d1;hp=95c34970a59cf2ceda44fbffa80fae316b241727;hpb=1fcfc6233fa40cb7f17145d6c7631177285a4d1b;p=catagits%2FCatalyst-Devel.git diff --git a/lib/Catalyst/Restarter.pm b/lib/Catalyst/Restarter.pm index 95c3497..e83b46a 100644 --- a/lib/Catalyst/Restarter.pm +++ b/lib/Catalyst/Restarter.pm @@ -4,6 +4,7 @@ use Moose; use Cwd qw( abs_path ); use File::ChangeNotify; +use File::Spec; use FindBin; use namespace::clean -except => 'meta'; @@ -55,7 +56,18 @@ sub BUILD { 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.