From: Tomas Doran Date: Mon, 14 Feb 2011 21:05:30 +0000 (+0000) Subject: Patch to make restarter class configurable / settable in prefs X-Git-Tag: 5.80032~4^2~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=75fe0bb3e413a3cd5b6029b4e350f5739cdd0360 Patch to make restarter class configurable / settable in prefs --- diff --git a/lib/Catalyst/Script/Server.pm b/lib/Catalyst/Script/Server.pm index bb4c2a5..7d11111 100644 --- a/lib/Catalyst/Script/Server.pm +++ b/lib/Catalyst/Script/Server.pm @@ -147,6 +147,16 @@ sub _restarter_args { ); } +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 @@ sub run { # 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()