[Bps-public-commit] Prophet branch, master, updated. 2bf88ebdfb5dfa39374af6c1cabf121b7a9a41fe

spang at bestpractical.com spang at bestpractical.com
Sat Aug 15 09:43:35 EDT 2009


The branch, master has been updated
       via  2bf88ebdfb5dfa39374af6c1cabf121b7a9a41fe (commit)
       via  7395294c5d4e1cf3af4509acb1bee6b28131491b (commit)
       via  1ece464a9e27d6f648a16dadff6cb371a0944149 (commit)
      from  4744fd1861d3f6bf1084f5cf987b4bdeee13f5c1 (commit)

Summary of changes:
 lib/Prophet/CLI/Command/Server.pm |   18 ++++++++++++++----
 lib/Prophet/Server.pm             |    1 +
 2 files changed, 15 insertions(+), 4 deletions(-)

- Log -----------------------------------------------------------------
commit 1ece464a9e27d6f648a16dadff6cb371a0944149
Author: Christine Spang <spang at bestpractical.com>
Date:   Sat Aug 15 14:01:58 2009 +0100

    Usage check should go in run method, not setup_server

diff --git a/lib/Prophet/CLI/Command/Server.pm b/lib/Prophet/CLI/Command/Server.pm
index bb6c4eb..48fa45c 100644
--- a/lib/Prophet/CLI/Command/Server.pm
+++ b/lib/Prophet/CLI/Command/Server.pm
@@ -17,7 +17,9 @@ END_USAGE
 
 sub run {
     my $self = shift;
-    my $server = $self->setup_server();
+
+    $self->print_usage if $self->has_arg('h');
+
     Prophet::CLI->end_pager();
     $server->run;
 }
@@ -25,8 +27,6 @@ sub run {
 sub setup_server {
     my $self = shift;
 
-    $self->print_usage if $self->has_arg('h');
-
     my $server_class = ref($self->app_handle) . "::Server";
     if (!$self->app_handle->try_to_require($server_class)) {
         $server_class = "Prophet::Server";

commit 7395294c5d4e1cf3af4509acb1bee6b28131491b
Author: Christine Spang <spang at bestpractical.com>
Date:   Sat Aug 15 14:18:16 2009 +0100

    Print message noting how to stop server.\n

diff --git a/lib/Prophet/Server.pm b/lib/Prophet/Server.pm
index 253ada0..f12f8e6 100644
--- a/lib/Prophet/Server.pm
+++ b/lib/Prophet/Server.pm
@@ -52,6 +52,7 @@ sub run {
             . "Net::Rendezvous::Publish::Backend modules from CPAN.");
     }
     $self->setup_template_roots();
+    print ref($self) . ": Starting up local server. You can stop the server with Ctrl-c.\n";
     $self->SUPER::run(@_);
 }
 

commit 2bf88ebdfb5dfa39374af6c1cabf121b7a9a41fe
Author: Christine Spang <spang at bestpractical.com>
Date:   Sat Aug 15 14:21:03 2009 +0100

    Refactor server command to allow more code sharing in SD\n

diff --git a/lib/Prophet/CLI/Command/Server.pm b/lib/Prophet/CLI/Command/Server.pm
index 48fa45c..a096af7 100644
--- a/lib/Prophet/CLI/Command/Server.pm
+++ b/lib/Prophet/CLI/Command/Server.pm
@@ -2,6 +2,16 @@ package Prophet::CLI::Command::Server;
 use Any::Moose;
 extends 'Prophet::CLI::Command';
 
+has server => (
+    is      => 'rw',
+    isa     => 'Maybe[Prophet::Server]',
+    default => sub {
+        my $self = shift;
+        return $self->setup_server();
+    },
+    lazy    => 1,
+);
+
 sub ARG_TRANSLATIONS { shift->SUPER::ARG_TRANSLATIONS(),  p => 'port', w => 'writable' };
 
 use Prophet::Server;
@@ -21,7 +31,7 @@ sub run {
     $self->print_usage if $self->has_arg('h');
 
     Prophet::CLI->end_pager();
-    $server->run;
+    $self->server->run;
 }
 
 sub setup_server {

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list