Add perlcritic test and make code comply
[gruntmaster-daemon.git] / lib / Gruntmaster / Daemon / Generator / File.pm
index 8c2ed5b26cc45ba13737a17e37ba906bcc9df143..c5023a75790e21e772cb65f5334c876687a0cc40 100644 (file)
@@ -8,19 +8,18 @@ use File::Copy qw/copy/;
 use File::Slurp qw/write_file/;
 use Log::Log4perl qw/get_logger/;
 
-our $VERSION = "5999.000_001";
+our $VERSION = '5999.000_004';
 
 ##################################################
 
 sub generate{
-  my ($test, $meta) = @_;
-  get_logger->trace("Generating test $test ...");
-  if (exists $meta->{infile}) {
-         write_file 'input', $meta->{infile}[$test - 1]
-  } else {
-         my $ct = defined $Gruntmaster::Data::contest ? "ct/$Gruntmaster::Data::contest" : '';
-         copy "/var/lib/gruntmasterd/$ct/pb/$meta->{problem}/$test.in", 'input'
-  }
+       my ($test, $meta) = @_;
+       get_logger->trace("Generating test $test ...");
+       if (exists $meta->{infile}) {
+               write_file 'input', $meta->{infile}[$test - 1]
+       } else {
+               copy "/var/lib/gruntmasterd/pb/$meta->{problem}/$test.in", 'input'
+       }
 }
 
 1;
@@ -35,11 +34,13 @@ Gruntmaster::Daemon::Generator::File - Generate tests from files
 =head1 SYNOPSIS
 
   use Gruntmaster::Daemon::Generator::File;
-  Gruntmaster::Daemon::Generator::File->generate(5, $meta);
+  Gruntmaster::Daemon::Generator::File::generate(5, $meta);
 
 =head1 DESCRIPTION
 
-Gruntmaster::Daemon::Generator::File is a static test generator. Test C<$i> is C<< $meta->{infile}[$i - 1] >>.
+Gruntmaster::Daemon::Generator::File is a static test generator.
+If C<< $meta->{infile} >> exists, the input for test C<$i> is C<< $meta->{infile}[$i - 1] >>.
+Otherwise, the input for test C<$i> is F<< /var/lib/gruntmasterd/pb/$meta->{problem}/$test.in >>.
 
 =head1 AUTHOR
 
This page took 0.011103 seconds and 4 git commands to generate.