Add ruby
[gruntmaster-daemon.git] / lib / Gruntmaster / Daemon.pm
index 7b41d66131bd76b0933457c02ae7e19910aedf5d..ce8510d90320e628c0ea2463acbadb11e7845a45 100644 (file)
@@ -9,7 +9,6 @@ our $VERSION = '5999.000_004';
 use Gruntmaster::Daemon::Constants qw/ERR/;
 use Gruntmaster::Daemon::Format qw/prepare_files stopvms/;
 
-use File::Basename qw/fileparse/;
 use File::Temp qw/tempdir/;
 use JSON qw/decode_json encode_json/;
 use Sys::Hostname qw/hostname/;
@@ -17,7 +16,6 @@ use Time::HiRes qw/time/;
 use Try::Tiny;
 use Log::Log4perl qw/get_logger/;
 
-use constant PAGE_SIZE => 10;
 use constant FORMAT_EXTENSION => {
        C => 'c',
        CPP => 'cpp',
@@ -29,6 +27,8 @@ use constant FORMAT_EXTENSION => {
        PASCAL => 'pas',
        PERL => 'pl',
        PYTHON => 'py',
+       RUBY => 'rb',
+       SBCL => 'l',
 };
 
 ##################################################
@@ -111,9 +111,11 @@ sub process_job {
                                content => $job->source,
                        },
                },
-               map { $_ => $job->problem->get_column($_) } qw/generator runner judge testcnt timeout olimit/
+               map { $_ => $job->problem->get_column($_) } qw/generator runner judge precnt testcnt timeout olimit/
        };
        $meta->{tests} = decode_json $job->problem->tests if $meta->{runner} eq 'File';
+       delete $meta->{precnt} if $job->problem->is_in_archive;
+       $meta->{testcnt} = $meta->{precnt} if $meta->{precnt};
 
        $meta->{files}{ver} = {
                name => 'ver.' . FORMAT_EXTENSION->{$job->problem->verformat},
@@ -123,6 +125,7 @@ sub process_job {
 
        process $meta;
 
+       $meta->{result_text} .= ' (pretests)' if $meta->{precnt};
        $job->update({
                result => $meta->{result},
                result_text => $meta->{result_text},
This page took 0.010604 seconds and 4 git commands to generate.