r57509 - in /branches/upstream/libplack-perl/current: ./ inc/Module/Install/ lib/ lib/Plack/ lib/Plack/Middleware/ lib/Plack/Server/ lib/Plack/Server/Standalone/ t/Plack-Middleware/ t/Plack-Middleware/cgi-bin/

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Wed May 5 15:01:40 UTC 2010


Author: jawnsy-guest
Date: Wed May  5 15:01:29 2010
New Revision: 57509

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

Added:
    branches/upstream/libplack-perl/current/t/Plack-Middleware/cgi-bin/utf8.cgi   (with props)
    branches/upstream/libplack-perl/current/t/Plack-Middleware/refresh-init.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/inc/Module/Install/ReadmeFromPod.pm
    branches/upstream/libplack-perl/current/lib/Plack.pm
    branches/upstream/libplack-perl/current/lib/Plack/Middleware/ErrorDocument.pm
    branches/upstream/libplack-perl/current/lib/Plack/Middleware/Refresh.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/Server/ServerSimple.pm
    branches/upstream/libplack-perl/current/lib/Plack/Server/Standalone/Prefork.pm
    branches/upstream/libplack-perl/current/t/Plack-Middleware/cgibin.t
    branches/upstream/libplack-perl/current/t/Plack-Middleware/error_document.t

Modified: branches/upstream/libplack-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/Changes?rev=57509&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/Changes (original)
+++ branches/upstream/libplack-perl/current/Changes Wed May  5 15:01:29 2010
@@ -1,6 +1,12 @@
 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.9934  Tue May  4 15:47:33 PDT 2010
+        - Added a test in CGIBin where binmode ":utf8" causes bad content-length #110
+        - Doc fix for the deprecated servers
+        - Initialize Module::Refresh (hiratara)
+        - Added mime_type to ErorrDocument (kakuno)
 
 0.9933  Tue Apr 27 14:32:23 PDT 2010
         - refactored the app.psgi loading error handling

Modified: branches/upstream/libplack-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/MANIFEST?rev=57509&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/MANIFEST (original)
+++ branches/upstream/libplack-perl/current/MANIFEST Wed May  5 15:01:29 2010
@@ -163,6 +163,7 @@
 t/Plack-Middleware/cgi-bin/hello.cgi
 t/Plack-Middleware/cgi-bin/hello2.cgi
 t/Plack-Middleware/cgi-bin/hello3.cgi
+t/Plack-Middleware/cgi-bin/utf8.cgi
 t/Plack-Middleware/cgibin.t
 t/Plack-Middleware/chunked.t
 t/Plack-Middleware/component-leak.t
@@ -191,6 +192,7 @@
 t/Plack-Middleware/recursive/streaming.t
 t/Plack-Middleware/recursive/throw.t
 t/Plack-Middleware/recursive/throw_streaming.t
+t/Plack-Middleware/refresh-init.t
 t/Plack-Middleware/runtime.t
 t/Plack-Middleware/simple_content_filter.t
 t/Plack-Middleware/simple_logger.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=57509&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/META.yml (original)
+++ branches/upstream/libplack-perl/current/META.yml Wed May  5 15:01:29 2010
@@ -38,4 +38,4 @@
 resources:
   license: http://dev.perl.org/licenses/
   repository: git://github.com/miyagawa/Plack.git
-version: 0.9933
+version: 0.9934

Modified: branches/upstream/libplack-perl/current/inc/Module/Install/ReadmeFromPod.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/inc/Module/Install/ReadmeFromPod.pm?rev=57509&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/inc/Module/Install/ReadmeFromPod.pm (original)
+++ branches/upstream/libplack-perl/current/inc/Module/Install/ReadmeFromPod.pm Wed May  5 15:01:29 2010
@@ -6,7 +6,7 @@
 use base qw(Module::Install::Base);
 use vars qw($VERSION);
 
