package Catalyst::Engine::HTTP::Restarter::Watcher;
-use strict;
-use warnings;
-use base 'Class::Accessor::Fast';
+use Moose;
use File::Find;
use File::Modified;
use File::Spec;
use Time::HiRes qw/sleep/;
-__PACKAGE__->mk_accessors(
- qw/delay
- directory
- modified
- regex
- follow_symlinks
- watch_list/
-);
+has delay => (is => 'rw');
+has regex => (is => 'rw');
+has modified => (is => 'rw');
+has directory => (is => 'rw');
+has watch_list => (is => 'rw');
+has follow_simlinks => (is => 'rw');
sub new {
my ( $class, %args ) = @_;
my @changes;
my @changed_files;
-
+
my $delay = ( defined $self->delay ) ? $self->delay : 1;
sleep $delay if $delay > 0;
regex => '\.yml$|\.yaml$|\.pm$',
delay => 1,
);
-
+
while (1) {
my @changed_files = $watcher->watch();
}