|
Revision 19782, 451 bytes
(checked in by lopnor, 5 years ago)
|
|
lang/perl/App-Hachero: more tt friendly result
|
| Line | |
|---|
| 1 | package App::Hachero::Plugin::Output::TT; |
|---|
| 2 | use strict; |
|---|
| 3 | use warnings; |
|---|
| 4 | use base qw(App::Hachero::Plugin::Base); |
|---|
| 5 | use Template; |
|---|
| 6 | use IO::All; |
|---|
| 7 | |
|---|
| 8 | sub output : Hook { |
|---|
| 9 | my ($self, $context, $args) = @_; |
|---|
| 10 | my $tt_file = $self->config->{config}->{template}; |
|---|
| 11 | my $out_file = $self->config->{config}->{out}; |
|---|
| 12 | my $tt = Template->new; |
|---|
| 13 | my $template < io $tt_file; |
|---|
| 14 | $tt->process(\$template, $context, \my $out); |
|---|
| 15 | $out > io $out_file; |
|---|
| 16 | } |
|---|
| 17 | |
|---|
| 18 | 1; |
|---|
| 19 | __DATA__ |
|---|