r56591 - in /branches/upstream/libplack-perl/current: Changes META.yml README lib/Plack.pm lib/Plack/Middleware/Lint.pm lib/Plack/Request.pm lib/Plack/Response.pm lib/Plack/Runner.pm lib/Plack/Server/ServerSimple.pm scripts/plackup

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Tue Apr 20 16:59:54 UTC 2010


Author: jawnsy-guest
Date: Tue Apr 20 16:59:49 2010
New Revision: 56591

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=56591
Log:
[svn-upgrade] Integrating new upstream version, libplack-perl (0.9932)

Modified:
    branches/upstream/libplack-perl/current/Changes
    branches/upstream/libplack-perl/current/META.yml
    branches/upstream/libplack-perl/current/README
    branches/upstream/libplack-perl/current/lib/Plack.pm
    branches/upstream/libplack-perl/current/lib/Plack/Middleware/Lint.pm
    branches/upstream/libplack-perl/current/lib/Plack/Request.pm
    branches/upstream/libplack-perl/current/lib/Plack/Response.pm
    branches/upstream/libplack-perl/current/lib/Plack/Runner.pm
    branches/upstream/libplack-perl/current/lib/Plack/Server/ServerSimple.pm
    branches/upstream/libplack-perl/current/scripts/plackup

Modified: branches/upstream/libplack-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/Changes?rev=56591&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/Changes (original)
+++ branches/upstream/libplack-perl/current/Changes Tue Apr 20 16:59:49 2010
@@ -1,6 +1,11 @@
 Revision history for Perl extension Plack
 
 Take a look at http://github.com/miyagawa/Plack/issues for the planned changes before 1.0 release.
+
+0.9932  Mon Apr 19 15:23:55 JST 2010
+        - Enable Lint middleware by default in the development env
+        - Lint middleware now validates $app on startup
+        - Fixed documentations on middleware and handlers
 
 0.9931  Fri Apr 16 23:52:27 PDT 2010
         - replace kyoto.jpg test image file with smaller baybridge.jpg to strip down the tarball size

Modified: branches/upstream/libplack-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/META.yml?rev=56591&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/META.yml (original)
+++ branches/upstream/libplack-perl/current/META.yml Tue Apr 20 16:59:49 2010
@@ -38,4 +38,4 @@
 resources:
   license: http://dev.perl.org/licenses/
   repository: git://github.com/miyagawa/Plack.git
-version: 0.9931
+version: 0.9932

Modified: branches/upstream/libplack-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/README?rev=56591&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/README (original)
+++ branches/upstream/libplack-perl/current/README Tue Apr 20 16:59:49 2010
@@ -12,14 +12,17 @@
 MODULES AND UTILITIES
   Plack::Handler
     Plack::Handler and its subclasses contains adapters for web servers. We
-    have adapters for Standalone, CGI, FCGI, Apache, AnyEvent, Coro,
-    Danga::Socket and many server environments that you can run PSGI
-    applications on.
+    have adapters for the built-in standalone web server HTTP::Server::PSGI,
+    CGI, FCGI, Apache1, Apache2, Net::FastCGI and HTTP::Server::Simple
+    included in the core Plack distribution.
+
+    There are also many HTTP server implementations on CPAN that has Plack
+    handlers.
 
     See Plack::Handler how to write your own adapters.
 
   Plack::Loader
-    Plack::Loader is a loader to load one of Plack::Server adapters and run
+    Plack::Loader is a loader to load one of Plack::Handler adapters and run
     PSGI application code reference with it.
 
   Plack::Util

Modified: branches/upstream/libplack-perl/current/lib/Plack.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack.pm?rev=56591&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack.pm Tue Apr 20 16:59:49 2010
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use 5.008_001;
-our $VERSION = '0.9931';
+our $VERSION = '0.9932';
 $VERSION = eval $VERSION;
 
 1;
@@ -27,16 +27,23 @@
 =head2 Plack::Handler
 
 L<Plack::Handler> and its subclasses contains adapters for web
-servers. We have adapters for Standalone, CGI, FCGI, Apache, AnyEvent,
-Coro, Danga::Socket and many server environments that you can run PSGI
-applications on.
+servers. We have adapters for the built-in standalone web server
+L<HTTP::Server::PSGI>, L<CGI|Plack::Handler::CGI>,
+L<FCGI|Plack::Handler::FCGI>, L<Apache1|Plack::Handler::Apache1>,
+L<Apache2|Plack::Handler::Apache2>,
+L<Net::FastCGI|Plack::Handler::Net::FastCGI> and
+L<HTTP::Server::Simple|Plack::Handler::HTTP::Server::Simple> included
+in the core Plack distribution.
+
+There are also many HTTP server implementations on CPAN that has Plack
+handlers.
 
 See L<Plack::Handler> how to write your own adapters.
 
 =head2 Plack::Loader
 
-L<Plack::Loader> is a loader to load one of Plack::Server adapters and
-run PSGI application code reference with it.
+L<Plack::Loader> is a loader to load one of L<Plack::Handler> adapters
+and run PSGI application code reference with it.
 
 =head2 Plack::Util
 

