r26615 - in /trunk/libcgi-application-server-perl: ChangeLog META.yml Makefile.PL README debian/changelog lib/CGI/Application/Server.pm

jaldhar at users.alioth.debian.org jaldhar at users.alioth.debian.org
Mon Nov 3 21:48:34 UTC 2008


Author: jaldhar
Date: Mon Nov  3 21:48:31 2008
New Revision: 26615

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=26615
Log:
Upgrade to upstream version 0.60

Modified:
    trunk/libcgi-application-server-perl/ChangeLog
    trunk/libcgi-application-server-perl/META.yml
    trunk/libcgi-application-server-perl/Makefile.PL
    trunk/libcgi-application-server-perl/README
    trunk/libcgi-application-server-perl/debian/changelog
    trunk/libcgi-application-server-perl/lib/CGI/Application/Server.pm

Modified: trunk/libcgi-application-server-perl/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-application-server-perl/ChangeLog?rev=26615&op=diff
==============================================================================
--- trunk/libcgi-application-server-perl/ChangeLog (original)
+++ trunk/libcgi-application-server-perl/ChangeLog Mon Nov  3 21:48:31 2008
@@ -1,4 +1,10 @@
 Changes for CGI::Application::Server
+
+0.060 Sun. Nov  2, 2008
+		- a number of patches from George Hartzell; thanks!
+		- documenation improvements
+		- use HTTP::Server::Simple::Static as its documentation suggests
+		- add handling for a "/" entry point
 
 0.050 Sun. Oct 21, 2007
     - add support for CGI::Application objects as entry points

Modified: trunk/libcgi-application-server-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-application-server-perl/META.yml?rev=26615&op=diff
==============================================================================
--- trunk/libcgi-application-server-perl/META.yml (original)
+++ trunk/libcgi-application-server-perl/META.yml Mon Nov  3 21:48:31 2008
@@ -1,6 +1,6 @@
 ---
 name: CGI-Application-Server
-version: 0.050
+version: 0.060
 author:
   - 'Stevan Little E<lt>stevan at iinteractive.comE<gt>'
   - 'Rob Kinyon E<lt>rob.kinyon at iinteractive.comE<gt>'
@@ -26,8 +26,8 @@
 provides:
   CGI::Application::Server:
     file: lib/CGI/Application/Server.pm
-    version: 0.050
-generated_by: Module::Build version 0.280801
+    version: 0.060
+generated_by: Module::Build version 0.3
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.2.html
   version: 1.2

Modified: trunk/libcgi-application-server-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-application-server-perl/Makefile.PL?rev=26615&op=diff
==============================================================================
--- trunk/libcgi-application-server-perl/Makefile.PL (original)
+++ trunk/libcgi-application-server-perl/Makefile.PL Mon Nov  3 21:48:31 2008
@@ -1,25 +1,25 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.2808_01
+# Note: this file was auto-generated by Module::Build::Compat version 0.30
 use ExtUtils::MakeMaker;
 WriteMakefile
 (
+          'PL_FILES' => {},
+          'INSTALLDIRS' => 'site',
           'NAME' => 'CGI::Application::Server',
+          'EXE_FILES' => [],
           'VERSION_FROM' => 'lib/CGI/Application/Server.pm',
           'PREREQ_PM' => {
-                           'CGI::Application' => '0',
-                           'CGI::Application::Plugin::Redirect' => '0',
-                           'Carp' => '0.01',
-                           'HTTP::Request' => '0',
-                           'HTTP::Server::Simple' => '0.18',
-                           'HTTP::Server::Simple::Static' => '0.02',
-                           'HTTP::Status' => '0',
                            'Scalar::Util' => '1.18',
                            'Test::Exception' => '0.21',
                            'Test::HTTP::Server::Simple' => '0.02',
+                           'CGI::Application::Plugin::Redirect' => '0',
+                           'HTTP::Status' => '0',
+                           'Carp' => '0.01',
                            'Test::More' => '0.47',
-                           'Test::WWW::Mechanize' => '1.08'
-                         },
-          'INSTALLDIRS' => 'site',
-          'EXE_FILES' => [],
-          'PL_FILES' => {}
+                           'HTTP::Server::Simple' => '0.18',
+                           'CGI::Application' => '0',
+                           'HTTP::Request' => '0',
+                           'Test::WWW::Mechanize' => '1.08',
+                           'HTTP::Server::Simple::Static' => '0.02'
+                         }
         )
 ;

Modified: trunk/libcgi-application-server-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-application-server-perl/README?rev=26615&op=diff
==============================================================================
--- trunk/libcgi-application-server-perl/README (original)
+++ trunk/libcgi-application-server-perl/README Mon Nov  3 21:48:31 2008
@@ -1,5 +1,5 @@
-CGI::Application::Server version 0.04
-=====================================
+CGI::Application::Server version 0.060
+======================================
 
 See the individual module documentation for more information
 

