Make build_psgi_app public and add MyApp->psgi_app.
Florian Ragwitz [Thu, 14 Jan 2010 03:49:27 +0000 (03:49 +0000)]
lib/Catalyst.pm
lib/Catalyst/Engine.pm
lib/Catalyst/Test.pm

index 9c8d588..737ccc4 100644 (file)
@@ -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
index 62dc3bc..ff7e548 100644 (file)
@@ -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 {
index 191c637..7868e03 100644 (file)
@@ -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, @_ ) };
     }