X-Git-Url: http://git.ieval.ro/?p=gruntmaster-daemon.git;a=blobdiff_plain;f=lib%2FGruntmaster%2FDaemon%2FGenerator%2FFile.pm;h=5a809ebd8e1ae9b077421582f6eb5066482d6456;hp=1c37a8d2edf12ee0bfc25c98a6029470aa056e2d;hb=bc3729599a66921e1efd9f801222e814c626ea76;hpb=5c5cd38ad5b9e3c2b331564bc0b23e9167b7d07a diff --git a/lib/Gruntmaster/Daemon/Generator/File.pm b/lib/Gruntmaster/Daemon/Generator/File.pm index 1c37a8d..5a809eb 100644 --- a/lib/Gruntmaster/Daemon/Generator/File.pm +++ b/lib/Gruntmaster/Daemon/Generator/File.pm @@ -4,17 +4,49 @@ use 5.014000; use strict; use warnings; -use File::Copy qw/cp/; +use File::Slurp qw/write_file/; use Log::Log4perl qw/get_logger/; -our $VERSION = '0.001'; +our $VERSION = "5999-TRIAL"; ################################################## sub generate{ my ($test, $meta) = @_; get_logger->trace("Generating test $test ..."); - cp "$test.in", 'input' or die "Cannot copy input for test $test: $!"; + write_file 'input', $meta->{infile}[$test - 1] } -1 +1; +__END__ + +=encoding utf-8 + +=head1 NAME + +Gruntmaster::Daemon::Generator::File - Generate tests from files + +=head1 SYNOPSIS + + use Gruntmaster::Daemon::Generator::File; + 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] >>. + +=head1 AUTHOR + +Marius Gavrilescu Emarius@ieval.roE + +=head1 COPYRIGHT AND LICENSE + +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. + + +=cut