Modified: branches/upstream/libplack-perl/current/lib/Plack/Middleware/Lint.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Middleware/Lint.pm?rev=56591&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Middleware/Lint.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Middleware/Lint.pm Tue Apr 20 16:59:49 2010
@@ -5,6 +5,16 @@
 use parent qw(Plack::Middleware);
 use Scalar::Util qw(blessed);
 use Plack::Util;
+
+sub wrap {
+    my($self, $app) = @_;
+
+    unless (ref $app eq 'CODE' or overload::Method($app, '&{}')) {
+        Carp::croak("PSGI app should be a code reference: $app");
+    }
+
+    $self->SUPER::wrap($app);
+}
 
 sub call {
     my $self = shift;
@@ -79,7 +89,7 @@
     my $croak = $streaming ? \&Carp::confess : \&Carp::croak;
 
     unless (ref($res) and ref($res) eq 'ARRAY' || ref($res) eq 'CODE') {
-        $croak->('response should be arrayref or coderef');
+        $croak->('response should be array ref or code ref');
     }
 
     if (ref $res eq 'CODE') {
@@ -137,6 +147,9 @@
 this middleware when you develop a new framework adapter or a new PSGI
 web server that implements the PSGI interface.
 
+This middleware is enabled by default when you run plackup or other
+launcher tools with the default environment I<development> value.
+
 =head1 AUTHOR
 
 Tatsuhiko Miyagawa

Modified: branches/upstream/libplack-perl/current/lib/Plack/Request.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Request.pm?rev=56591&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Request.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Request.pm Tue Apr 20 16:59:49 2010
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 use 5.008_001;
-our $VERSION = '0.9931';
+our $VERSION = '0.9932';
 $VERSION = eval $VERSION;
 
 use HTTP::Headers;

Modified: branches/upstream/libplack-perl/current/lib/Plack/Response.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Response.pm?rev=56591&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Response.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Response.pm Tue Apr 20 16:59:49 2010
@@ -1,7 +1,7 @@
 package Plack::Response;
 use strict;
 use warnings;
-our $VERSION = '0.9931';
+our $VERSION = '0.9932';
 $VERSION = eval $VERSION;
 
 use Plack::Util::Accessor qw(body status);

Modified: branches/upstream/libplack-perl/current/lib/Plack/Runner.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Runner.pm?rev=56591&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Runner.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Runner.pm Tue Apr 20 16:59:49 2010
@@ -176,14 +176,20 @@
         if $self->{loader} eq 'Restarter';
 }
 
+sub apply_middleware {
+    my($self, $app, $class, @args) = @_;
+
+    my $mw_class = Plack::Util::load_class($class, 'Plack::Middleware');
+    build { $mw_class->wrap($_[0], @args) } $app;
+}
+
 sub prepare_devel {
     my($self, $app) = @_;
 
-    require Plack::Middleware::StackTrace;
-    require Plack::Middleware::AccessLog;
-    $app = build { Plack::Middleware::StackTrace->wrap($_[0]) } $app;
+    $app = $self->apply_middleware($app, 'Lint');
+    $app = $self->apply_middleware($app, 'StackTrace');
     unless ($ENV{GATEWAY_INTERFACE}) {
-        $app = build { Plack::Middleware::AccessLog->wrap($_[0], logger => sub { print STDERR @_ }) } $app;
+        $app = $self->apply_middleware($app, 'AccessLog', logger => sub { print STDERR @_ });
     }
 
     push @{$self->{options}}, server_ready => sub {

Modified: branches/upstream/libplack-perl/current/lib/Plack/Server/ServerSimple.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Server/ServerSimple.pm?rev=56591&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Server/ServerSimple.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Server/ServerSimple.pm Tue Apr 20 16:59:49 2010
@@ -1,6 +1,6 @@
 package Plack::Server::ServerSimple;
 use strict;
-our $VERSION = '0.9931';
+our $VERSION = '0.9932';
 $VERSION = eval $VERSION;
 
 use parent qw(Plack::Handler::HTTP::Server::Simple);

Modified: branches/upstream/libplack-perl/current/scripts/plackup
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/scripts/plackup?rev=56591&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/scripts/plackup (original)
+++ branches/upstream/libplack-perl/current/scripts/plackup Tue Apr 20 16:59:49 2010
@@ -137,8 +137,8 @@
 The value can be anything but commonly used ones are C<development>,
 C<deployment> and C<test>.
 
-If it's set to C<development>, following middleware is enabled by
-default: L<AccessLog>, L<StackTrace>.
+If it's set to C<development>, following middleware components are
+enabled by default: I<AccessLog>, I<StackTrace> and I<Lint>.
 
 =item -r, --reload
 
@@ -158,12 +158,16 @@
 
 Specify the server loading subclass that implements how to run the
 server. Available options are I<Plack::Loader> (default), I<Restarter>
-(automatically set when C<-r> or C<-R> is used) and I<Shotgun>.
+(automatically set when C<-r> or C<-R> is used), I<Delayed> and
+I<Shotgun>.
+
+See L<Plack::Loader::Delayed> and L<Plack::Loader::Shotgun> when to
+use those loader types.
 
 =back
 
 Other options that starts with C<--> are passed through to the backend
-server. See each Plack::Server backend documentations to see which
+server. See each Plack::Handler backend documentations to see which
 options are available.
 
 =head1 SEE ALSO




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