r72567 - in /branches/upstream/libplack-perl/current: ./ lib/ lib/Plack/ lib/Plack/App/ lib/Plack/Loader/ lib/Plack/Middleware/ lib/Plack/Middleware/AccessLog/ lib/Plack/Server/ lib/Plack/Test/ scripts/ t/Plack-Builder/ t/Plack-Handler/ t/Plack-Loader/ t/Plack-Middleware/ t/Plack-Middleware/stacktrace/ t/Plack-Request/ t/Plack-Test/

ghedo-guest at users.alioth.debian.org ghedo-guest at users.alioth.debian.org
Wed Apr 13 09:26:26 UTC 2011


Author: ghedo-guest
Date: Wed Apr 13 09:26:08 2011
New Revision: 72567

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=72567
Log:
[svn-upgrade] new version libplack-perl (0.9976)

Added:
    branches/upstream/libplack-perl/current/t/Plack-Builder/builder.t
Removed:
    branches/upstream/libplack-perl/current/t/Plack-Handler/net_fastcgi.t
Modified:
    branches/upstream/libplack-perl/current/Changes
    branches/upstream/libplack-perl/current/MANIFEST
    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/App/Directory.pm
    branches/upstream/libplack-perl/current/lib/Plack/App/File.pm
    branches/upstream/libplack-perl/current/lib/Plack/Builder.pm
    branches/upstream/libplack-perl/current/lib/Plack/Component.pm
    branches/upstream/libplack-perl/current/lib/Plack/Loader.pm
    branches/upstream/libplack-perl/current/lib/Plack/Loader/Shotgun.pm
    branches/upstream/libplack-perl/current/lib/Plack/Middleware.pm
    branches/upstream/libplack-perl/current/lib/Plack/Middleware/AccessLog/Timed.pm
    branches/upstream/libplack-perl/current/lib/Plack/Middleware/NullLogger.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/lib/Plack/Test.pm
    branches/upstream/libplack-perl/current/lib/Plack/Test/MockHTTP.pm
    branches/upstream/libplack-perl/current/lib/Plack/Test/Server.pm
    branches/upstream/libplack-perl/current/scripts/plackup
    branches/upstream/libplack-perl/current/t/Plack-Loader/auto.t
    branches/upstream/libplack-perl/current/t/Plack-Middleware/chunked.t
    branches/upstream/libplack-perl/current/t/Plack-Middleware/component-leak.t
    branches/upstream/libplack-perl/current/t/Plack-Middleware/file.t
    branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace/sigdie.t
    branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace/utf8.t
    branches/upstream/libplack-perl/current/t/Plack-Middleware/urlmap_ports.t
    branches/upstream/libplack-perl/current/t/Plack-Request/double_port.t
    branches/upstream/libplack-perl/current/t/Plack-Request/upload-large.t
    branches/upstream/libplack-perl/current/t/Plack-Test/2args.t
    branches/upstream/libplack-perl/current/t/Plack-Test/hello_server.t

Modified: branches/upstream/libplack-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/Changes?rev=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/Changes (original)
+++ branches/upstream/libplack-perl/current/Changes Wed Apr 13 09:26:08 2011
@@ -1,6 +1,31 @@
 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.9976  Fri Apr  8 18:07:11 PDT 2011
+    [NEW FEATURES]
+        - Support setting content_type in App::File (ajgb)
+
+    [IMPROVEMENTS]
+        - Document fixes (jhannah)
+        - Skip bad tests failing on LWP 6 (daxim)
+
+0.99_75 Thu Mar 24 11:29:22 PDT 2011
+    [INCOMPATIBLE CHANGES]
+        - builder {} now always returns a PSGI code reference, instead of inconsistently
+          returning URLMap object when mount() is used. (reported by hoelzro)
+        - Plack::Runner now automatically calls ->parse_options() if it hasn't been called,
+          so the sane defaults for plackup can be applied. (reported by arcanez)
+
+    [BUG FIXES]
+        - Fixed the way to override %ENV to avoid test breakages in Win32 #179
+        - Properly append '/' when linking to a directory in Plack::App::Directory (theory)
+
+    [IMPROVEMENTS]
+        - Skips the current directory in Plack::App::Directory
+        - Plack::App::Directory now redirects to a canonical URL that has a trailing slash
+          just like Apache (hobbs)
+        - Fixed some typos and outdated information in the PODs
 
 0.9974  Thu Mar  3 20:55:28 PST 2011
         - Added a documentation about using relative URI paths beginning with //

