]>
iEval git - plack-app-gruntmaster.git/blob - lib/Plack/App/Gruntmaster.pm
1 package Plack
::App
::Gruntmaster
;
6 use parent qw
/Plack::Component/;
7 no if $] >= 5.017011, warnings
=> 'experimental::smartmatch';
8 our $VERSION = '5999.000_001';
10 use HTTP
::Negotiate qw
/choose/;
17 my $r = Plack
::Request
->new($env);
18 my @handlers = @
{ $handlers{$r->method} // [] };
19 for my $handler (@handlers) {
20 my ($re, $obj) = @
$handler;
22 next unless @args = $r->path =~ m/^$re$/a;
23 my $format = choose
$obj->variants, $r->headers;
24 return $obj->generate($format, $env->{'psgix.logger'}, map { $_ // '' } @args);
27 [404, ['Content-Type' => 'text/plain'], ['Not found']]
32 eval "require Gruntmaster::Page::$obj" or die $@
;
33 push @
{$handlers{GET
}}, [ $re, "Gruntmaster::Page::$obj" ]
38 eval "require Gruntmaster::Page::$obj" or die $@
;
39 push @
{$handlers{POST
}}, [ $re, "Gruntmaster::Page::$obj" ]
43 my $word = qr
,(\w
+),a
;
44 my $ct = qr
,(?
:\
/ct/$word)?
,a
;
46 get qr
,/css/$word, => 'CSS';
50 get qr
,/ct/$word, => 'Ct::Entry';
52 get qr
,/us/$word, => 'Us::Entry';
54 get qr
,$ct/log/(\d
+)?
, => 'Log';
55 get qr
,$ct/log/st
, => 'St';
56 get qr
,$ct/log/job
/$word, => 'Log::Entry';
57 get qr
,$ct/submit
, => 'Submit';
58 get qr
,$ct/pb/, => 'Pb';
59 get qr
,$ct/pb/$word, => 'Pb::Entry';
This page took 0.048896 seconds and 4 git commands to generate.