X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FApp%2FCommand%2FSet.pm;h=e1f70da8201e0bc27cb7b857e100b9e195c7cca4;hb=b35cbc0d6ca5baf03ffbeb2b9a375fa71f4d0ad3;hp=c342e477ebf82078bc7d433c344f8953aad36afd;hpb=e1b6fd19f5724ce68ee92aaeae1c0ddf7a6a2561;p=gruntmaster-data.git diff --git a/lib/Gruntmaster/App/Command/Set.pm b/lib/Gruntmaster/App/Command/Set.pm index c342e47..e1f70da 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_014'; +our $VERSION = '5999.000_016'; 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; @@ -63,7 +71,7 @@ Marius Gavrilescu, Emarius@ieval.roE =head1 COPYRIGHT AND LICENSE -Copyright (C) 2014-2015 by Marius Gavrilescu +Copyright (C) 2014-2016 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,