From: Marius Gavrilescu Date: Sat, 25 Jan 2014 20:21:19 +0000 (+0200) Subject: Remove public generate function from Gruntmaster::Page X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=70aec811a40e641b8653120828e72bf47dd4ff92;p=plack-app-gruntmaster.git Remove public generate function from Gruntmaster::Page --- diff --git a/gruntmaster-genallpages b/gruntmaster-genallpages index efa61fb..8d18eaa 100755 --- a/gruntmaster-genallpages +++ b/gruntmaster-genallpages @@ -3,12 +3,12 @@ use v5.14; use Gruntmaster::Page; use Gruntmaster::Page::Log; -use Gruntmaster::Data qw/contests jobcard problems users/; +use Gruntmaster::Data qw/contests jobcard problems users PUBLISH/; sub generate{ my $what = shift; - say STDERR "Generating $what"; - Gruntmaster::Page::generate $what; + say STDERR "Generating page $what"; + PUBLISH genpage => $what; } generate "index.html"; diff --git a/gruntmaster-genpage b/gruntmaster-genpage index bac0eb4..4f6c7f2 100755 --- a/gruntmaster-genpage +++ b/gruntmaster-genpage @@ -1,6 +1,6 @@ #!/usr/bin/perl -w use v5.14; -use Gruntmaster::Page qw/generate/; +use Gruntmaster::Data qw/PUBLISH/; -generate $_ for @ARGV; +PUBLISH genpage => $_ for @ARGV; diff --git a/gruntmaster-paged b/gruntmaster-paged index ef2bf81..0bb9653 100755 --- a/gruntmaster-paged +++ b/gruntmaster-paged @@ -2,9 +2,9 @@ use v5.14; use Gruntmaster::Data qw/SUBSCRIBE WAIT_FOR_MESSAGES/; -use Gruntmaster::Page qw/_generate/; +use Gruntmaster::Page; -SUBSCRIBE 'genpage', \&_generate; +SUBSCRIBE 'genpage', \&Gruntmaster::Page::generate; WAIT_FOR_MESSAGES 86400 while 1; 1; diff --git a/lib/Gruntmaster/Page.pm b/lib/Gruntmaster/Page.pm index c7f92bb..e008650 100644 --- a/lib/Gruntmaster/Page.pm +++ b/lib/Gruntmaster/Page.pm @@ -3,8 +3,6 @@ package Gruntmaster::Page; use 5.014000; use strict; use warnings; -use parent qw/Exporter/; -our @EXPORT_OK = qw/generate _generate/; use Fcntl qw/:flock/; use File::Basename qw/fileparse/; @@ -48,7 +46,7 @@ sub declaregen{ declaregen 'Pb::Entry' => qr,^${contest}pb/$component$,; } -sub _generate{ +sub generate{ my ($path) = @_; my ($path_noext, $ext) = $path =~ m/^(.*)\.(.*)$/; my ($basename, $directories) = fileparse $path_noext; @@ -79,10 +77,6 @@ sub _generate{ close $typemap; } -sub generate{ - PUBLISH 'genpage', shift; -} - 1; __END__ # Below is stub documentation for your module. You'd better edit it!