Modified: branches/upstream/libplack-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/MANIFEST?rev=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/MANIFEST (original)
+++ branches/upstream/libplack-perl/current/MANIFEST Wed Apr 13 09:26:08 2011
@@ -141,6 +141,7 @@
 t/HTTP-Message-PSGI/path_info.t
 t/HTTP-Message-PSGI/utf8_req.t
 t/HTTP-Server-PSGI/post.t
+t/Plack-Builder/builder.t
 t/Plack-Builder/mount.t
 t/Plack-Builder/oo_interface.t
 t/Plack-Handler/apache1.t
@@ -150,7 +151,6 @@
 t/Plack-Handler/fcgi.t
 t/Plack-Handler/fcgi_client.t
 t/Plack-Handler/http_server_simple.t
-t/Plack-Handler/net_fastcgi.t
 t/Plack-Handler/standalone.t
 t/Plack-HTTPParser-PP/simple.t
 t/Plack-Loader/auto.t

Modified: branches/upstream/libplack-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/META.yml?rev=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/META.yml (original)
+++ branches/upstream/libplack-perl/current/META.yml Wed Apr 13 09:26:08 2011
@@ -40,4 +40,4 @@
   homepage: http://plackperl.org
   license: http://dev.perl.org/licenses/
   repository: git://github.com/miyagawa/Plack.git
-version: 0.9974
+version: 0.9976

Modified: branches/upstream/libplack-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/README?rev=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/README (original)
+++ branches/upstream/libplack-perl/current/README Wed Apr 13 09:26:08 2011
@@ -13,16 +13,16 @@
   Plack::Handler
     Plack::Handler and its subclasses contains adapters for web servers. We
     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.
+    CGI, FCGI, Apache1, Apache2 and HTTP::Server::Simple included in the
+    core Plack distribution.
 
-    There are also many HTTP server implementations on CPAN that has Plack
+    There are also many HTTP server implementations on CPAN that have Plack
     handlers.
 
-    See Plack::Handler how to write your own adapters.
+    See Plack::Handler when writing your own adapters.
 
   Plack::Loader
-    Plack::Loader is a loader to load one of Plack::Handler adapters and run
+    Plack::Loader is a loader to load one Plack::Handler adapter and run a
     PSGI application code reference with it.
 
   Plack::Util
@@ -30,9 +30,9 @@
     as well as middleware authors.
 
   .psgi files
