This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
controller User { | |
# /user/\d+/... | |
chained action user (Int $id) { ... load a user ... } | |
under user { | |
# GET /user/\d+ | |
action view at / on GET { ... render a user ... } | |
# PUT /user/\d+ | |
action update at / on PUT { ... update the user ... } | |
# DELETE /user/\d+ |
Moose Hackathon Agenda
- Traits in C::MOP
- removing T::E from Moose/MOP
- adding lives_ok/dies_ok to Test::Moose
- merging C::MOP and Moose
- Antlers
- merging MooseX modules into Moose and/or core
- MX::AH into core
- MooseX::Traits -> Moose::Traits
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Class; | |
use Moose; | |
use Moose::Util::TypeConstraints; | |
## Whatever, you get the idea. | |
sub trim_whitespace { my $str = shift; $str =~ s/^\s+|\s+$//; $str }; | |
sub boolify { my $str = shift; $str =~ /^y/i ? 1 : $str }; | |
## Guess i need to say an OLBool is just a regular bool that coerces, stringifies, and removes padding... JOYZER. Shouldn't the where be at the very least, inherited it is a subtype. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vim: ft=perl: | |
use strict; | |
use warnings; | |
use Plack::Builder; | |
use Plack::App::WrapCGI; | |
use Plack::App::URLMap; | |
builder { | |
enable 'Static', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub env_filter (&) { | |
my $code = shift; | |
sub { | |
my $app = shift; | |
sub { | |
my $env = shift; | |
$code->($env); | |
return $app->($env); | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl | |
use strict; | |
use warnings; | |
use Reflex::POE::Wheel::Run; | |
my $log = IO::File->new('log', 'w') or die $!; | |
my %w; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
t/Plack-Handler/fcgi.t ......................... 1/? # Testing with lighttpd 1.4.19 | |
t/Plack-Handler/fcgi.t ......................... 87/? | |
# Failed test at /home/hdp/perl5/perlbrew/perls/perl-5.10.1/lib/5.10.1/Test/More.pm line 372. | |
# got: '' | |
# expected: '/fastcgi' | |
t/Plack-Handler/fcgi.t ......................... 109/? | |
# Failed test at /home/hdp/perl5/perlbrew/perls/perl-5.10.1/lib/5.10.1/Test/More.pm line 372. | |
# got: 'REQUEST_METHOD:GET | |
# PATH_INFO:/fastcgi/foo/ | |
# QUERY_STRING:dankogai=kogaidan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Plack::App::Cascade; | |
my $app = Plack::App::Cascade->new; | |
$app->add(sub { | |
my $env = shift; | |
return sub { | |
my $respond = shift; | |
my $writer = $respond->([404, []]); | |
$writer->write("boo"); | |
$writer->close; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$app = ...; | |
if (my $map = $self->config->proxy_map) { | |
my $urlmap = Plack::App::URLMap->new; | |
for my $type (keys %$map) { | |
my ($prefix, $remote, $headers) = | |
@{$map->{$type}}{qw(path_prefix remote headers)}; | |
$headers ||= {}; | |
my $proxy = Plack::App::Proxy->new( | |
remote => $remote, | |
preserve_host_header => 1, |
OlderNewer