From: Marius Gavrilescu Date: Sun, 26 Jan 2014 07:20:07 +0000 (+0200) Subject: Add gensrc X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=e57ca30a8f44b2af769c55bb09222bb4c170499b;p=plack-app-gruntmaster.git Add gensrc --- diff --git a/gruntmaster-paged b/gruntmaster-paged index 0bb9653..5e7bd57 100755 --- a/gruntmaster-paged +++ b/gruntmaster-paged @@ -5,6 +5,8 @@ use Gruntmaster::Data qw/SUBSCRIBE WAIT_FOR_MESSAGES/; use Gruntmaster::Page; SUBSCRIBE 'genpage', \&Gruntmaster::Page::generate; +SUBSCRIBE 'gensrc', \&Gruntmaster::Page::gensrc; +SUBSCRIBE 'genarticle', \&Gruntmaster::Page::genarticle; WAIT_FOR_MESSAGES 86400 while 1; 1; diff --git a/lib/Gruntmaster/Page.pm b/lib/Gruntmaster/Page.pm index e008650..eedbec5 100644 --- a/lib/Gruntmaster/Page.pm +++ b/lib/Gruntmaster/Page.pm @@ -10,7 +10,7 @@ use File::Path qw/make_path/; use File::Slurp qw/write_file/; use IO::Compress::Gzip qw/gzip/; use IO::File; -use Gruntmaster::Data qw/PUBLISH/; +use Gruntmaster::Data; our $VERSION = '0.001'; our @generators; @@ -77,6 +77,17 @@ sub generate{ close $typemap; } +sub gensrc{ + my ($job) = @_; + my $ext = job_extension $job; + make_path "log/src/"; + write_file "log/src/$job.$ext", job_inmeta($job)->{files}{prog}{content}; +} + +sub genarticle{ + +} + 1; __END__ # Below is stub documentation for your module. You'd better edit it!