-    PSGI application is a code reference but it's not easy to pass code
-    reference in the command line or configuration files, so Plack uses a
-    convention that you need a file named "app.psgi" or alike, which would
+    A PSGI application is a code reference but it's not easy to pass code
+    reference via the command line or configuration files, so Plack uses a
+    convention that you need a file named "app.psgi" or similar, which would
     be loaded (via perl's core function "do") to return the PSGI application
     code reference.
 
@@ -62,10 +62,10 @@
     can still be the same.
 
     If you want to write your own frontend that replaces, or adds
-    functionalities to plackup, take a look at Plack::Runner module.
+    functionalities to plackup, take a look at the Plack::Runner module.
 
   Plack::Middleware
-    PSGI middleware is a PSGI application that wraps existent PSGI
+    PSGI middleware is a PSGI application that wraps an existing PSGI
     application and plays both side of application and servers. From the
     servers the wrapped code reference still looks like and behaves exactly
     the same as PSGI applications.
@@ -85,7 +85,7 @@
     Plack::Response does the same to construct the response array reference.
 
   Plack::Test
-    Plack::Test is an unified interface to test your PSGI application using
+    Plack::Test is a unified interface to test your PSGI application using
     standard HTTP::Request and HTTP::Response pair with simple callbacks.
 
   Plack::Test::Suite

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=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack.pm Wed Apr 13 09:26:08 2011
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use 5.008_001;
-our $VERSION = '0.9974';
+our $VERSION = '0.9976';
 $VERSION = eval $VERSION;
 
 1;
@@ -31,20 +31,19 @@
 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<Apache2|Plack::Handler::Apache2> 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
+There are also many HTTP server implementations on CPAN that have Plack
 handlers.
 
-See L<Plack::Handler> how to write your own adapters.
+See L<Plack::Handler> when writing your own adapters.
 
 =head2 Plack::Loader
 
-L<Plack::Loader> is a loader to load one of L<Plack::Handler> adapters
-and run PSGI application code reference with it.
+L<Plack::Loader> is a loader to load one L<Plack::Handler> adapter
+and run a PSGI application code reference with it.
 
 =head2 Plack::Util
 
@@ -53,9 +52,9 @@
 
 =head2 .psgi files
 
-PSGI application is a code reference but it's not easy to pass code
-reference in the command line or configuration files, so Plack uses a
-convention that you need a file named C<app.psgi> or alike, which
+A PSGI application is a code reference but it's not easy to pass code
+reference via the command line or configuration files, so Plack uses a
+convention that you need a file named C<app.psgi> or similar, which
 would be loaded (via perl's core function C<do>) to return the PSGI
 application code reference.
 
@@ -87,11 +86,11 @@
 C<.psgi> application file can still be the same.
 
 If you want to write your own frontend that replaces, or adds
-functionalities to L<plackup>, take a look at L<Plack::Runner> module.
+functionalities to L<plackup>, take a look at the L<Plack::Runner> module.
 
 =head2 Plack::Middleware
 
-PSGI middleware is a PSGI application that wraps existent PSGI
+PSGI middleware is a PSGI application that wraps an existing PSGI
 application and plays both side of application and servers. From the
 servers the wrapped code reference still looks like and behaves
 exactly the same as PSGI applications.
@@ -115,7 +114,7 @@
 
 =head2 Plack::Test
 
-L<Plack::Test> is an unified interface to test your PSGI application
+L<Plack::Test> is a unified interface to test your PSGI application
 using standard L<HTTP::Request> and L<HTTP::Response> pair with simple
 callbacks.
 

Modified: branches/upstream/libplack-perl/current/lib/Plack/App/Directory.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/App/Directory.pm?rev=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/App/Directory.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/App/Directory.pm Wed Apr 13 09:26:08 2011
@@ -7,6 +7,7 @@
 use Plack::MIME;
 use DirHandle;
 use URI::Escape;
+use Plack::Request;
 
 # Stolen from rack/directory.rb
 my $dir_file = "<tr><td class='name'><a href='%s'>%s</a></td><td class='size'>%s</td><td class='type'>%s</td><td class='mtime'>%s</td></tr>";
@@ -42,6 +43,19 @@
     return -d $file || -f $file;
 }
 
+sub return_dir_redirect {
+    my ($self, $env) = @_;
+    my $uri = Plack::Request->new($env)->uri;
+    return [ 301,
+        [
+            'Location' => $uri . '/',
+            'Content-Type' => 'text/plain',
+            'Content-Length' => 8,
+        ],
+        [ 'Redirect' ],
+    ];
+}
+
 sub serve_path {
     my($self, $env, $dir, $fullpath) = @_;
 
@@ -49,29 +63,34 @@
         return $self->SUPER::serve_path($env, $dir, $fullpath);
     }
 
+    my $dir_url = $env->{SCRIPT_NAME} . $env->{PATH_INFO};
+
+    if ($dir_url !~ m{/$}) {
+        return $self->return_dir_redirect($env);
+    }
+
     my @files = ([ "../", "Parent Directory", '', '', '' ]);
 
     my $dh = DirHandle->new($dir);
     my @children;
     while (defined(my $ent = $dh->read)) {
+        next if $ent eq '.';
         push @children, $ent;
     }
 
     for my $basename (sort { $a cmp $b } @children) {
         my $file = "$dir/$basename";
-        my $url = $env->{SCRIPT_NAME} . $env->{PATH_INFO};
-        $url .= '/' unless $url =~ m{/$};
-        $url .= $basename;
+        my $url = $dir_url . $basename;
 
         my $is_dir = -d $file;
         my @stat = stat _;
+
+        $url = join '/', map {uri_escape($_)} split m{/}, $url;
 
         if ($is_dir) {
             $basename .= "/";
             $url      .= "/";
         }
-
-        $url = join '/', map {uri_escape($_)} split m{/}, $url;
 
         my $mime_type = $is_dir ? 'directory' : ( Plack::MIME->mime_type($file) || 'text/plain' );
         push @files, [ $url, $basename, $stat[7], $mime_type, HTTP::Date::time2str($stat[9]) ];

Modified: branches/upstream/libplack-perl/current/lib/Plack/App/File.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/App/File.pm?rev=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/App/File.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/App/File.pm Wed Apr 13 09:26:08 2011
@@ -8,7 +8,7 @@
 use Plack::MIME;
 use HTTP::Date;
 
-use Plack::Util::Accessor qw( root file encoding );
+use Plack::Util::Accessor qw( root file content_type encoding );
 
 sub should_handle {
     my($self, $file) = @_;
@@ -85,7 +85,8 @@
 sub serve_path {
     my($self, $env, $file) = @_;
 
-    my $content_type = Plack::MIME->mime_type($file) || 'text/plain';
+    my $content_type = $self->content_type || Plack::MIME->mime_type($file)
+                       || 'text/plain';
 
     if ($content_type =~ m!^text/!) {
         $content_type .= "; charset=" . ($self->encoding || "utf-8");
@@ -171,6 +172,11 @@
 
 Set the file encoding for text files. Defaults to C<utf-8>.
 
+=item content_type
+
+Set the file content type. If not set L<Plack::MIME> will try to detect it
+based on the file extension or fall back to C<text/plain>.
+
 =back
 
 =head1 AUTHOR

Modified: branches/upstream/libplack-perl/current/lib/Plack/Builder.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Builder.pm?rev=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Builder.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Builder.pm Wed Apr 13 09:26:08 2011
@@ -97,9 +97,14 @@
     };
 
     my $app = $block->();
-    if ($mount_is_called && $app ne $urlmap) {
-        Carp::carp("You used mount() in a builder block, but the last line (app) isn't using mount().\n" .
+
+    if ($mount_is_called) {
+        if ($app ne $urlmap) {
+            Carp::carp("You used mount() in a builder block, but the last line (app) isn't using mount().\n" .
                        "This causes all mount() mappings to be ignored. See perldoc Plack::Builder for details.");
+        } else {
+            $app = $app->to_app;
+        }
     }
 
     $self->to_app($app);

Modified: branches/upstream/libplack-perl/current/lib/Plack/Component.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Component.pm?rev=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Component.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Component.pm Wed Apr 13 09:26:08 2011
@@ -128,7 +128,7 @@
 You can check if it is running in a persistent environment by checking
 C<psgi.run_once> key in the C<$env> being true (non-persistent) or
 false (persistent), but it is best for you to write your middleware
-safe in the persistent environment. To accomplish that, you should
+safely for a persistent environment. To accomplish that, you should
 avoid saving per-request data like C<$env> in your object.
 
 =head1 BACKWARDS COMPATIBILITY

Modified: branches/upstream/libplack-perl/current/lib/Plack/Loader.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Loader.pm?rev=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Loader.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Loader.pm Wed Apr 13 09:26:08 2011
@@ -61,11 +61,13 @@
 sub guess {
     my $class = shift;
 
-    return $ENV{PLACK_SERVER} if $ENV{PLACK_SERVER};
+    my $env = $class->env;
 
-    if ($ENV{PHP_FCGI_CHILDREN} || $ENV{FCGI_ROLE} || $ENV{FCGI_SOCKET_PATH}) {
+    return $env->{PLACK_SERVER} if $env->{PLACK_SERVER};
+
+    if ($env->{PHP_FCGI_CHILDREN} || $env->{FCGI_ROLE} || $env->{FCGI_SOCKET_PATH}) {
         return "FCGI";
-    } elsif ($ENV{GATEWAY_INTERFACE}) {
+    } elsif ($env->{GATEWAY_INTERFACE}) {
         return "CGI";
     } elsif (exists $INC{"AnyEvent.pm"}) {
         return "Twiggy";
@@ -79,6 +81,8 @@
         return "Standalone";
     }
 }
+
+sub env { \%ENV }
 
 sub run {
     my($self, $server, $builder) = @_;

Modified: branches/upstream/libplack-perl/current/lib/Plack/Loader/Shotgun.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Loader/Shotgun.pm?rev=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Loader/Shotgun.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Loader/Shotgun.pm Wed Apr 13 09:26:08 2011
@@ -64,7 +64,7 @@
 
   plackup -L Shotgun
 
-=head1 DESCRIPTIOM
+=head1 DESCRIPTION
 
 Shotgun loader delays the compilation and execution of your
 application until the runtime. When a new request comes in, this forks

Modified: branches/upstream/libplack-perl/current/lib/Plack/Middleware.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Middleware.pm?rev=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Middleware.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Middleware.pm Wed Apr 13 09:26:08 2011
@@ -68,7 +68,7 @@
 
 Your middleware object is created at a PSGI application compile time
 and is persistent during the web server life cycle (unless it is a
-non-persisten environment such as CGI), so you should never set or
+non-persistent environment such as CGI), so you should never set or
 cache per-request data like C<$env> in your middleware object. See
 also L<Plack::Component/"OBJECT LIFECYCLE">.
 

Modified: branches/upstream/libplack-perl/current/lib/Plack/Middleware/AccessLog/Timed.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Middleware/AccessLog/Timed.pm?rev=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Middleware/AccessLog/Timed.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Middleware/AccessLog/Timed.pm Wed Apr 13 09:26:08 2011
@@ -60,7 +60,7 @@
 
   builder {
       enable "Plack::Middleware::AccessLog::Timed",
-          format => ""%v %h %l %u %t \"%r\" %>s %b %D";
+          format => "%v %h %l %u %t \"%r\" %>s %b %D";
       $app;
   };
 

Modified: branches/upstream/libplack-perl/current/lib/Plack/Middleware/NullLogger.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Middleware/NullLogger.pm?rev=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Middleware/NullLogger.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Middleware/NullLogger.pm Wed Apr 13 09:26:08 2011
@@ -20,7 +20,7 @@
 
   enable "NullLogger";
 
-=head1 DESCRIPTIOM
+=head1 DESCRIPTION
 
 NullLogger is a middleware component that receives logs and does
 nothing but discarding them. Might be useful to shut up all the logs

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=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Request.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Request.pm Wed Apr 13 09:26:08 2011
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 use 5.008_001;
-our $VERSION = '0.9974';
+our $VERSION = '0.9976';
 $VERSION = eval $VERSION;
 
 use HTTP::Headers;
@@ -363,7 +363,7 @@
 
 If you're writing a web application, not a framework, then you're
 encouraged to use one of the web application frameworks that support
-PSGI, or see L<Piglet> or L<HTTP::Engine> to provide higher level
+PSGI, or see modules like L<HTTP::Engine> to provide higher level
 Request and Response API on top of PSGI.
 
 =head1 METHODS

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=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Response.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Response.pm Wed Apr 13 09:26:08 2011
@@ -1,7 +1,7 @@
 package Plack::Response;
 use strict;
 use warnings;
-our $VERSION = '0.9974';
+our $VERSION = '0.9976';
 $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=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Runner.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Runner.pm Wed Apr 13 09:26:08 2011
@@ -231,6 +231,10 @@
         return $self->run;
     }
 
+    unless ($self->{options}) {
+        $self->parse_options();
+    }
+
     my @args = @_ ? @_ : @{$self->{argv}};
 
     $self->setup;

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=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Server/ServerSimple.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Server/ServerSimple.pm Wed Apr 13 09:26:08 2011
@@ -1,6 +1,6 @@
 package Plack::Server::ServerSimple;
 use strict;
-our $VERSION = '0.9974';
+our $VERSION = '0.9976';
 $VERSION = eval $VERSION;
 
 use parent qw(Plack::Handler::HTTP::Server::Simple);

Modified: branches/upstream/libplack-perl/current/lib/Plack/Test.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Test.pm?rev=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Test.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Test.pm Wed Apr 13 09:26:08 2011
@@ -55,7 +55,7 @@
 
 =head1 DESCRIPTION
 
-Plack::Test is an unified interface to test PSGI applications using
+Plack::Test is a unified interface to test PSGI applications using
 standard HTTP::Request and HTTP::Response objects. It also allows you
 to run PSGI applications in various ways, by default using C<MockHTTP>
 backend but can also use C<Server> backend, which uses one of

Modified: branches/upstream/libplack-perl/current/lib/Plack/Test/MockHTTP.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Test/MockHTTP.pm?rev=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Test/MockHTTP.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Test/MockHTTP.pm Wed Apr 13 09:26:08 2011
@@ -43,7 +43,7 @@
 
 =head1 DESCRIPTION
 
-Plack::Test::MockHTTP is an utility to run PSGI application given
+Plack::Test::MockHTTP is a utility to run PSGI application given
 HTTP::Request objects and return HTTP::Response object out of PSGI
 application response. See L<Plack::Test> how to use this module.
 

Modified: branches/upstream/libplack-perl/current/lib/Plack/Test/Server.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Test/Server.pm?rev=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Test/Server.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Test/Server.pm Wed Apr 13 09:26:08 2011
@@ -43,7 +43,7 @@
 
 =head1 DESCRIPTION
 
-Plack::Test::Server is an utility to run PSGI application with Plack
+Plack::Test::Server is a utility to run PSGI application with Plack
 server implementations, and run the live HTTP tests with the server
 using a callback. See L<Plack::Test> how to use this module.
 

Modified: branches/upstream/libplack-perl/current/scripts/plackup
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/scripts/plackup?rev=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/scripts/plackup (original)
+++ branches/upstream/libplack-perl/current/scripts/plackup Wed Apr 13 09:26:08 2011
@@ -108,7 +108,7 @@
 
 The interface a TCP based server daemon binds to. Defauts to undef,
 which lets most server backends bind the any (*) interface. This
-opeion doesn't mean anything if the server does not support TCP
+option doesn't mean anything if the server does not support TCP
 socket.
 
 =item -p, --port

Added: branches/upstream/libplack-perl/current/t/Plack-Builder/builder.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Builder/builder.t?rev=72567&op=file
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Builder/builder.t (added)
+++ branches/upstream/libplack-perl/current/t/Plack-Builder/builder.t Wed Apr 13 09:26:08 2011
@@ -1,0 +1,9 @@
+use strict;
+use Test::More tests => 1;
+use Plack::Builder;
+
+my $app = builder {
+    mount "/" => sub { [ 200, ["Content-Type", "text/plain"], ["Hello"] ] };
+};
+
+is ref($app), 'CODE';

Modified: branches/upstream/libplack-perl/current/t/Plack-Loader/auto.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Loader/auto.t?rev=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Loader/auto.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Loader/auto.t Wed Apr 13 09:26:08 2011
@@ -12,7 +12,7 @@
 $INC{"Plack/Handler/Twiggy.pm"} = __FILE__;
 sub Plack::Handler::Twiggy::new { bless {}, shift }
 
-local %ENV = ();
+local *Plack::Loader::env = sub { return {} };
 
 eval {
     my $loader = Plack::Loader->new;

Modified: branches/upstream/libplack-perl/current/t/Plack-Middleware/chunked.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Middleware/chunked.t?rev=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Middleware/chunked.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Middleware/chunked.t Wed Apr 13 09:26:08 2011
@@ -1,13 +1,13 @@
 use strict;
 use Test::More;
-use Test::Requires qw(IO::Handle::Util);
+use Test::Requires qw(IO::Handle::Util LWP::Protocol::http10);
 use IO::Handle::Util qw(:io_from);
 use HTTP::Request::Common;
 use Plack::Test;
 use Plack::Middleware::Chunked;
 $Plack::Test::Impl = "Server";
 
-local %ENV = (); # use HTTP::Server::PSGI
+local $ENV{PLACK_SERVER} = "HTTP::Server::PSGI";
 
 my @app = (
     sub { [ 200, [], [ 'Hello World' ] ] },
@@ -28,7 +28,6 @@
     for my $proto (qw( HTTP/1.1 HTTP/1.0 )) {
         my $is_http_10 = $proto eq 'HTTP/1.0';
         if ($is_http_10) {
-            require LWP::Protocol::http10;
             LWP::Protocol::implementor('http', 'LWP::Protocol::http10');
         }
 

Modified: branches/upstream/libplack-perl/current/t/Plack-Middleware/component-leak.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Middleware/component-leak.t?rev=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Middleware/component-leak.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Middleware/component-leak.t Wed Apr 13 09:26:08 2011
@@ -39,7 +39,7 @@
 use Plack::Test;
 use HTTP::Request::Common;
 $Plack::Test::Impl = "Server";
-local %ENV = (); # use HTTP::Server::PSGI
+local $ENV{PLACK_SERVER} = "HTTP::Server::PSGI";
 
 my $app = MyComponent->new;
 test_psgi( $app->to_app, sub {

Modified: branches/upstream/libplack-perl/current/t/Plack-Middleware/file.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Middleware/file.t?rev=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Middleware/file.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Middleware/file.t Wed Apr 13 09:26:08 2011
@@ -18,6 +18,23 @@
     is $res->code, 200;
 };
 
+my $app_content_type = Plack::App::File->new(
+    file => 'README',
+    content_type => 'text/x-readme'
+);
+
+test_psgi $app_content_type, sub {
+    my $cb = shift;
+
+    my $res = $cb->(GET "/");
+    is $res->code, 200;
+    like $res->content, qr/Plack/;
+
+    $res = $cb->(GET "/whatever");
+    is $res->content_type, 'text/x-readme';
+    is $res->code, 200;
+};
+
 
 
 done_testing;

Modified: branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace/sigdie.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace/sigdie.t?rev=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace/sigdie.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace/sigdie.t Wed Apr 13 09:26:08 2011
@@ -6,7 +6,7 @@
 use HTTP::Request::Common;
 
 $Plack::Test::Impl = "Server";
-local %ENV = (); # use HTTP::Server::PSGI
+local $ENV{PLACK_SERVER} = "HTTP::Server::PSGI";
 
 my $app = sub {
     $SIG{__DIE__} = sub {};

Modified: branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace/utf8.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace/utf8.t?rev=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace/utf8.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace/utf8.t Wed Apr 13 09:26:08 2011
@@ -7,7 +7,7 @@
 use HTTP::Request::Common;
 
 $Plack::Test::Impl = "Server";
-local %ENV = (); # use HTTP::Server::PSGI
+local $ENV{PLACK_SERVER} = "HTTP::Server::PSGI";
 
 my $app = Plack::Middleware::StackTrace->wrap(sub { die "Foo \x{30c6}" }, no_print_errors => 1);
 

Modified: branches/upstream/libplack-perl/current/t/Plack-Middleware/urlmap_ports.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Middleware/urlmap_ports.t?rev=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Middleware/urlmap_ports.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Middleware/urlmap_ports.t Wed Apr 13 09:26:08 2011
@@ -5,7 +5,7 @@
 use HTTP::Request::Common;
 
 $Plack::Test::Impl = "Server";
-local %ENV = (); # use HTTP::Server::PSGI
+local $ENV{PLACK_SERVER} = "HTTP::Server::PSGI";
 
 my $make_app = sub {
     my $name = shift;

Modified: branches/upstream/libplack-perl/current/t/Plack-Request/double_port.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Request/double_port.t?rev=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Request/double_port.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Request/double_port.t Wed Apr 13 09:26:08 2011
@@ -4,7 +4,7 @@
 use HTTP::Request::Common;
 
 $Plack::Test::Impl = 'Server';
-local %ENV = (); # use HTTP::Server::PSGI
+local $ENV{PLACK_SERVER} = "HTTP::Server::PSGI";
 
 my $app = sub {
     my $req = Plack::Request->new(shift);

Modified: branches/upstream/libplack-perl/current/t/Plack-Request/upload-large.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Request/upload-large.t?rev=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Request/upload-large.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Request/upload-large.t Wed Apr 13 09:26:08 2011
@@ -10,7 +10,7 @@
 my @backends = qw( Server MockHTTP );
 sub flip_backend { $Plack::Test::Impl = shift @backends }
 
-local %ENV = (); # use HTTP::Server::PSGI
+local $ENV{PLACK_SERVER} = "HTTP::Server::PSGI";
 
 my $app = sub {
     my $req = Plack::Request->new(shift);

Modified: branches/upstream/libplack-perl/current/t/Plack-Test/2args.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Test/2args.t?rev=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Test/2args.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Test/2args.t Wed Apr 13 09:26:08 2011
@@ -2,7 +2,7 @@
 use Test::More;
 use HTTP::Request::Common;
 $Plack::Test::Impl = "Server";
-local %ENV = (); # use HTTP::Server::PSGI
+local $ENV{PLACK_SERVER} = "HTTP::Server::PSGI";
 
 my $app = sub { return [ 200, [], [ "Hello" ] ] };
 

Modified: branches/upstream/libplack-perl/current/t/Plack-Test/hello_server.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Test/hello_server.t?rev=72567&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Test/hello_server.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Test/hello_server.t Wed Apr 13 09:26:08 2011
@@ -2,7 +2,7 @@
 use Plack::Test;
 
 $Plack::Test::Impl = "Server";
-local %ENV = (); # use HTTP::Server::PSGI
+local $ENV{PLACK_SERVER} = "HTTP::Server::PSGI";
 
 test_psgi
     client => sub {




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