From e57ca30a8f44b2af769c55bb09222bb4c170499b Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Sun, 26 Jan 2014 09:20:07 +0200 Subject: [PATCH] Add gensrc --- gruntmaster-paged | 2 ++ lib/Gruntmaster/Page.pm | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) 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! -- 2.39.2