Make Gruntmaster::Page::Base also act as strict/warnings/feature/etc
[gruntmaster-page.git] / lib / Gruntmaster / Page / Src.pm
CommitLineData
923655e1
MG
1package Gruntmaster::Page::Src;
2
923655e1 3use Gruntmaster::Page::Base;
923655e1
MG
4
5use constant CONTENT_TYPES => +{
6 c => 'text/x-csrc',
7 cpp => 'text/x-c++src',
8 cs => 'text/x-chsarp', # Used by GNOME. Not in mime.types.
9 java => 'text/x-java',
10 pas => 'text/x-pascal',
11 pl => 'text/x-perl',
12 py => 'text/x-python',
13};
14
15sub generate{
191f4979
MG
16 my ($self, $format, $env, $ct, $job, $ext) = @_;
17 debug $env => "Contest is $ct, job is $job and extension is $ext";
923655e1
MG
18 local $Gruntmaster::Data::contest = $ct if $ct;
19
49c1467a 20 [200, ['Content-Type' => CONTENT_TYPES->{$ext}, 'Cache-Control' => 'max-age=604800', 'X-Forever' => 1], [job_inmeta($job)->{files}{prog}{content}] ]
923655e1
MG
21}
22
923655e1 231
This page took 0.011309 seconds and 4 git commands to generate.