X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FScript%2FServer.pm;h=62d684eddbd8dc7792c6813b5481f602ef1affbc;hb=a024e9ad11a042d7b3742a0282690b7c5094df95;hp=bb4c2a576db9bd2cbf32111a3a9ddc601a2cae9e;hpb=2d03a2997e2b76d4ee7df1c1db5597f91ab8ec5c;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Script/Server.pm b/lib/Catalyst/Script/Server.pm index bb4c2a5..62d684e 100644 --- a/lib/Catalyst/Script/Server.pm +++ b/lib/Catalyst/Script/Server.pm @@ -144,9 +144,24 @@ sub _restarter_args { ($self->_has_restart_delay ? (sleep_interval => $self->restart_delay) : ()), ($self->_has_restart_directory ? (directories => $self->restart_directory) : ()), ($self->_has_restart_regex ? (filter => $self->restart_regex) : ()), + ), + ( + map { $_ => $self->$_ } qw( + application_name host port debug pidfile restart_directory + restart_delay) ); } +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 +180,9 @@ sub run { # fail. $| = 1 if $ENV{HARNESS_ACTIVE}; - require Catalyst::Restarter; + Catalyst::Utils::ensure_class_loaded($self->restarter_class); - my $subclass = Catalyst::Restarter->pick_subclass; + my $subclass = $self->restarter_class->pick_subclass; my $restarter = $subclass->new( $self->_restarter_args()