r69083 - in /trunk/libplack-perl: ./ debian/ lib/ lib/Plack/ lib/Plack/App/ lib/Plack/Middleware/ lib/Plack/Server/ scripts/ t/Plack-Handler/ t/Plack-Middleware/ t/Plack-Middleware/cascade/ t/Plack-Middleware/recursive/ t/Plack-Middleware/stacktrace/

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Sat Feb 19 14:07:35 UTC 2011


Author: jawnsy-guest
Date: Sat Feb 19 14:06:54 2011
New Revision: 69083

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=69083
Log:
TODO: decide if there should be a Provides: plack involved here
* Move eloy's copyright back to debian/* (somehow it landed in
the clause for inc/Module/*)

Added:
    trunk/libplack-perl/t/Plack-Middleware/cascade/
      - copied from r69061, branches/upstream/libplack-perl/current/t/Plack-Middleware/cascade/
    trunk/libplack-perl/t/Plack-Middleware/stacktrace/
      - copied from r69061, branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace/
Removed:
    trunk/libplack-perl/t/Plack-Middleware/cascade.t
    trunk/libplack-perl/t/Plack-Middleware/cascade_streaming.t
    trunk/libplack-perl/t/Plack-Middleware/stacktrace.t
    trunk/libplack-perl/t/Plack-Middleware/stacktrace_force.t
    trunk/libplack-perl/t/Plack-Middleware/stacktrace_streaming.t
    trunk/libplack-perl/t/Plack-Middleware/stacktrace_utf8.t
Modified:
    trunk/libplack-perl/Changes
    trunk/libplack-perl/MANIFEST
    trunk/libplack-perl/META.yml
    trunk/libplack-perl/README
    trunk/libplack-perl/debian/changelog
    trunk/libplack-perl/debian/copyright
    trunk/libplack-perl/lib/Plack.pm
    trunk/libplack-perl/lib/Plack/App/Cascade.pm
    trunk/libplack-perl/lib/Plack/Builder.pm
    trunk/libplack-perl/lib/Plack/Component.pm
    trunk/libplack-perl/lib/Plack/Loader.pm
    trunk/libplack-perl/lib/Plack/Middleware.pm
    trunk/libplack-perl/lib/Plack/Middleware/Recursive.pm
    trunk/libplack-perl/lib/Plack/Request.pm
    trunk/libplack-perl/lib/Plack/Response.pm
    trunk/libplack-perl/lib/Plack/Server/ServerSimple.pm
    trunk/libplack-perl/lib/Plack/Util.pm
    trunk/libplack-perl/scripts/plackup
    trunk/libplack-perl/t/Plack-Handler/fcgi_client.t
    trunk/libplack-perl/t/Plack-Middleware/recursive/throw.t

Modified: trunk/libplack-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libplack-perl/Changes?rev=69083&op=diff
==============================================================================
--- trunk/libplack-perl/Changes (original)
+++ trunk/libplack-perl/Changes Sat Feb 19 14:06:54 2011
@@ -1,12 +1,18 @@
 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.9968  Wed Feb  9 19:07:48 PST 2011
+        - Fixed Recursive middleware to rethrow unknown exceptions. #166 (reported by waba)
+        - Document response_cb. #121
+        - Plack::Loader to print errors if it is really a compilation error
+        - Fixed the Cascade app to work with all 404 responses with the streaming interface. #171 (reported by eevee)
 
 0.9967  Tue Jan 25 14:26:37 PST 2011
         - Fixed StackTrace to require D::ST::WithLexicals 0.08 that supports 'message' (doy)
 
 0.9966  Tue Jan 25 12:00:25 PST 2011
-        - Fixed a memory leak in SimploLogger (vti)
+        - Fixed a memory leak in SimpleLogger (vti)
         - Support %v in AccessLog (Ranguard)
         - Force set CONTENT_LENGTH in req_to_psgi when $content is given to HTTP::Request (timbunce) #150
         - Fixed a case where SCRIPT_NAME and PATH_INFO can both get empty in req_to_psgi (doy) #163

Modified: trunk/libplack-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libplack-perl/MANIFEST?rev=69083&op=diff
==============================================================================
--- trunk/libplack-perl/MANIFEST (original)
+++ trunk/libplack-perl/MANIFEST Sat Feb 19 14:06:54 2011
@@ -164,8 +164,8 @@
 t/Plack-Middleware/auth_basic_env.t
 t/Plack-Middleware/auth_basic_simple.t
 t/Plack-Middleware/bufferedstreaming.t
-t/Plack-Middleware/cascade.t
-t/Plack-Middleware/cascade_streaming.t
+t/Plack-Middleware/cascade/basic.t
+t/Plack-Middleware/cascade/streaming.t
 t/Plack-Middleware/cgi-bin/hello.cgi
 t/Plack-Middleware/cgi-bin/hello.py
 t/Plack-Middleware/cgi-bin/hello2.cgi
@@ -205,10 +205,10 @@
 t/Plack-Middleware/runtime.t
 t/Plack-Middleware/simple_content_filter.t
 t/Plack-Middleware/simple_logger.t
-t/Plack-Middleware/stacktrace.t
-t/Plack-Middleware/stacktrace_force.t
-t/Plack-Middleware/stacktrace_streaming.t
-t/Plack-Middleware/stacktrace_utf8.t
+t/Plack-Middleware/stacktrace/basic.t
+t/Plack-Middleware/stacktrace/force.t
+t/Plack-Middleware/stacktrace/streaming.t
+t/Plack-Middleware/stacktrace/utf8.t
 t/Plack-Middleware/static.t
 t/Plack-Middleware/static.txt
 t/Plack-Middleware/static_env.t

Modified: trunk/libplack-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libplack-perl/META.yml?rev=69083&op=diff
==============================================================================
--- trunk/libplack-perl/META.yml (original)
+++ trunk/libplack-perl/META.yml Sat Feb 19 14:06:54 2011
@@ -40,4 +40,4 @@
   homepage: http://plackperl.org
   license: http://dev.perl.org/licenses/
   repository: git://github.com/miyagawa/Plack.git
-version: 0.9967
+version: 0.9968

Modified: trunk/libplack-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libplack-perl/README?rev=69083&op=diff
==============================================================================
--- trunk/libplack-perl/README (original)
+++ trunk/libplack-perl/README Sat Feb 19 14:06:54 2011
@@ -133,7 +133,7 @@
     The following copyright notice applies to all the files provided in this
     distribution, including binary files, unless explicitly noted otherwise.
 
-    Copyright 2009-2010 Tatsuhiko Miyagawa
+    Copyright 2009-2011 Tatsuhiko Miyagawa
 
 CONTRIBUTORS
     Yuval Kogman (nothingmuch)

Modified: trunk/libplack-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libplack-perl/debian/changelog?rev=69083&op=diff
==============================================================================
--- trunk/libplack-perl/debian/changelog (original)
+++ trunk/libplack-perl/debian/changelog Sat Feb 19 14:06:54 2011
@@ -1,8 +1,14 @@
-libplack-perl (0.9967-1) UNRELEASED; urgency=low
+libplack-perl (0.9968-1) UNRELEASED; urgency=low
+
+  TODO: decide if there should be a Provides: plack involved here
 
   * New upstream release
 
- -- Krzysztof Krzyżaniak (eloy) <eloy at debian.org>  Tue, 08 Feb 2011 12:58:30 +0100
+  [ Jonathan Yu ]
+  * Move eloy's copyright back to debian/* (somehow it landed in
+    the clause for inc/Module/*)
+
+ -- Jonathan Yu <jawnsy at cpan.org>  Fri, 18 Feb 2011 23:25:32 -0500
 
 libplack-perl (0.9963-1) unstable; urgency=low
 

Modified: trunk/libplack-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libplack-perl/debian/copyright?rev=69083&op=diff
==============================================================================
--- trunk/libplack-perl/debian/copyright (original)
+++ trunk/libplack-perl/debian/copyright Sat Feb 19 14:06:54 2011
@@ -4,19 +4,19 @@
 Source: http://search.cpan.org/dist/Plack/
 
 Files: *
-Copyright: 2009-2010, Tatsuhiko Miyagawa <miyagawa at bulknews.net>
+Copyright: 2009-2011, Tatsuhiko Miyagawa <miyagawa at bulknews.net>
 License: Artistic or GPL-1+
 
 Files: inc/Module/*
 Copyright: 2002-2010, Adam Kennedy <adamk at cpan.org>
  2002-2010, Audrey Tang <autrijus at autrijus.org>
  2002-2010, Brian Ingerson <ingy at cpan.org>
- 2010-2011, Krzysztof Krzyżaniak (eloy) <eloy at debian.org>
 License: Artistic or GPL-1+
 
 Files: debian/*
-Copyright: 2010, Jonathan Yu <jawnsy at cpan.org>
- 2010, 2011, gregor herrmann <gregoa at debian.org>
+Copyright: 2010-2011, Jonathan Yu <jawnsy at cpan.org>
+ 2010-2011, Krzysztof Krzyżaniak (eloy) <eloy at debian.org>
+ 2010-2011, gregor herrmann <gregoa at debian.org>
  2010, Iñigo Tejedor Arrondo <poisonbit at gmail.com>
  2011, Alessandro Ghedini <al3xbio at gmail.com>
 License: Artistic or GPL-1+

Modified: trunk/libplack-perl/lib/Plack.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libplack-perl/lib/Plack.pm?rev=69083&op=diff
==============================================================================
--- trunk/libplack-perl/lib/Plack.pm (original)
+++ trunk/libplack-perl/lib/Plack.pm Sat Feb 19 14:06:54 2011
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use 5.008_001;
-our $VERSION = '0.9967';
+our $VERSION = '0.9968';
 $VERSION = eval $VERSION;
 
 1;
@@ -171,7 +171,7 @@
 this distribution, including binary files, unless explicitly noted
 otherwise.
 
-Copyright 2009-2010 Tatsuhiko Miyagawa
+Copyright 2009-2011 Tatsuhiko Miyagawa
 
 =head1 CONTRIBUTORS
 

Modified: trunk/libplack-perl/lib/Plack/App/Cascade.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libplack-perl/lib/Plack/App/Cascade.pm?rev=69083&op=diff
==============================================================================
--- trunk/libplack-perl/lib/Plack/App/Cascade.pm (original)
+++ trunk/libplack-perl/lib/Plack/App/Cascade.pm Sat Feb 19 14:06:54 2011
@@ -38,7 +38,7 @@
         };
 
         for my $app (@{$self->apps || []}) {
-            $res = $app->($env);
+            my $res = $app->($env);
             if (ref $res eq 'CODE') {
                 $res->($respond_wrapper);
             } else {

Modified: trunk/libplack-perl/lib/Plack/Builder.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libplack-perl/lib/Plack/Builder.pm?rev=69083&op=diff
==============================================================================
--- trunk/libplack-perl/lib/Plack/Builder.pm (original)
+++ trunk/libplack-perl/lib/Plack/Builder.pm Sat Feb 19 14:06:54 2011
@@ -124,72 +124,71 @@
       enable "Plack::Middleware::Foo";
       enable "Plack::Middleware::Bar", opt => "val";
       enable "Plack::Middleware::Baz";
+      $app;
+  };
+
+  # use URLMap
+
+  builder {
+      mount "/foo" => builder {
+          enable "Plack::Middleware::Foo";
+          $app;
+      };
+
+      mount "/bar" => $app2;
+      mount "http://example.com/" => builder { $app3 };
+  };
+
+  # using OO interface
+
+  my $builder = Plack::Builder->new();
+  $builder->add_middleware('Foo', opt => 1);
+  $app = $builder->mount('/app' => $app);
+  $app = $builder->to_app($app);
+
+=head1 DESCRIPTION
+
+Plack::Builder gives you a quick domain specific language (DSL) to
+wrap your application with Plack::Middleware subclasses. The
+middleware you're trying to use should use L<Plack::Middleware> as a
+base class to use this DSL, inspired by Rack::Builder.
+
+Whenever you call C<enable> on any middleware, the middleware app is
+pushed to the stack inside the builder, and then reversed when it
+actually creates a wrapped application handler, so:
+
+  builder {
+      enable "Plack::Middleware::Foo";
+      enable "Plack::Middleware::Bar", opt => "val";
+      $app;
+  };
+
+is syntactically equal to:
+
+  $app = Plack::Middleware::Bar->wrap($app, opt => "val");
+  $app = Plack::Middleware::Foo->wrap($app);
+
+In other words, you're supposed to C<enable> middleware from outer to inner.
+
+=head1 INLINE MIDDLEWARE
+
+Plack::Builder allows you to code middleware inline using a nested
+code reference.
+
+If the first argument to C<enable> is a code reference, it will be
+passed an C<$app> and is supposed to return another code reference
+which is PSGI application that consumes C<$env> in runtime. So:
+
+  builder {
       enable sub {
           my $app = shift;
           sub {
               my $env = shift;
-              $app->($env);
+              # do preprocessing
+              my $res = $app->($env);
+              # do postprocessing
+              return $res;
           };
-      };
-      $app;
-  };
-
-  # use URLMap
-
-  builder {
-      mount "/foo" => builder {
-          enable "Plack::Middleware::Foo";
-          $app;
-      };
-
-      mount "/bar" => $app2;
-      mount "http://example.com/" => builder { $app3 };
-  };
-
-  # using OO interface
-
-  my $builder = Plack::Builder->new();
-  $builder->add_middleware('Foo', opt => 1);
-  $app = $builder->mount('/app' => $app);
-  $app = $builder->to_app($app);
-
-=head1 DESCRIPTION
-
-Plack::Builder gives you a quick domain specific language (DSL) to
-wrap your application with Plack::Middleware subclasses. The
-middleware you're trying to use should use L<Plack::Middleware> as a
-base class to use this DSL, inspired by Rack::Builder.
-
-Whenever you call C<enable> on any middleware, the middleware app is
-pushed to the stack inside the builder, and then reversed when it
-actually creates a wrapped application handler, so:
-
-  builder {
-      enable "Plack::Middleware::Foo";
-      enable "Plack::Middleware::Bar", opt => "val";
-      $app;
-  };
-
-is syntactically equal to:
-
-  $app = Plack::Middleware::Bar->wrap($app, opt => "val");
-  $app = Plack::Middleware::Foo->wrap($app);
-
-In other words, you're supposed to C<enable> middleware from outer to inner.
-
-=head1 INLINE MIDDLEWARE
-
-Plack::Builder allows you to code middleware inline using a nested
-code reference.
-
-If the first argument to C<enable> is a code reference, it will be
-passed an C<$app> and is supposed to return another code reference
-which is PSGI application that consumes C<$env> in runtime. So:
-
-  builder {
-      enable sub {
-          my $app = shift;
-          sub { my $env = shift; $app->($env) };
       };
       $app;
   };

Modified: trunk/libplack-perl/lib/Plack/Component.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libplack-perl/lib/Plack/Component.pm?rev=69083&op=diff
==============================================================================
--- trunk/libplack-perl/lib/Plack/Component.pm (original)
+++ trunk/libplack-perl/lib/Plack/Component.pm Sat Feb 19 14:06:54 2011
@@ -109,6 +109,11 @@
 override this method, it is recommended to use C<prepare_app> and C<call>
 instead.
 
+=item response_cb
+
+This is a wrapper for C<response_cb> in L<Plack::Util>. See
+L<Plack::Middleware/RESPONSE CALLBACK> for details.
+
 =back
 
 =head1 OBJECT LIFECYCLE

Modified: trunk/libplack-perl/lib/Plack/Loader.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libplack-perl/lib/Plack/Loader.pm?rev=69083&op=diff
==============================================================================
--- trunk/libplack-perl/lib/Plack/Loader.pm (original)
+++ trunk/libplack-perl/lib/Plack/Loader.pm Sat Feb 19 14:06:54 2011
@@ -22,9 +22,11 @@
     my $server = try {
         $class->load($backend, @args);
     } catch {
-        warn "Autoloading '$backend' backend failed. Falling back to the Standalone. ",
-            "(You might need to install Plack::Handler::$backend from CPAN.  Caught error was: $_)\n"
-                if $ENV{PLACK_ENV} && $ENV{PLACK_ENV} eq 'development';
+        if (($ENV{PLACK_ENV}||'') eq 'development' or !/Can't locate/) {
+            warn "Autoloading '$backend' backend failed. Falling back to the Standalone. ",
+                "(You might need to install Plack::Handler::$backend from CPAN.  Caught error was: $_)\n"
+                    if $ENV{PLACK_ENV} && $ENV{PLACK_ENV} eq 'development';
+        }
         $class->load('Standalone' => @args);
     };
 

Modified: trunk/libplack-perl/lib/Plack/Middleware.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libplack-perl/lib/Plack/Middleware.pm?rev=69083&op=diff
==============================================================================
--- trunk/libplack-perl/lib/Plack/Middleware.pm (original)
+++ trunk/libplack-perl/lib/Plack/Middleware.pm Sat Feb 19 14:06:54 2011
@@ -72,7 +72,7 @@
 cache per-request data like C<$env> in your middleware object. See
 also L<Plack::Component/"OBJECT LIFECYCLE">.
 
-See L<Plack::Builder> how to actually enable middlewares in your
+See L<Plack::Builder> how to actually enable middleware in your
 I<.psgi> application file using the DSL. If you do not like our
 builder DSL, you can also use C<wrap> method to wrap your application
 with a middleware:
@@ -83,6 +83,106 @@
   $app = Plack::Middleware::Foo->wrap($app, %options);
   $app = Plack::Middleware::Bar->wrap($app, %options);
 
+=head1 RESPONSE CALLBACK
+
+The typical middleware is written like this:
+
+  package Plack::Middleware::Something;
+  use parent qw(Plack::Middleware);
+
+  sub call {
+      my($self, $env) = @_;
+      # pre-processing $env
+      my $res = $self->app->($env);
+      # post-processing $res
+      return $res;
+  }
+
+The tricky thing about post processing the response is that it could
+either be an immediate 3 element array ref, or a code reference that
+implements the delayed (streaming) interface.
+
+Dealing with these two types of response in each piece of middleware
+is pointless, so you're recommended to use the C<response_cb> wrapper
+function in L<Plack::Util> when implementing a post processing
+middleware.
+
+  my $res = $app->($env);
+  Plack::Util::response_cb($res, sub {
+      my $res = shift;
+      # do something with $res;
+  });
+
+The callback function gets a PSGI response as a 3 element array
+reference, and you can update the reference to implement the post
+processing.
+
+  package Plack::Middleware::Always500;
+  use parent qw(Plack::Middleware);
+  use Plack::Util;
+
+  sub call {
+      my($self, $env) = @_;
+      my $res  = $self->app->($env);
+      Plack::Util::response_cb($res, sub {
+          my $res = shift;
+          $res->[0] = 500;
+          return;
+      });
+  }
+
+In this example, the callback gets the C<$res> and updates its first
+element (status code) to 500. Using C<response_cb> makes sure that
+this works with the delayed response too.
+
+You're not required (and not recommended either) to return a new array
+reference - they will be simply ignored. You're suggested to
+explicitly return, unless you fiddle with the content filter callback
+(see below).
+
+Similarly, note that you have to keep the C<$res> reference when you
+swap the entire response.
+
+  Plack::Util::response_cb($res, sub {
+      my $res = shift;
+      $res = [ $new_status, $new_headers, $new_body ]; # THIS DOES NOT WORK
+      return;
+  });
+
+This does not work, since assigning a new anonymous array to C<$res>
+doesn't update the original PSGI response value. You should instead
+do:
+
+  Plack::Util::response_cb($res, sub {
+      my $res = shift;
+      @$res = ($new_status, $new_headers, $new_body); # THIS WORKS
+      return;
+  });
+
+The third element of PSGI response array ref is a body, and it could
+be either array ref or IO::Handle-ish object. The application could
+also make use of C<$writer> object if C<psgi.streaming> is in
+effect. Dealing with these variants is again really painful, and
+C<response_cb> can take care of that too, by allowing you to return a
+content filter as a code reference.
+
+  # replace all "Foo" in content body with "Bar"
+  Plack::Util::response_cb($res, sub {
+      my $res = shift;
+      return sub {
+          my $chunk = shift;
+          return unless defined $chunk;
+          $chunk =~ s/Foo/Bar/g;
+          return $chunk;
+      }
+  });
+
+The callback takes one argument C<$chunk> and your callback is
+expected to return the updated chunk. If the given C<$chunk> is undef,
+it means the stream has reached the end, so your callback should also
+return undef, or return the final chunk and return undef when called
+next time.
+
 =head1 SEE ALSO
 
 L<Plack> L<Plack::Builder> L<Plack::Component>

Modified: trunk/libplack-perl/lib/Plack/Middleware/Recursive.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libplack-perl/lib/Plack/Middleware/Recursive.pm?rev=69083&op=diff
==============================================================================
--- trunk/libplack-perl/lib/Plack/Middleware/Recursive.pm (original)
+++ trunk/libplack-perl/lib/Plack/Middleware/Recursive.pm Sat Feb 19 14:06:54 2011
@@ -17,6 +17,8 @@
     } catch {
         if (blessed $_ && $_->isa('Plack::Recursive::ForwardRequest')) {
             return $self->recurse_callback($env)->($_->path);
+        } else {
+            die $_; # rethrow
         }
     };
 
@@ -116,6 +118,14 @@
 Plack::Recursive::ForwardRequest anywhere in the code to I<forward>
 the current request (i.e. abort the current and redo the request).
 
+=head1 EXCEPTIONS
+
+This middleware passes through unknown exceptions to the outside
+middleware stack, so if you use this middleware with other exception
+handlers such as L<Plack::Middleware::StackTrace> or
+L<Plack::Middleware::HTTPExceptions>, be sure to wrap this so
+L<Plack::Middleware::Recursive> gets as inner as possible.
+
 =head1 AUTHORS
 
 Tatsuhiko Miyagawa

Modified: trunk/libplack-perl/lib/Plack/Request.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libplack-perl/lib/Plack/Request.pm?rev=69083&op=diff
==============================================================================
--- trunk/libplack-perl/lib/Plack/Request.pm (original)
+++ trunk/libplack-perl/lib/Plack/Request.pm Sat Feb 19 14:06:54 2011
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 use 5.008_001;
-our $VERSION = '0.9967';
+our $VERSION = '0.9968';
 $VERSION = eval $VERSION;
 
 use HTTP::Headers;

Modified: trunk/libplack-perl/lib/Plack/Response.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libplack-perl/lib/Plack/Response.pm?rev=69083&op=diff
==============================================================================
--- trunk/libplack-perl/lib/Plack/Response.pm (original)
+++ trunk/libplack-perl/lib/Plack/Response.pm Sat Feb 19 14:06:54 2011
@@ -1,7 +1,7 @@
 package Plack::Response;
 use strict;
 use warnings;
-our $VERSION = '0.9967';
+our $VERSION = '0.9968';
 $VERSION = eval $VERSION;
 
 use Plack::Util::Accessor qw(body status);

Modified: trunk/libplack-perl/lib/Plack/Server/ServerSimple.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libplack-perl/lib/Plack/Server/ServerSimple.pm?rev=69083&op=diff
==============================================================================
--- trunk/libplack-perl/lib/Plack/Server/ServerSimple.pm (original)
+++ trunk/libplack-perl/lib/Plack/Server/ServerSimple.pm Sat Feb 19 14:06:54 2011
@@ -1,6 +1,6 @@
 package Plack::Server::ServerSimple;
 use strict;
-our $VERSION = '0.9967';
+our $VERSION = '0.9968';
 $VERSION = eval $VERSION;
 
 use parent qw(Plack::Handler::HTTP::Server::Simple);

Modified: trunk/libplack-perl/lib/Plack/Util.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libplack-perl/lib/Plack/Util.pm?rev=69083&op=diff
==============================================================================
--- trunk/libplack-perl/lib/Plack/Util.pm (original)
+++ trunk/libplack-perl/lib/Plack/Util.pm Sat Feb 19 14:06:54 2011
@@ -490,6 +490,10 @@
 constructor. Handy to create when you need to create an IO stream
 object for input or errors.
 
+=item response_cb
+
+See L<Plack::Middleware/RESPONSE CALLBACK> for details.
+
 =back
 
 =cut

Modified: trunk/libplack-perl/scripts/plackup
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libplack-perl/scripts/plackup?rev=69083&op=diff
==============================================================================
--- trunk/libplack-perl/scripts/plackup (original)
+++ trunk/libplack-perl/scripts/plackup Sat Feb 19 14:06:54 2011
@@ -43,11 +43,11 @@
 
   #!/usr/bin/perl
   use MyApp;
-  my $app = MyApp->new;
-  my $handler = sub { $app->run_psgi(@_) };
-
-The last statement of C<app.psgi> should be a code reference that is a
-PSGI application.
+  my $application = MyApp->new;
+  my $app = sub { $application->run_psgi(@_) };
+
+The last statement of C<app.psgi>, in this case C<$app>, should be a
+code reference that is a PSGI application.
 
 =head1 ARGUMENTS
 

Modified: trunk/libplack-perl/t/Plack-Handler/fcgi_client.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libplack-perl/t/Plack-Handler/fcgi_client.t?rev=69083&op=diff
==============================================================================
--- trunk/libplack-perl/t/Plack-Handler/fcgi_client.t (original)
+++ trunk/libplack-perl/t/Plack-Handler/fcgi_client.t Sat Feb 19 14:06:54 2011
@@ -1,3 +1,5 @@
+use Carp::Always;
+
 use strict;
 use warnings;
 use Test::More;

Modified: trunk/libplack-perl/t/Plack-Middleware/recursive/throw.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libplack-perl/t/Plack-Middleware/recursive/throw.t?rev=69083&op=diff
==============================================================================
--- trunk/libplack-perl/t/Plack-Middleware/recursive/throw.t (original)
+++ trunk/libplack-perl/t/Plack-Middleware/recursive/throw.t Sat Feb 19 14:06:54 2011
@@ -13,6 +13,8 @@
         return [ 200, [ 'Content-Type', 'text/plain' ], [ "Hello $env->{QUERY_STRING}" ] ];
     } elsif ($env->{PATH_INFO} eq '/forwarded') {
         Plack::Recursive::ForwardRequest->throw("/forwarded2?q=bar");
+    } elsif ($env->{PATH_INFO} eq '/die') {
+        die "Foo";
     }
 
     Plack::Recursive::ForwardRequest->throw("/forwarded?q=bar");
@@ -26,6 +28,10 @@
     my $res = $cb->(GET "/");
     is $res->code, 200;
     is $res->content, "Hello q=bar";
+
+    $res = $cb->(GET "/die");
+    is $res->code, 500;
+    like $res->content, qr/Foo at t/;
 };
 
 done_testing;




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