Modified: trunk/libcgi-application-server-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-application-server-perl/debian/changelog?rev=26615&op=diff
==============================================================================
--- trunk/libcgi-application-server-perl/debian/changelog (original)
+++ trunk/libcgi-application-server-perl/debian/changelog Mon Nov  3 21:48:31 2008
@@ -1,3 +1,9 @@
+libcgi-application-server-perl (0.060-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Jaldhar H. Vyas <jaldhar at debian.org>  Mon, 03 Nov 2008 16:41:30 -0500
+
 libcgi-application-server-perl (0.050-1) unstable; urgency=low
 
   * New upstream release.

Modified: trunk/libcgi-application-server-perl/lib/CGI/Application/Server.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libcgi-application-server-perl/lib/CGI/Application/Server.pm?rev=26615&op=diff
==============================================================================
--- trunk/libcgi-application-server-perl/lib/CGI/Application/Server.pm (original)
+++ trunk/libcgi-application-server-perl/lib/CGI/Application/Server.pm Mon Nov  3 21:48:31 2008
@@ -10,12 +10,10 @@
 use HTTP::Response;
 use HTTP::Status;
 
-our $VERSION = '0.050';
-
-use base qw(
-    HTTP::Server::Simple::CGI
-    HTTP::Server::Simple::Static
-);
+our $VERSION = '0.060';
+
+use base qw( HTTP::Server::Simple::CGI );
+use HTTP::Server::Simple::Static;
 
 # HTTP::Server::Simple methods
 
@@ -67,6 +65,11 @@
         $uri =~ s/\/[^\/]*$//;
     }
 
+    # Check to see if there's an entry for '/'
+    if (exists $self->{entry_points}{'/'}) {
+	return ($uri, $self->{entry_points}{'/'});
+    }
+
     # Didn't find anything. Oh, well.
     return;
 }
@@ -77,29 +80,38 @@
         warn "$ENV{REQUEST_URI} ($target)\n";
         warn "\t$_ => " . param( $_ ) . "\n" for param();
 
-        my $stdout;
         local $ENV{CGI_APP_RETURN_ONLY} = 1;
         (local $ENV{PATH_INFO} = $ENV{PATH_INFO}) =~ s/\A\Q$path//;
 
-        if ($target->isa('CGI::Application::Dispatch')) {
-          $stdout = $target->dispatch;
+        if (-d $target && -x $target) {
+	  return $self->serve_static($cgi, $target);
+	}
+	elsif ($target->isa('CGI::Application::Dispatch')) {
+	  return $self->_serve_response($target->dispatch);
         } elsif ($target->isa('CGI::Application')) {
           if (!defined blessed $target) {
-            $stdout = $target->new->run;
+	    return $self->_serve_response($target->new->run);
           } else {
-            $stdout = $target->run;
+	    return $self->_serve_response($target->run);
           }
-        } else {
-          confess "Target must be a CGI::Application or CGI::Application::Dispatch subclass\n";
+	}
+	else {
+          confess "Target must be a CGI::Application or CGI::Application::Dispatch subclass or the name of a directory that exists and is readable.\n";
         }
-
-        my $response = $self->_build_response( $stdout );
-        print $response->as_string;
     } else {
         return $self->serve_static($cgi, $self->document_root);
     } 
 }
 
+sub _serve_response {
+  my ( $self, $stdout ) = @_;
+
+  my $response = $self->_build_response( $stdout );
+  print $response->as_string();
+
+  return 1;			# Like ...Simple::Static::serve_static does
+}
+
 # Shamelessly stolen from HTTP::Request::AsCGI by chansen
 sub _build_response {
     my ( $self, $stdout ) = @_;
@@ -166,6 +178,10 @@
 =head1 SYNOPSIS
 
   use CGI::Application::Server;
+  use MyCGIApp;
+  use MyCGIApp::Admin;
+  use MyCGI::App::Account::Dispatch;
+  use MyCGIApp::DefaultApp;
 
   my $server = CGI::Application::Server->new();
  
@@ -173,17 +189,19 @@
   
   $server->document_root('./htdocs');
   $server->entry_points({
+      '/'          => 'MyCGIApp::DefaultApp',
       '/index.cgi' => 'MyCGIApp',
       '/admin'     => 'MyCGIApp::Admin',
       '/account'   => 'MyCGIApp::Account::Dispatch',
       '/users'     => $object,
+      '/static'    => '/usr/local/htdocs',
   });
   $server->run();
 
 =head1 DESCRIPTION
 
 This is a simple HTTP server for for use during development with 
-L<CGI::Appliaction>. At this moment, it serves our needs in a 
+L<CGI::Application>. At this moment, it serves our needs in a 
 very basic way. The plan is to release early and release often, 
 and add features when we need them. That said, we welcome any 
 and all patches, tests and feature requests (the ones with which 
@@ -207,7 +225,8 @@
 
 This accepts a HASH reference in C<$entry_points>, which maps server entry
 points (uri) to L<CGI::Application> or L<CGI::Application::Dispatch> class
-names or objects. See the L<SYNOPSIS> above for examples.
+names or objects or to directories from which static content will be served
+by HTTP::Server::Simple::Static.  See the L<SYNOPSIS> above for examples.
 
 =item B<is_valid_entry_point ($uri)>
 




More information about the Pkg-perl-cvs-commits mailing list