From: Florian Ragwitz Date: Thu, 14 Jan 2010 03:49:27 +0000 (+0000) Subject: Make build_psgi_app public and add MyApp->psgi_app. X-Git-Tag: 5.89000~43 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=22a5833d436649391dc95877ca33f549308c6c3c;hp=6db8aa1d6fcd8b008971db965bf8e3190216b77b Make build_psgi_app public and add MyApp->psgi_app. --- diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 9c8d588..737ccc4 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -69,7 +69,7 @@ our $GO = Catalyst::Exception::Go->new; __PACKAGE__->mk_classdata($_) for qw/components arguments dispatcher engine log dispatcher_class engine_class context_class request_class response_class stats_class - setup_finished/; + setup_finished psgi_app/; __PACKAGE__->dispatcher_class('Catalyst::Dispatcher'); __PACKAGE__->engine_class('Catalyst::Engine'); @@ -2399,8 +2399,8 @@ sub setup_engine { ); } - # engine instance $class->engine( $engine->new ); + $class->psgi_app( $class->engine->build_psgi_app($class) ); } =head2 $c->setup_home diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index 62dc3bc..ff7e548 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -752,10 +752,10 @@ Start the engine. Implemented by the various engine classes. sub run { my ($self, $app, $server, @args) = @_; # FIXME - Do something sensible with the options we're passed - $server->run($self->_build_psgi_app($app, @args)); + $server->run($self->build_psgi_app($app, @args)); } -sub _build_psgi_app { +sub build_psgi_app { my ($self, $app, @args) = @_; my $psgi_app = sub { diff --git a/lib/Catalyst/Test.pm b/lib/Catalyst/Test.pm index 191c637..7868e03 100644 --- a/lib/Catalyst/Test.pm +++ b/lib/Catalyst/Test.pm @@ -27,7 +27,7 @@ my $build_exports = sub { } $class->import; - my $app = $class->engine->_build_psgi_app($class); + my $app = $class->psgi_app; $request = sub { local_request( $app, @_ ) }; }