X-Git-Url: http://git.ieval.ro/?p=gruntmaster-data.git;a=blobdiff_plain;f=lib%2FGruntmaster%2FApp%2FCommand%2FSet.pm;h=2624ce4d1d40407a1f6c21d5639ed9054c5abea5;hp=d18726e3eb890ebe644df3a62dee1fbcb0ae5946;hb=8ab124f5b4b8d8c871c3bf2c3fb11eb17f61d2f6;hpb=e1b9f3ddadeb424826cacd6319cd065d9b008e95 diff --git a/lib/Gruntmaster/App/Command/Set.pm b/lib/Gruntmaster/App/Command/Set.pm index d18726e..2624ce4 100644 --- a/lib/Gruntmaster/App/Command/Set.pm +++ b/lib/Gruntmaster/App/Command/Set.pm @@ -3,13 +3,20 @@ package Gruntmaster::App::Command::Set; use 5.014000; use warnings; -our $VERSION = '5999.000_004'; +our $VERSION = '5999.000_015'; use Gruntmaster::App '-command'; use Gruntmaster::Data; use File::Slurp qw/read_file/; +use constant PAGES => { + contests => '/ct/', + jobs => '/log/', + problems => '/pb/', + users => '/us/', +}; + sub opt_spec { ['file!', 'Use the contents of a file as value'] } @@ -29,6 +36,7 @@ sub execute { my ($id, %values) = @$args; %values = map { $_ => scalar read_file $values{$_} } keys %values if $opt->{file}; db->update($self->app->table, \%values, {id => $id}); + purge PAGES->{$self->app->table}.$_ for '', $id; } 1;