bye bye Class::C3. for good.
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Engine / HTTP / Restarter.pm
index 42f57dd..4691cad 100644 (file)
@@ -1,12 +1,12 @@
 package Catalyst::Engine::HTTP::Restarter;
 
-use strict;
-use warnings;
-use base 'Catalyst::Engine::HTTP';
+use Moose;
+extends 'Catalyst::Engine::HTTP';
+
 use Catalyst::Engine::HTTP::Restarter::Watcher;
-use NEXT;
 
-sub run {
+around run => sub {
+    my $orig = shift;
     my ( $self, $class, $port, $host, $options ) = @_;
 
     $options ||= {};
@@ -19,7 +19,11 @@ sub run {
         close STDOUT;
 
         my $watcher = Catalyst::Engine::HTTP::Restarter::Watcher->new(
-            directory => File::Spec->catdir( $FindBin::Bin, '..' ),
+            directory => ( 
+                $options->{restart_directory} || 
+                File::Spec->catdir( $FindBin::Bin, '..' )
+            ),
+            follow_symlinks => $options->{follow_symlinks},
             regex     => $options->{restart_regex},
             delay     => $options->{restart_delay},
         );
@@ -63,8 +67,9 @@ sub run {
         }
     }
 
-    return $self->NEXT::run( $class, $port, $host, $options );
-}
+    return $self->$orig( $class, $port, $host, $options );
+    no Moose;
+};
 
 1;
 __END__
@@ -84,11 +89,7 @@ and restart the server when any changes are detected.
 
 =head1 METHODS
 
-=over 4
-
-=item run
-
-=back
+=head2 run
 
 =head1 SEE ALSO