[Bps-public-commit] Prophet branch, master, updated. 0.743-30-g02d119b

Christine Spang spang at bestpractical.com
Sun Jan 2 08:24:21 EST 2011


The branch, master has been updated
       via  02d119b202a481ffb023e46514e25f13410be897 (commit)
      from  1244be53c20192d3c33dfaef13fd87753921002e (commit)

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

- Log -----------------------------------------------------------------
commit 02d119b202a481ffb023e46514e25f13410be897
Author: Christine Spang <christine at debian.org>
Date:   Sun Jan 2 13:23:34 2011 -0500

    Prophet::Server should have a port attribute
    
    Changing to 'use base' on HTTP::Server::Simple broke the existing usage
    of the server.
    
    Closes: RT #63851

diff --git a/lib/Prophet/CLI/Command/Server.pm b/lib/Prophet/CLI/Command/Server.pm
index a096af7..c3e91ea 100644
--- a/lib/Prophet/CLI/Command/Server.pm
+++ b/lib/Prophet/CLI/Command/Server.pm
@@ -41,7 +41,8 @@ sub setup_server {
     if (!$self->app_handle->try_to_require($server_class)) {
         $server_class = "Prophet::Server";
     }
-    my $server = $server_class->new( $self->arg('port') || 8080 );
+    my $server = $self->has_arg('port') ? $server_class->new( port => $self->arg('port') )
+                                        : $server_class->new;
     $server->app_handle( $self->app_handle );
     return $server;
 }
diff --git a/lib/Prophet/Server.pm b/lib/Prophet/Server.pm
index 0c16321..5f013e0 100644
--- a/lib/Prophet/Server.pm
+++ b/lib/Prophet/Server.pm
@@ -37,6 +37,8 @@ has read_only  => ( isa  => 'Bool',                        is => 'rw' );
 has static     => ( isa =>  'Bool',                        is => 'rw');
 has view_class => ( isa => 'Str',                       is  => 'rw' );
 has result     => ( isa => 'Prophet::Web::Result',      is  => 'rw' );
+has port       => ( isa => 'Str',
+                    is => 'rw', default => '8080' );
 
 sub run {
     my $self      = shift;

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



More information about the Bps-public-commit mailing list