X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FEngine%2FHTTP%2FRestarter%2FWatcher.pm;h=32ee0ed2ea834030946a2c3957362456e4e22f3d;hp=f1ddc286e39b35aa7d3abaa8e354ef673c640e07;hb=536bee890cf24e0e4bcda7562e7b70cc03ca0620;hpb=10954d1da9f6c10b13cf3797caa624f92587ae7a diff --git a/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm b/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm index f1ddc28..32ee0ed 100644 --- a/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm +++ b/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm @@ -22,26 +22,21 @@ BEGIN { has delay => (is => 'rw'); has regex => (is => 'rw'); -has modified => (is => 'rw'); +has modified => (is => 'rw', builder => '_build_modified', lazy => 1); has directory => (is => 'rw'); -has watch_list => (is => 'rw'); +has watch_list => (is => 'rw', builder => '_build_watch_list', lazy => 1); has follow_symlinks => (is => 'rw'); -sub BUILD { - shift->_init; +sub _build_watch_list { + my ($self) = @_; + return $self->_index_directory; } -sub _init { - my $self = shift; - - my $watch_list = $self->_index_directory; - $self->watch_list($watch_list); - - $self->modified( - File::Modified->new( - method => 'mtime', - files => [ keys %{$watch_list} ], - ) +sub _build_modified { + my ($self) = @_; + return File::Modified->new( + method => 'mtime', + files => [ keys %{ $self->watch_list } ], ); } @@ -229,7 +224,7 @@ Many parts are ripped out of C by Jesse Vincent. =head1 COPYRIGHT -This program is free software, you can redistribute it and/or modify it under +This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself. =cut