[Catalyst-commits] r13963 - Catalyst-Runtime/5.80/branches/restarter_changeclass/lib/Catalyst/Script

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Mon Feb 14 21:05:30 GMT 2011


Author: t0m
Date: 2011-02-14 21:05:30 +0000 (Mon, 14 Feb 2011)
New Revision: 13963

Modified:
   Catalyst-Runtime/5.80/branches/restarter_changeclass/lib/Catalyst/Script/Server.pm
Log:
Patch to make restarter class configurable / settable in prefs

Modified: Catalyst-Runtime/5.80/branches/restarter_changeclass/lib/Catalyst/Script/Server.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/restarter_changeclass/lib/Catalyst/Script/Server.pm	2011-02-14 21:03:00 UTC (rev 13962)
+++ Catalyst-Runtime/5.80/branches/restarter_changeclass/lib/Catalyst/Script/Server.pm	2011-02-14 21:05:30 UTC (rev 13963)
@@ -147,6 +147,16 @@
     );
 }
 
+has restarter_class => (
+    is => 'ro',
+    isa => Str,
+    lazy => 1,
+    default => sub {
+        my $self = shift;
+        Catalyst::Utils::env_value($self->application_name, 'RESTARTER') || 'Catalyst::Restarter';
+    }
+);
+
 sub run {
     my $self = shift;
 
@@ -165,9 +175,9 @@
         # fail.
         $| = 1 if $ENV{HARNESS_ACTIVE};
 
-        require Catalyst::Restarter;
+        Catalyst::Utils::load_class($self->restarter_class);
 
-        my $subclass = Catalyst::Restarter->pick_subclass;
+        my $subclass = $self->restarter_class->pick_subclass;
 
         my $restarter = $subclass->new(
             $self->_restarter_args()




More information about the Catalyst-commits mailing list