use File::ChangeNotify;
use File::Spec;
use FindBin;
+use Catalyst::Utils;
use namespace::clean -except => 'meta';
has start_sub => (
$subclass = 'Catalyst::Restarter::' . $subclass;
- eval "use $subclass";
- die $@ if $@;
+ Catalyst::Utils::ensure_class_loaded($subclass);
return $subclass;
}
qr(/\.[^/]*/?$), # match hidden dirs
];
- # keep filter regexp to make shure we don't restart on deleted
+ # keep filter regexp to make sure we don't restart on deleted
# files or directories where we can't check -d
$self->_filter( $p->{filter} );
my @events = @_;
my @files;
+ # Filter out any events which are the creation / deletion of directories
+ # so that creating an empty directory won't cause a restart
for my $event (@events) {
my $path = $event->path();
my $type = $event->type();
=head1 SEE ALSO
-L<Catalyst>, <File::ChangeNotify>
+L<Catalyst>, L<File::ChangeNotify>
=head1 AUTHORS