[Bps-public-commit] Prophet branch, master, updated. 0.743-33-g23d21f7

Christine Spang spang at bestpractical.com
Sun Jan 2 19:24:01 EST 2011


The branch, master has been updated
       via  23d21f7db47d3bbedb83394bc0173719fcea2547 (commit)
       via  a6b79b39e0dfcd7bccd89fd9edadb256db047a4b (commit)
       via  d37529480522543b485411a1530db5018437722d (commit)
      from  02d119b202a481ffb023e46514e25f13410be897 (commit)

Summary of changes:
 lib/Prophet/CLI/Command/Server.pm |   11 ++++++++---
 lib/Prophet/Server.pm             |   11 ++++++++---
 2 files changed, 16 insertions(+), 6 deletions(-)

- Log -----------------------------------------------------------------
commit d37529480522543b485411a1530db5018437722d
Author: Christine Spang <christine at debian.org>
Date:   Sun Jan 2 13:30:29 2011 -0500

    check for file existence before reading system js/css

diff --git a/lib/Prophet/Server.pm b/lib/Prophet/Server.pm
index 5f013e0..22e8d72 100644
--- a/lib/Prophet/Server.pm
+++ b/lib/Prophet/Server.pm
@@ -407,7 +407,8 @@ sub send_static_file {
 
     my $system_library_mapping = $self->system_js_and_css();
     my $content;
-    if ( $system_library_mapping->{ $filename } ) {
+    if ( $system_library_mapping->{ $filename } &&
+         -f $system_library_mapping->{ $filename } ) {
         $content = Prophet::Util->slurp( $system_library_mapping->{ $filename } );
     }
     else {

commit a6b79b39e0dfcd7bccd89fd9edadb256db047a4b
Author: Christine Spang <christine at debian.org>
Date:   Sun Jan 2 22:19:12 2011 -0500

    make default server port 8008
    
    8080 is a common port to be used by proxies and semi-permanent
    HTTP services, which means collisions can happen fairly often.
    So, let's use a less common HTTP Alternate port.
    
    Closes: RT #62409, reported by Brett Nash

diff --git a/lib/Prophet/Server.pm b/lib/Prophet/Server.pm
index 22e8d72..a13d7dd 100644
--- a/lib/Prophet/Server.pm
+++ b/lib/Prophet/Server.pm
@@ -38,7 +38,7 @@ 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' );
+                    is => 'rw', default => '8008' );
 
 sub run {
     my $self      = shift;

commit 23d21f7db47d3bbedb83394bc0173719fcea2547
Author: Christine Spang <christine at debian.org>
Date:   Mon Jan 3 00:21:00 2011 +0000

    allow one to configure the default port with server.default-port
    
    That way one can set it per-user or per-repo or globally as well as with --port.

diff --git a/lib/Prophet/CLI/Command/Server.pm b/lib/Prophet/CLI/Command/Server.pm
index c3e91ea..5695f34 100644
--- a/lib/Prophet/CLI/Command/Server.pm
+++ b/lib/Prophet/CLI/Command/Server.pm
@@ -41,9 +41,14 @@ sub setup_server {
     if (!$self->app_handle->try_to_require($server_class)) {
         $server_class = "Prophet::Server";
     }
-    my $server = $self->has_arg('port') ? $server_class->new( port => $self->arg('port') )
-                                        : $server_class->new;
-    $server->app_handle( $self->app_handle );
+    my $server;
+    if ( $self->has_arg('port') ) {
+        $server = $server_class->new(
+            app_handle => $self->app_handle, port => $self->arg('port') );
+    }
+    else {
+        $server = $server_class->new( app_handle => $self->app_handle );
+    }
     return $server;
 }
 
diff --git a/lib/Prophet/Server.pm b/lib/Prophet/Server.pm
index a13d7dd..b3f16a0 100644
--- a/lib/Prophet/Server.pm
+++ b/lib/Prophet/Server.pm
@@ -37,8 +37,12 @@ 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 => '8008' );
+has port       => ( isa => 'Str', is => 'rw',
+                    default => sub {
+                        my $self = shift;
+                        return $self->app_handle->config->get(
+                                key => 'server.default-port' ) || '8008';
+                    } );
 
 sub run {
     my $self      = shift;

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



More information about the Bps-public-commit mailing list