X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FScriptRole.pm;h=1874ea7127476398cca240f92da77f429fa4bbd3;hb=iis75_fcgi;hp=f726626f5ef2e0b7004f9ef363406ec6bc3ddc11;hpb=acbecf084395e9b46e607a3fe244faa3c1bd3abb;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/ScriptRole.pm b/lib/Catalyst/ScriptRole.pm index f726626..1874ea7 100644 --- a/lib/Catalyst/ScriptRole.pm +++ b/lib/Catalyst/ScriptRole.pm @@ -3,7 +3,7 @@ use Moose::Role; use MooseX::Types::Moose qw/Str Bool/; use Pod::Usage; use MooseX::Getopt; -use Catalyst::Engine::Loader; +use Catalyst::EngineLoader; use MooseX::Types::LoadableClass qw/LoadableClass/; use namespace::autoclean; @@ -26,7 +26,7 @@ has loader_class => ( isa => LoadableClass, is => 'ro', coerce => 1, - default => 'Catalyst::Engine::Loader', + default => 'Catalyst::EngineLoader', documentation => 'The class to use to detect and load the PSGI engine', ); @@ -62,7 +62,11 @@ sub run { } sub _application_args { - () + my $self = shift; + return { + argv => $self->ARGV, + extra_argv => $self->extra_argv, + } } sub _plack_loader_args { @@ -71,13 +75,15 @@ sub _plack_loader_args { return (port => $app_args[0]); } +sub _plack_engine_name {} + sub _run_application { my $self = shift; my $app = $self->application_name; Class::MOP::load_class($app); my $server; - if (my $e = $self->can('_plack_engine_name') ) { - $server = $self->load_engine($self->$e, $self->_plack_loader_args); + if (my $e = $self->_plack_engine_name ) { + $server = $self->load_engine($e, $self->_plack_loader_args); } else { $server = $self->autoload_engine($self->_plack_loader_args);