[Bps-public-commit] r17210 - Prophet/branches/actions/lib/Prophet/CLI/Command

jesse at bestpractical.com jesse at bestpractical.com
Sat Dec 13 15:00:53 EST 2008


Author: jesse
Date: Sat Dec 13 15:00:53 2008
New Revision: 17210

Modified:
   Prophet/branches/actions/lib/Prophet/CLI/Command/Server.pm

Log:
* Let the app subclass the prophet server

Modified: Prophet/branches/actions/lib/Prophet/CLI/Command/Server.pm
==============================================================================
--- Prophet/branches/actions/lib/Prophet/CLI/Command/Server.pm	(original)
+++ Prophet/branches/actions/lib/Prophet/CLI/Command/Server.pm	Sat Dec 13 15:00:53 2008
@@ -12,7 +12,11 @@
 
 sub _setup_server {
     my $self = shift;
-    my $server = Prophet::Server->new( $self->arg('port') || 8080 );
+     my $server_class = ref($self->app_handle) . "::Server";
+     if (!$self->app_handle->try_to_require($server_class)) {
+         $server_class = "Prophet::Server";
+     }
+    my $server = $server_class->new( $self->arg('port') || 8080 );
     $server->app_handle( $self->app_handle );
     $server->setup_template_roots();
     return $server;



More information about the Bps-public-commit mailing list