X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FScript%2FServer.pm;h=315fa5439d8eb34be669ce0e48577f5b38c6249f;hb=f06d7696927be5f9d5d35da22c001b083b543d68;hp=e1f1049d7cbacbe9e8f79993e7beff3d5f3d699d;hpb=30b7090311be68aa1d366c2314af426d24a8f0a3;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Script/Server.pm b/lib/Catalyst/Script/Server.pm index e1f1049..315fa54 100644 --- a/lib/Catalyst/Script/Server.pm +++ b/lib/Catalyst/Script/Server.pm @@ -1,19 +1,13 @@ package Catalyst::Script::Server; - -BEGIN { - $ENV{CATALYST_ENGINE} ||= 'HTTP'; - require Catalyst::Engine::HTTP; -} - use Moose; use MooseX::Types::Common::Numeric qw/PositiveInt/; use MooseX::Types::Moose qw/ArrayRef Str Bool Int RegexpRef/; use Catalyst::Utils; use namespace::autoclean; -with 'Catalyst::ScriptRole'; +sub _plack_engine_name { 'Standalone' } -__PACKAGE__->meta->get_attribute('help')->cmd_aliases('?'); +with 'Catalyst::ScriptRole'; has debug => ( traits => [qw(Getopt)], @@ -184,6 +178,24 @@ sub run { } +sub _plack_loader_args { + my ($self) = shift; + return ( + port => $self->port, + host => $self->host, + keepalive => $self->keepalive ? 100 : 1, + server_ready => sub { + my ($args) = @_; + + my $name = $args->{server_software} || ref($args); # $args is $server + my $host = $args->{host} || 0; + my $proto = $args->{proto} || 'http'; + + print STDERR "$name: Accepting connections at $proto://$host:$args->{port}/\n"; + }, + ); +} + sub _application_args { my ($self) = shift; return ( @@ -231,7 +243,7 @@ Catalyst::Script::Server - Catalyst test server a restart when modified (defaults to '\.yml$|\.yaml$|\.conf|\.pm$') --rdir --restart_directory the directory to search for - modified files, can be set mulitple times + modified files, can be set multiple times (defaults to '[SCRIPT_DIR]/..') --sym --follow_symlinks follow symlinks in search directories (defaults to false. this is a no-op on Win32)