Bump version and add changelog entry
[gruntmaster-data.git] / lib / Gruntmaster / Data.pm
index abf9a04c5f91fb32d5df83df790577a9ba690d1b..457f12b93b32d2c68ec9b880ba889c160b085946 100644 (file)
@@ -15,7 +15,7 @@ __PACKAGE__->load_namespaces;
 # Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-03-05 13:11:39
 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dAEmtAexvUaNXLgYz2rNEg
 
-our $VERSION = 5999.000_003;
+our $VERSION = '5999.000_004';
 
 use Lingua::EN::Inflect qw/PL_N/;
 use Sub::Name qw/subname/;
@@ -48,11 +48,76 @@ Gruntmaster::Data - Gruntmaster 6000 Online Judge -- database interface and tool
 =head1 SYNOPSIS
 
   my $db = Gruntmaster::Data->connect('dbi:Pg:');
-  # Typical DBIC stuff here
+
+  my $problem = $db->problem('my_problem');
+  $problem->update({timeout => 2.5}); # Set time limit to 2.5 seconds
+  $problem->rerun; # And rerun all jobs for this problem
+
+  # ...
+
+  my $contest = $db->contests->create({ # Create a new contest
+    id => 'my_contest',
+    name => 'My Awesome Contest',
+    start => time + 100,
+    end => time + 1900,
+  });
+  $db->contest_problems->create({ # Add a problem to the contest
+    contest => 'my_contest',
+    problem => 'my_problem',
+  });
+
+  say 'The contest has not started yet' if $contest->is_pending;
+
+  # ...
+
+  my @jobs = $db->jobs->search({contest => 'my_contest', owner => 'MGV'})->all;
+  $_->rerun for @jobs; # Rerun all jobs sent by MGV in my_contest
 
 =head1 DESCRIPTION
 
-No documentation (yet)
+Gruntmaster::Data is the interface to the Gruntmaster 6000 database. Read the L<DBIx::Class> documentation for usage information.
+
+In addition to the typical DBIx::Class::Schema methods, this module contains several convenience methods:
+
+=over
+
+=item contests
+
+Equivalent to C<< $schema->resultset('Contest') >>
+
+=item contest_problems
+
+Equivalent to C<< $schema->resultset('ContestProblem') >>
+
+=item jobs
+
+Equivalent to C<< $schema->resultset('Job') >>
+
+=item problems
+
+Equivalent to C<< $schema->resultset('Problem') >>
+
+=item users
+
+Equivalent to C<< $schema->resultset('User') >>
+
+=item contest($id)
+
+Equivalent to C<< $schema->resultset('Contest')->find($id) >>
+
+=item job($id)
+
+Equivalent to C<< $schema->resultset('Job')->find($id) >>
+
+=item problem($id)
+
+Equivalent to C<< $schema->resultset('Problem')->find($id) >>
+
+=item user($id)
+
+Equivalent to C<< $schema->resultset('User')->find($id) >>
+
+=back
 
 =head1 AUTHOR
 
@@ -62,10 +127,9 @@ Marius Gavrilescu E<lt>marius@ieval.roE<gt>
 
 Copyright (C) 2014 by Marius Gavrilescu
 
-This library is free software: you can redistribute it and/or modify
-it under the terms of the GNU Affero General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.18.1 or,
+at your option, any later version of Perl 5 you may have available.
 
 
 =cut
This page took 0.010802 seconds and 4 git commands to generate.