-$VERSION = '0.06';
+$VERSION = '0.08';
 
 sub readme_from {
   my $self = shift;

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=57509&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack.pm Wed May  5 15:01:29 2010
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use 5.008_001;
-our $VERSION = '0.9933';
+our $VERSION = '0.9934';
 $VERSION = eval $VERSION;
 
 1;

Modified: branches/upstream/libplack-perl/current/lib/Plack/Middleware/ErrorDocument.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Middleware/ErrorDocument.pm?rev=57509&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Middleware/ErrorDocument.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Middleware/ErrorDocument.pm Wed May  5 15:01:29 2010
@@ -2,6 +2,8 @@
 use strict;
 use warnings;
 use parent qw(Plack::Middleware);
+use Plack::MIME;
+use Plack::Util;
 use Plack::Util::Accessor qw( subrequest );
 
 use HTTP::Status qw(is_error);
@@ -42,6 +44,8 @@
         } else {
             open my $fh, "<", $path or die "$path: $!";
             $r->[2] = $fh;
+            my $h = Plack::Util::headers($r->[1]);
+            $h->set('Content-Type', Plack::MIME->mime_type($path));
         }
     });
 }

Modified: branches/upstream/libplack-perl/current/lib/Plack/Middleware/Refresh.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Middleware/Refresh.pm?rev=57509&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Middleware/Refresh.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Middleware/Refresh.pm Wed May  5 15:01:29 2010
@@ -7,6 +7,8 @@
 sub prepare_app {
     my $self = shift;
     $self->cooldown(10) unless defined $self->cooldown;
+
+    Module::Refresh->new;
     $self->last(time - $self->cooldown);
 }
 

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=57509&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Request.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Request.pm Wed May  5 15:01:29 2010
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 use 5.008_001;
-our $VERSION = '0.9933';
+our $VERSION = '0.9934';
 $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=57509&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Response.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Response.pm Wed May  5 15:01:29 2010
@@ -1,7 +1,7 @@
 package Plack::Response;
 use strict;
 use warnings;
-our $VERSION = '0.9933';
+our $VERSION = '0.9934';
 $VERSION = eval $VERSION;
 
 use Plack::Util::Accessor qw(body status);

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=57509&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Server/ServerSimple.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Server/ServerSimple.pm Wed May  5 15:01:29 2010
@@ -1,6 +1,6 @@
 package Plack::Server::ServerSimple;
 use strict;
-our $VERSION = '0.9933';
+our $VERSION = '0.9934';
 $VERSION = eval $VERSION;
 
 use parent qw(Plack::Handler::HTTP::Server::Simple);

Modified: branches/upstream/libplack-perl/current/lib/Plack/Server/Standalone/Prefork.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Server/Standalone/Prefork.pm?rev=57509&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Server/Standalone/Prefork.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Server/Standalone/Prefork.pm Wed May  5 15:01:29 2010
@@ -5,7 +5,7 @@
 
 sub new {
     my $class = shift;
-    Carp::carp "Use of $class is deprecated. Use Plack::Handler::Standalone or Plack::Loader to upgrade.";
+    Carp::carp "Use of $class is deprecated. Use Starman or Starlet for preforking servers.";
     $class->SUPER::new(@_);
 }
 
@@ -15,7 +15,7 @@
 
 =head1 NAME
 
-Plack::Server::Standalone::Prefork - DEPRECATED
+Plack::Server::Standalone::Prefork - DEPRECATED use Starman or Starlet instead
 
 =head1 DESCRIPTION
 

Added: branches/upstream/libplack-perl/current/t/Plack-Middleware/cgi-bin/utf8.cgi
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Middleware/cgi-bin/utf8.cgi?rev=57509&op=file
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Middleware/cgi-bin/utf8.cgi (added)
+++ branches/upstream/libplack-perl/current/t/Plack-Middleware/cgi-bin/utf8.cgi Wed May  5 15:01:29 2010
@@ -1,0 +1,6 @@
+#!perl
+
+use CGI;
+binmode STDOUT, ":utf8";
+print CGI::header("text/html;charset=utf-8"), chr(4343), "\n";
+

