X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FApp%2FCommand%2FAdd.pm;h=38f7836edff76704cdfd6d6af625dd3a95856c69;hb=7e8f5f0e842c52b928fd7d8ac97da45bf9f7fc83;hp=5e8b07a91e8564b4d60602675f4d691cf8350479;hpb=63afa40a4691cd73c543ff4f952beceb95db8841;p=gruntmaster-data.git diff --git a/lib/Gruntmaster/App/Command/Add.pm b/lib/Gruntmaster/App/Command/Add.pm index 5e8b07a..38f7836 100644 --- a/lib/Gruntmaster/App/Command/Add.pm +++ b/lib/Gruntmaster/App/Command/Add.pm @@ -3,7 +3,7 @@ package Gruntmaster::App::Command::Add; use 5.014000; use warnings; -our $VERSION = '5999.000_004'; +our $VERSION = '5999.000_015'; use Gruntmaster::App '-command'; use Gruntmaster::Data; @@ -48,10 +48,11 @@ sub add_contest { my $name = prompt 'Contest name'; my $owner = prompt 'Owner'; - my $start = str2time prompt 'Start time' or die 'Cannot parse time'; - my $stop = str2time prompt 'Stop time' or die 'Cannot parse time'; + my $start = str2time prompt 'Start time' or die "Cannot parse time\n"; + my $stop = str2time prompt 'Stop time' or die "Cannot parse time\n"; db->insert(contests => {id => $id, name => $name, owner => $owner, start => $start, stop => $stop}); + purge '/ct/'; } sub add_problem { @@ -118,6 +119,7 @@ sub add_problem { $options{tests} = encode_json \@tests if @tests; db->insert(problems => \%options); db->insert(contest_problems => {problem => $id, contest => $contest}) if $contest; + purge '/pb/'; } 1; @@ -150,7 +152,7 @@ Marius Gavrilescu, Emarius@ieval.roE =head1 COPYRIGHT AND LICENSE -Copyright (C) 2015 by Marius Gavrilescu +Copyright (C) 2014-2015 by Marius Gavrilescu This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.20.1 or,