Make Gruntmaster::Page::Base::variants not need overriding
[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
49c1467a 25 [200, ['Content-Type' => CONTENT_TYPES->{$ext}, 'Cache-Control' => 'max-age=604800', 'X-Forever' => 1], [job_inmeta($job)->{files}{prog}{content}] ]
923655e1
MG
26}
27
923655e1 281
This page took 0.012011 seconds and 4 git commands to generate.