Propchange: branches/upstream/libplack-perl/current/t/Plack-Middleware/cgi-bin/utf8.cgi
------------------------------------------------------------------------------
    svn:executable = *

Modified: branches/upstream/libplack-perl/current/t/Plack-Middleware/cgibin.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Middleware/cgibin.t?rev=57509&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Middleware/cgibin.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Middleware/cgibin.t Wed May  5 15:01:29 2010
@@ -1,6 +1,6 @@
 use strict;
 use Test::More;
-use Test::Requires { 'CGI::Emulate::PSGI' => 0, 'CGI::Compile' => 0.03 };
+use Test::Requires { 'CGI::Emulate::PSGI' => 0.07, 'CGI::Compile' => 0.03 };
 use Plack::Test;
 use HTTP::Request::Common;
 use Plack::App::CGIBin;
@@ -36,6 +36,11 @@
 
     $res = $cb->(GET "http://localhost/hello4.cgi");
     is $res->code, 404;
+
+    $res = $cb->(GET "http://localhost/utf8.cgi");
+    is $res->code, 200;
+    is length $res->content, 4;
+    is $res->content, "\xe1\x83\xb7\n";
 };
 
 done_testing;

Modified: branches/upstream/libplack-perl/current/t/Plack-Middleware/error_document.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Middleware/error_document.t?rev=57509&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Middleware/error_document.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Middleware/error_document.t Wed May  5 15:01:29 2010
@@ -34,6 +34,7 @@
 
         $res = $cb->(GET "http://localhost/status/404");
         is $res->code, 404;
+        like $res->header('content_type'), qr!text/html!;
         like $res->content, qr/fancy 404/;
     }
 };

Added: branches/upstream/libplack-perl/current/t/Plack-Middleware/refresh-init.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Middleware/refresh-init.t?rev=57509&op=file
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Middleware/refresh-init.t (added)
+++ branches/upstream/libplack-perl/current/t/Plack-Middleware/refresh-init.t Wed May  5 15:01:29 2010
@@ -1,0 +1,45 @@
+use strict;
+use warnings;
+use Test::Requires qw(Module::Refresh);
+use File::Spec;
+use File::Temp;
+use HTTP::Request::Common;
+use Plack::Middleware::Refresh;
+use Plack::Test;
+use Test::More;
+
+sub write_file($$){
+    my ( $path, $content ) = @_;
+    open my $out, '>', $path or die "$path: $!";
+    print $out $content;
+}
+
+my $tmpdir  = File::Temp::tempdir( CLEANUP => 1 );
+my $pm_file = File::Spec->catfile($tmpdir, 'SomeModule.pm');
+write_file $pm_file, qq/sub SomeModule::hello {'...'}; 1;\n/;
+
+# Load SomeModule
+unshift @INC, $tmpdir;
+require SomeModule;
+
+my $app = Plack::Middleware::Refresh->wrap(sub {
+    [200, [ 'X-SomeModule' => SomeModule->hello ], ["OK\n"]]
+}, cooldown => 0 );
+
+test_psgi $app, sub {
+    my $cb = shift;
+
+    # Change SomeModule before the server gets requests.
+    sleep 1;
+    write_file $pm_file, qq/sub SomeModule::hello {'Hi.'}; 1;\n/;
+    my $res = $cb->(GET "/");
+    is $res->header('X-SomeModule'), 'Hi.';
+
+    # Change again.
+    sleep 1;
+    write_file $pm_file, qq/sub SomeModule::hello {'Good-bye.'}; 1;\n/;
+    $res = $cb->(GET "/");
+    is $res->header('X-SomeModule'), 'Good-bye.';
+};
+
+done_testing;




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