X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FPage%2FBase.pm;h=84d74510638108fd11117d166353bb883270dda0;hb=81cce380bd7f2ab58bb497ef748b7568968ea05d;hp=475be80d6952521e4d0fc96c6c82881913b64764;hpb=16aa291dc49dceda7e612ed7eb2745036790d81c;p=plack-app-gruntmaster.git diff --git a/lib/Gruntmaster/Page/Base.pm b/lib/Gruntmaster/Page/Base.pm index 475be80..84d7451 100644 --- a/lib/Gruntmaster/Page/Base.pm +++ b/lib/Gruntmaster/Page/Base.pm @@ -3,6 +3,7 @@ package Gruntmaster::Page::Base; use 5.014000; use strict; use warnings; +our $VERSION = '0.001'; use File::Slurp qw/read_file/; use HTML::Template::Compiled; @@ -34,6 +35,8 @@ use POSIX (); use Gruntmaster::Data (); use List::Util (); use LWP::UserAgent; +use Plack::Request (); +use feature (); my $ua = LWP::UserAgent->new; my %templates; @@ -43,10 +46,16 @@ use Carp qw/cluck/; sub import_to { my ($self, $caller, $name, $title) = @_; + strict->import; + feature->import(':5.14'); + warnings->import; + File::Slurp->export_to_level(1, $caller, qw/read_file/); Gruntmaster::Data->export_to_level(1, $caller); List::Util->export_to_level(1, $caller, qw/sum/); no strict 'refs'; + *{"${caller}::ISA"} = [__PACKAGE__]; + *{"${caller}::VERSION"} = $VERSION; *{"${caller}::strftime"} = \&POSIX::strftime; *{"${caller}::debug"} = sub { local $Log::Log4perl::caller_depth = $Log::Log4perl::caller_depth + 1; @@ -77,7 +86,7 @@ sub import { sub generate{ my ($self, $lang, @args) = @_; - my $htc = HTML::Template::Compiled->new(scalarref => \$templates{$self}{$lang}, default_escape => 'HTML',); + my $htc = HTML::Template::Compiled->new(scalarref => \$templates{$self}{$lang}, default_escape => 'HTML', use_perl => 1); $self->_generate($htc, $lang, @args); my $out = $htc->output; utf8::downgrade($out);