Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/perl
use strict;
use warnings;
use utf8;
use feature qw( say );
use Web::Scraper;
use URI;
use Acme::CPANAuthors::Japanese;
#!/usr/bin/perl
use strict;
use warnings;
use utf8;
use Data::Dumper;
use Devel::Peek;
use feature qw( say );
use Encode;
From 638815a50913a983c67fe40efe83c00e86072be7 Mon Sep 17 00:00:00 2001
From: Masahiro Chiba <[email protected]>
Date: Sun, 4 Oct 2009 03:37:45 +0900
Subject: [PATCH] add sendfile impl
---
lib/Plack/Server/Apache2.pm | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/lib/Plack/Server/Apache2.pm b/lib/Plack/Server/Apache2.pm
package Plack::Middleware::Sendfile;
use strict;
use warnings;
use base qw( Plack::Middleware );
use IO::File::WithPath;
sub call {
my $self = shift;
my $env = shift;
diff --git a/lib/Plack/Server/Apache2.pm b/lib/Plack/Server/Apache2.pm
index f2d80d0..d56b3c9 100644
--- a/lib/Plack/Server/Apache2.pm
+++ b/lib/Plack/Server/Apache2.pm
@@ -58,7 +58,19 @@ sub handler {
$r->status($res->[0]);
# TODO $r->sendfile support?
- Plack::Util::foreach($res->[2], sub { $r->puts(@_) });
+ my $puts_cb;
Index: t/06request_decode.t
===================================================================
--- t/06request_decode.t (revision 0)
+++ t/06request_decode.t (revision 0)
@@ -0,0 +1,44 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+use Test::More tests => 3 * 3;
package Plaxy;
use strict;
use warnings;
use utf8;
use Plack::Request;
use Plack::Response;
use LWP;
use Plack::Builder;
{
package Hoge;
sub new {
bless [1] => shift;
}
sub getline {
#!perl
use strict;
use warnings;
use AE;
use Coro::AnyEvent;
use Coro::Timer;
my $timer = AE::timer 0, 1, sub {
Coro::Timer::sleep 1;
@nihen
nihen / gist:211153
Created October 15, 2009 18:12
archer and git
global:
dest_dir: /var/www/example/
work_dir: dummy
assets_path: /path/to/archer_assets/
tasks:
init:
- module: Exec::Local
name: stash save
config: