r46558 - in /branches/upstream/libcatalyst-view-tt-perl/current: Changes MANIFEST META.yml README lib/Catalyst/View/TT.pm t/lib/TestApp.pm t/lib/TestApp/Controller/ t/lib/TestApp/Controller/Root.pm
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Sat Oct 31 02:44:39 UTC 2009
Author: jawnsy-guest
Date: Sat Oct 31 02:44:34 2009
New Revision: 46558
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=46558
Log:
[svn-upgrade] Integrating new upstream version, libcatalyst-view-tt-perl (0.31)
Added:
branches/upstream/libcatalyst-view-tt-perl/current/t/lib/TestApp/Controller/
branches/upstream/libcatalyst-view-tt-perl/current/t/lib/TestApp/Controller/Root.pm
Modified:
branches/upstream/libcatalyst-view-tt-perl/current/Changes
branches/upstream/libcatalyst-view-tt-perl/current/MANIFEST
branches/upstream/libcatalyst-view-tt-perl/current/META.yml
branches/upstream/libcatalyst-view-tt-perl/current/README
branches/upstream/libcatalyst-view-tt-perl/current/lib/Catalyst/View/TT.pm
branches/upstream/libcatalyst-view-tt-perl/current/t/lib/TestApp.pm
Modified: branches/upstream/libcatalyst-view-tt-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-view-tt-perl/current/Changes?rev=46558&op=diff
==============================================================================
--- branches/upstream/libcatalyst-view-tt-perl/current/Changes (original)
+++ branches/upstream/libcatalyst-view-tt-perl/current/Changes Sat Oct 31 02:44:34 2009
@@ -1,4 +1,8 @@
Revision history for Perl extension Catalyst::View::TT.
+
+0.31 2009-10-29 19:26:00
+ - Moved the test actions to their own controller file to silence
+ warning about actions in the app class being deprecated.
0.30 2009-09-12 23:47:00
- Doc fixes:
Modified: branches/upstream/libcatalyst-view-tt-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-view-tt-perl/current/MANIFEST?rev=46558&op=diff
==============================================================================
--- branches/upstream/libcatalyst-view-tt-perl/current/MANIFEST (original)
+++ branches/upstream/libcatalyst-view-tt-perl/current/MANIFEST Sat Oct 31 02:44:34 2009
@@ -29,6 +29,7 @@
t/10providers.encoding.t
t/11norequest.t
t/lib/TestApp.pm
+t/lib/TestApp/Controller/Root.pm
t/lib/TestApp/FauxProvider.pm
t/lib/TestApp/root/specified_template.tt
t/lib/TestApp/root/test.tt
Modified: branches/upstream/libcatalyst-view-tt-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-view-tt-perl/current/META.yml?rev=46558&op=diff
==============================================================================
--- branches/upstream/libcatalyst-view-tt-perl/current/META.yml (original)
+++ branches/upstream/libcatalyst-view-tt-perl/current/META.yml Sat Oct 31 02:44:34 2009
@@ -29,4 +29,4 @@
resources:
license: http://dev.perl.org/licenses/
repository: http://dev.catalyst.perl.org/repos/Catalyst/trunk/Catalyst-View-TT/
-version: 0.30
+version: 0.31
Modified: branches/upstream/libcatalyst-view-tt-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-view-tt-perl/current/README?rev=46558&op=diff
==============================================================================
--- branches/upstream/libcatalyst-view-tt-perl/current/README (original)
+++ branches/upstream/libcatalyst-view-tt-perl/current/README Sat Oct 31 02:44:34 2009
@@ -253,10 +253,17 @@
The constructor for the TT view. Sets up the template provider, and
reads the application config.
- process
+ process($c)
Renders the template specified in "$c->stash->{template}" or
"$c->action" (the private name of the matched action). Calls render to
perform actual rendering. Output is stored in "$c->response->body".
+
+ It is possible to forward to the process method of a TT view from inside
+ Catalyst like this:
+
+ $c->forward('View::TT');
+
+ N.B. This is usually done automatically by Catalyst::Action::RenderView.
render($c, $template, \%args)
Renders the given template and returns output, or a Template::Exception
@@ -273,6 +280,14 @@
$template can be anything that Template::process understands how to
process, including the name of a template file or a reference to a test
string. See Template::process for a full list of supported formats.
+
+ To use the render method outside of your Catalyst app, just pass a undef
+ context. This can be useful for tests, for instance.
+
+ It is possible to forward to the render method of a TT view from inside
+ Catalyst to render page fragments like this:
+
+ my $fragment = $c->forward("View::TT", "render", $template_name, $c->stash->{fragment_data});
template_vars
Returns a list of keys/values to be used as the catalyst variables in
Modified: branches/upstream/libcatalyst-view-tt-perl/current/lib/Catalyst/View/TT.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-view-tt-perl/current/lib/Catalyst/View/TT.pm?rev=46558&op=diff
==============================================================================
--- branches/upstream/libcatalyst-view-tt-perl/current/lib/Catalyst/View/TT.pm (original)
+++ branches/upstream/libcatalyst-view-tt-perl/current/lib/Catalyst/View/TT.pm Sat Oct 31 02:44:34 2009
@@ -9,7 +9,7 @@
use Template::Timer;
use MRO::Compat;
-our $VERSION = '0.30';
+our $VERSION = '0.31';
__PACKAGE__->mk_accessors('template');
__PACKAGE__->mk_accessors('include_path');
@@ -478,11 +478,18 @@
The constructor for the TT view. Sets up the template provider,
and reads the application config.
-=head2 process
+=head2 process($c)
Renders the template specified in C<< $c->stash->{template} >> or
C<< $c->action >> (the private name of the matched action). Calls L<render> to
perform actual rendering. Output is stored in C<< $c->response->body >>.
+
+It is possible to forward to the process method of a TT view from inside
+Catalyst like this:
+
+ $c->forward('View::TT');
+
+N.B. This is usually done automatically by L<Catalyst::Action::RenderView>.
=head2 render($c, $template, \%args)
@@ -501,8 +508,13 @@
process, including the name of a template file or a reference to a test string.
See L<Template::process|Template/process> for a full list of supported formats.
-To use the render method outside of your Catalyst app, just pass a undef context.
+To use the render method outside of your Catalyst app, just pass a undef context.
This can be useful for tests, for instance.
+
+It is possible to forward to the render method of a TT view from inside Catalyst
+to render page fragments like this:
+
+ my $fragment = $c->forward("View::TT", "render", $template_name, $c->stash->{fragment_data});
=head2 template_vars
Modified: branches/upstream/libcatalyst-view-tt-perl/current/t/lib/TestApp.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-view-tt-perl/current/t/lib/TestApp.pm?rev=46558&op=diff
==============================================================================
--- branches/upstream/libcatalyst-view-tt-perl/current/t/lib/TestApp.pm (original)
+++ branches/upstream/libcatalyst-view-tt-perl/current/t/lib/TestApp.pm Sat Oct 31 02:44:34 2009
@@ -21,64 +21,3 @@
__PACKAGE__->setup;
-sub default : Private {
- my ($self, $c) = @_;
-
- $c->response->redirect($c->uri_for('test'));
-}
-
-sub test : Local {
- my ($self, $c) = @_;
-
- $c->stash->{message} = ($c->request->param('message') || $c->config->{default_message});
-}
-
-sub test_includepath : Local {
- my ($self, $c) = @_;
- $c->stash->{message} = ($c->request->param('message') || $c->config->{default_message});
- $c->stash->{template} = $c->request->param('template');
- if ( $c->request->param('additionalpath') ){
- my $additionalpath = Path::Class::dir($c->config->{root}, $c->request->param('additionalpath'));
- $c->stash->{additional_template_paths} = ["$additionalpath"];
- }
- if ( $c->request->param('addpath') ){
- my $additionalpath = Path::Class::dir($c->config->{root}, $c->request->param('addpath'));
- my $view = 'TestApp::View::TT::' . ($c->request->param('view') || $c->config->{default_view});
- no strict "refs";
- push @{$view . '::include_path'}, "$additionalpath";
- use strict;
- }
-}
-
-sub test_render : Local {
- my ($self, $c) = @_;
-
- my $out = $c->stash->{message} = $c->view('TT::Appconfig')->render($c, $c->req->param('template'), {param => $c->req->param('param') || ''});
- if (UNIVERSAL::isa($out, 'Template::Exception')) {
- $c->response->body($out);
- $c->response->status(403);
- } else {
- $c->stash->{template} = 'test.tt';
- }
-
-}
-
-sub test_msg : Local {
- my ($self, $c) = @_;
- my $tmpl = $c->req->param('msg');
-
- $c->stash->{message} = $c->view('TT::AppConfig')->render($c, \$tmpl);
- $c->stash->{template} = 'test.tt';
-}
-
-sub end : Private {
- my ($self, $c) = @_;
-
- return 1 if $c->response->status =~ /^3\d\d$/;
- return 1 if $c->response->body;
-
- my $view = 'View::TT::' . ($c->request->param('view') || $c->config->{default_view});
- $c->forward($view);
-}
-
-1;
Added: branches/upstream/libcatalyst-view-tt-perl/current/t/lib/TestApp/Controller/Root.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-view-tt-perl/current/t/lib/TestApp/Controller/Root.pm?rev=46558&op=file
==============================================================================
--- branches/upstream/libcatalyst-view-tt-perl/current/t/lib/TestApp/Controller/Root.pm (added)
+++ branches/upstream/libcatalyst-view-tt-perl/current/t/lib/TestApp/Controller/Root.pm Sat Oct 31 02:44:34 2009
@@ -1,0 +1,65 @@
+package TestApp::Controller::Root;
+use base 'Catalyst::Controller';
+__PACKAGE__->config(namespace => '');
+
+sub default : Private {
+ my ($self, $c) = @_;
+
+ $c->response->redirect($c->uri_for('test'));
+}
+
+sub test : Local {
+ my ($self, $c) = @_;
+
+ $c->stash->{message} = ($c->request->param('message') || $c->config->{default_message});
+}
+
+sub test_includepath : Local {
+ my ($self, $c) = @_;
+ $c->stash->{message} = ($c->request->param('message') || $c->config->{default_message});
+ $c->stash->{template} = $c->request->param('template');
+ if ( $c->request->param('additionalpath') ){
+ my $additionalpath = Path::Class::dir($c->config->{root}, $c->request->param('additionalpath'));
+ $c->stash->{additional_template_paths} = ["$additionalpath"];
+ }
+ if ( $c->request->param('addpath') ){
+ my $additionalpath = Path::Class::dir($c->config->{root}, $c->request->param('addpath'));
+ my $view = 'TestApp::View::TT::' . ($c->request->param('view') || $c->config->{default_view});
+ no strict "refs";
+ push @{$view . '::include_path'}, "$additionalpath";
+ use strict;
+ }
+}
+
+sub test_render : Local {
+ my ($self, $c) = @_;
+
+ my $out = $c->stash->{message} = $c->view('TT::Appconfig')->render($c, $c->req->param('template'), {param => $c->req->param('param') || ''});
+ if (UNIVERSAL::isa($out, 'Template::Exception')) {
+ $c->response->body($out);
+ $c->response->status(403);
+ } else {
+ $c->stash->{template} = 'test.tt';
+ }
+
+}
+
+sub test_msg : Local {
+ my ($self, $c) = @_;
+ my $tmpl = $c->req->param('msg');
+
+ $c->stash->{message} = $c->view('TT::AppConfig')->render($c, \$tmpl);
+ $c->stash->{template} = 'test.tt';
+}
+
+sub end : Private {
+ my ($self, $c) = @_;
+
+ return 1 if $c->response->status =~ /^3\d\d$/;
+ return 1 if $c->response->body;
+
+ my $view = 'View::TT::' . ($c->request->param('view') || $c->config->{default_view});
+ $c->forward($view);
+}
+
+1;
More information about the Pkg-perl-cvs-commits
mailing list