From f0ae016ea9a4816b5fb37095f079e2e9ac46ac97 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Sun, 26 Jan 2014 09:13:44 +0200 Subject: [PATCH] Move FORMAT_EXTENSION here --- lib/Gruntmaster/Handlers.pm | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/Gruntmaster/Handlers.pm b/lib/Gruntmaster/Handlers.pm index c88f328..f0281f2 100644 --- a/lib/Gruntmaster/Handlers.pm +++ b/lib/Gruntmaster/Handlers.pm @@ -20,7 +20,17 @@ use File::Basename qw/fileparse/; use File::Temp qw/tempdir/; use File::Copy qw/move/; use Gruntmaster::Data qw/contest_start contest_end push_job set_job_inmeta insert_user PUBLISH/; -use Gruntmaster::Page::Log; + +use constant FORMAT_EXTENSION => { + C => 'c', + CPP => 'cpp', + MONO => 'cs', + JAVA => 'java', + PASCAL => 'pas', + PERL => 'pl', + PYTHON => 'py', + RUBY => 'rb', +}; sub aputs{ my ($r, $str) = @_; @@ -46,14 +56,14 @@ sub submit{ defined $private ? (private => $private) : (), defined $contest ? (contest => $contest, private => 1) : (), filesize => length $prog, - extension => Gruntmaster::Page::Log::FORMAT_EXTENSION->{$format}, + extension => FORMAT_EXTENSION->{$format}, ); set_job_inmeta $job, { files => { prog => { format => $format, - name => 'prog.' . Gruntmaster::Page::Log::FORMAT_EXTENSION->{$format}, + name => 'prog.' . FORMAT_EXTENSION->{$format}, content => $prog, } } -- 2.39.2