bump version to 0.44
[catagits/Catalyst-View-TT.git] / lib / Catalyst / Helper / View / TT.pm
index 6781e51..ecaa472 100644 (file)
@@ -1,7 +1,9 @@
 package Catalyst::Helper::View::TT;
 
 use strict;
-use IO::File;
+
+our $VERSION = '0.44';
+$VERSION = eval $VERSION;
 
 =head1 NAME
 
@@ -9,7 +11,7 @@ Catalyst::Helper::View::TT - Helper for TT Views
 
 =head1 SYNOPSIS
 
-    bin/create view TT TT
+    script/create.pl view HTML TT
 
 =head1 DESCRIPTION
 
@@ -23,55 +25,63 @@ Helper for TT Views.
 
 sub mk_compclass {
     my ( $self, $helper ) = @_;
-    my $file  = $helper->{file};
-    my $class = $helper->{class};
-    my $comp  = IO::File->new("> $file") or die qq/Couldn't open "$file", "$!"/;
-    print $comp <<"EOF";
-package $class;
+    my $file = $helper->{file};
+    $helper->render_file( 'compclass', $file );
+}
 
-use strict;
-use base 'Catalyst::View::TT';
+=head1 SEE ALSO
 
-=head1 NAME
+L<Catalyst::Manual>, L<Catalyst::Test>, L<Catalyst::Request>,
+L<Catalyst::Response>, L<Catalyst::Helper>
 
-$class - TT View Component
+=head1 AUTHOR
 
-=head1 SYNOPSIS
+Sebastian Riedel, C<sri@oook.de>
+Marcus Ramberg, C<mramberg@cpan.org>
 
-    Very simple to use
+=head1 LICENSE
 
-=head1 DESCRIPTION
+This library is free software . You can redistribute it and/or modify
+it under the same terms as perl itself.
 
-Very nice component.
+=cut
 
-=head1 AUTHOR
+1;
 
-Clever guy
+__DATA__
 
-=head1 LICENSE
+__compclass__
+package [% class %];
+use Moose;
+use namespace::autoclean;
 
-This library is free software . You can redistribute it and/or modify it under
-the same terms as perl itself.
+extends 'Catalyst::View::TT';
 
-=cut
+__PACKAGE__->config(
+    TEMPLATE_EXTENSION => '.tt',
+    render_die => 1,
+);
 
-1;
-EOF
-}
+=head1 NAME
+
+[% class %] - TT View for [% app %]
+
+=head1 DESCRIPTION
+
+TT View for [% app %].
 
 =head1 SEE ALSO
 
-L<Catalyst::Manual>, L<Catalyst::Test>, L<Catalyst::Request>,
-L<Catalyst::Response>, L<Catalyst::Helper>
+L<[% app %]>
 
 =head1 AUTHOR
 
-Sebastian Riedel, C<sri@oook.de>
+[% author %]
 
 =head1 LICENSE
 
-This library is free software . You can redistribute it and/or modify it under
-the same terms as perl itself.
+This library is free software. You can redistribute it and/or modify
+it under the same terms as Perl itself.
 
 =cut