]> iEval git - gruntmaster-page.git/blame - lib/Gruntmaster/Page/Src.pm
Pass PSGI env to generators
[gruntmaster-page.git] / lib / Gruntmaster / Page / Src.pm
CommitLineData
923655e1
MG
1package Gruntmaster::Page::Src;
2
3use 5.014000;
4use strict;
5use warnings;
6use Gruntmaster::Page::Base;
7our @ISA = qw/Gruntmaster::Page::Base/;
8our $VERSION = '0.001';
9
10use constant CONTENT_TYPES => +{
11 c => 'text/x-csrc',
12 cpp => 'text/x-c++src',
13 cs => 'text/x-chsarp', # Used by GNOME. Not in mime.types.
14 java => 'text/x-java',
15 pas => 'text/x-pascal',
16 pl => 'text/x-perl',
17 py => 'text/x-python',
18};
19
20sub generate{
191f4979
MG
21 my ($self, $format, $env, $ct, $job, $ext) = @_;
22 debug $env => "Contest is $ct, job is $job and extension is $ext";
923655e1
MG
23 local $Gruntmaster::Data::contest = $ct if $ct;
24
25 [200, ['Content-Type' => CONTENT_TYPES->{$ext}, 'Cache-Control' => 'max-age=604800'], [job_inmeta($job)->{files}{prog}{content}] ]
26}
27
28sub variants{ [[file => 1, undef, undef, undef, undef, undef]] }
29
301
This page took 0.023119 seconds and 4 git commands to generate.