Yay! You're looking at a page generated by the Catalyst::View::TT plugin module.
This is the welcome page. Why not try the equally-exciting Message Page?
__message.tt2__ [% TAGS star -%] [% META title = 'Catalyst/TT View!' %]Yay! You're looking at a page generated by the Catalyst::View::TT plugin module.
We have a message for you:
.Why not try updating the message? Go on, it's really exciting, honest!
__error.tt2__ [% TAGS star -%] [% META title = 'Catalyst/TT Error' %]An error has occurred. We're terribly sorry about that, but it's one of those things that happens from time to time. Let's just hope the developers test everything properly before release...
Here's the error message, on the off-chance that it means something to you: [% error %]
__ttsite.css__ [% TAGS star %] html { height: 100%; } body { background-color: [% site.col.page %]; color: [% site.col.text %]; margin: 0px; padding: 0px; height: 100%; } #header { background-color: [% site.col.head %]; border-bottom: 1px solid [% site.col.line %]; } #footer { background-color: [% site.col.head %]; text-align: center; border-top: 1px solid [% site.col.line %]; position: absolute; bottom: 0; left: 0px; width: 100%; padding: 4px; } #content { padding: 10px; } h1.title { padding: 4px; margin: 0px; } .message { color: [% site.col.message %]; } .error { color: [% site.col.error %]; } Catalyst-View-TT-0.45/xt/pod-syntax.t 000644 000000 000000 00000000124 13705324562 017514 0 ustar 00root wheel 000000 000000 use strict; use warnings; use Test::More; use Test::Pod 1.14; all_pod_files_ok(); Catalyst-View-TT-0.45/xt/pod-coverage.t 000644 000000 000000 00000000141 13705324562 017760 0 ustar 00root wheel 000000 000000 use strict; use warnings; use Test::More; use Test::Pod::Coverage 1.04; all_pod_coverage_ok(); Catalyst-View-TT-0.45/t/01use.t 000644 000000 000000 00000000214 13705324676 016161 0 ustar 00root wheel 000000 000000 use strict; use warnings; use Test::More tests => 2; BEGIN { use_ok('Catalyst::View::TT') } BEGIN { use_ok('Catalyst::Helper::View::TT') } Catalyst-View-TT-0.45/t/13classconfig.t 000644 000000 000000 00000000773 13705324562 017667 0 ustar 00root wheel 000000 000000 use strict; use warnings; use Test::More tests => 5; use FindBin; use lib "$FindBin::Bin/lib"; use_ok('Catalyst::Test', 'TestApp'); my $view = 'Classconfig'; my $response; ok(($response = request("/test?view=$view"))->is_success, 'request ok'); is($response->content, TestApp->config->{default_message}, 'message ok'); my $message = scalar localtime; ok(($response = request("/test?view=$view&message=$message"))->is_success, 'request with message ok'); is($response->content, $message, 'message ok') Catalyst-View-TT-0.45/t/04pkgconfig.t 000644 000000 000000 00000000771 13705324562 017341 0 ustar 00root wheel 000000 000000 use strict; use warnings; use Test::More tests => 5; use FindBin; use lib "$FindBin::Bin/lib"; use_ok('Catalyst::Test', 'TestApp'); my $view = 'Pkgconfig'; my $response; ok(($response = request("/test?view=$view"))->is_success, 'request ok'); is($response->content, TestApp->config->{default_message}, 'message ok'); my $message = scalar localtime; ok(($response = request("/test?view=$view&message=$message"))->is_success, 'request with message ok'); is($response->content, $message, 'message ok') Catalyst-View-TT-0.45/t/09providers.t 000644 000000 000000 00000001060 13705324562 017404 0 ustar 00root wheel 000000 000000 use strict; use warnings; use Test::More tests => 5; use FindBin; use lib "$FindBin::Bin/lib"; use_ok('Catalyst::Test', 'TestApp'); my $response; ok(($response = request("/test_includepath?view=Providerconfig&template=test.tt"))->is_success, 'provider request'); cmp_ok($response->content, 'eq', 'Faux-tastic!', 'provider worked'); ok(($response = request("/test_includepath?view=Providerconfig&template=testpath.tt&additionalpath=test_include_path"))->is_success, 'provider request'); cmp_ok($response->content, 'eq', 'Faux-tastic!', 'provider worked'); Catalyst-View-TT-0.45/t/08cycle.t 000644 000000 000000 00000001070 13705324562 016466 0 ustar 00root wheel 000000 000000 use strict; use warnings; use Test::More; use FindBin; use lib "$FindBin::Bin/lib"; plan tests => 3; use_ok('Catalyst::View::TT'); use_ok('Catalyst::Test', 'TestApp'); my $copy; { my $view = new Catalyst::View::TT("TestApp", {}); # Can't Test::Memory::Cycle test since it doesn't detect # [ sub { $copy->paths } ] # as a cycle, but the above does prevent it getting garbage collected. # # memory_cycle_ok($view, 'No cycles in View'); $copy = $view; Scalar::Util::weaken($copy); } ok(!defined $copy, 'Copy went out of scope'); Catalyst-View-TT-0.45/t/root/ 000755 000000 000000 00000000000 13706046477 016026 5 ustar 00root wheel 000000 000000 Catalyst-View-TT-0.45/t/lib/ 000755 000000 000000 00000000000 13706046477 015611 5 ustar 00root wheel 000000 000000 Catalyst-View-TT-0.45/t/06includepath.t 000644 000000 000000 00000002763 13705324562 017677 0 ustar 00root wheel 000000 000000 use strict; use warnings; use Test::More tests => 10; use FindBin; use lib "$FindBin::Bin/lib"; use_ok('Catalyst::Test', 'TestApp'); my $response; my $inital_include_path = [ @{ TestApp->view('TT::Appconfig')->include_path } ]; ok(($response = request("/test_includepath?view=Appconfig&template=testpath.tt&additionalpath=test_include_path"))->is_success, 'additional_template_path request'); is($response->content, TestApp->config->{default_message}, 'additional_template_path message'); is_deeply($inital_include_path, TestApp->view('TT::Appconfig')->include_path, 'Include path is unchanged'); ok(($response = request("/test_includepath?view=Includepath&template=testpath.tt"))->is_success, 'scalar include path from config request'); is($response->content, TestApp->config->{default_message}, 'scalar include path with delimiter from config message'); ok(($response = request("/test_includepath?view=Includepath2&template=testpath.tt"))->is_success, 'object ref (that stringifys to the path) include path from config request'); is($response->content, TestApp->config->{default_message}, 'object ref (that stringifys to the path) include path from config message'); ok(($response = request("/test_includepath?view=Includepath3&template=testpath.tt&addpath=test_include_path"))->is_success, 'array ref include path from config not replaced by another array request'); is($response->content, TestApp->config->{default_message}, 'array ref include path from config not replaced by another array message'); Catalyst-View-TT-0.45/t/05appconfig.t 000644 000000 000000 00000000770 13705324562 017340 0 ustar 00root wheel 000000 000000 use strict; use warnings; use Test::More tests => 5; use FindBin; use lib "$FindBin::Bin/lib"; use_ok('Catalyst::Test', 'TestApp'); my $view = 'Appconfig'; my $response; ok(($response = request("/test?view=$view"))->is_success, 'request ok'); is($response->content, TestApp->config->{default_message}, 'message ok'); my $message = scalar localtime; ok(($response = request("/test?view=$view&message=$message"))->is_success, 'request with message ok'); is($response->content, $message, 'message ok') Catalyst-View-TT-0.45/t/11norequest.t 000644 000000 000000 00000000452 13705324562 017411 0 ustar 00root wheel 000000 000000 use strict; use warnings; use Test::More tests => 3; use FindBin; use lib "$FindBin::Bin/lib"; BEGIN { use_ok 'TestApp' or die } ok my $tt = TestApp->view, 'Get TT view object'; is $tt->render(undef, 'test.tt', { message => 'hello' }), 'hello', 'render() should return the template output'; Catalyst-View-TT-0.45/t/07render.t 000644 000000 000000 00000001411 13705324562 016644 0 ustar 00root wheel 000000 000000 use strict; use warnings; use Test::More tests => 7; use FindBin; use lib "$FindBin::Bin/lib"; use_ok('Catalyst::Test', 'TestApp'); my $response; ok(($response = request("/test_render?template=specified_template.tt¶m=parameterized"))->is_success, 'request ok'); is($response->content, "I should be a parameterized test in @{[TestApp->config->{name}]}", 'message ok'); my $message = 'Dynamic message'; ok(($response = request("/test_msg?msg=$message"))->is_success, 'request ok'); is($response->content, "$message", 'message ok'); $response = request("/test_render?template=non_existant_template.tt"); is (403, $response->code, 'request returned error'); is($response->content, 'file error - non_existant_template.tt: not found', 'Error from non-existant-template'); Catalyst-View-TT-0.45/t/10providers.encoding.t 000644 000000 000000 00000000737 13705324562 021173 0 ustar 00root wheel 000000 000000 use strict; use warnings; use Test::More; eval "use Template::Provider::Encoding"; if ($@) { plan skip_all => 'Template::Provider::Encoding'; } else { plan tests => 3; } use FindBin; use lib "$FindBin::Bin/lib"; use_ok('Catalyst::Test', 'TestApp'); my $response; ok(($response = request("/test_includepath?view=Encoding&template=test.tt&additionalpath=test_include_path"))->is_success, 'provider request'); cmp_ok($response->content, 'eq', 'hi', 'provider worked'); Catalyst-View-TT-0.45/t/12expose_methods.t 000644 000000 000000 00000000766 13705324676 020431 0 ustar 00root wheel 000000 000000 use strict; use warnings; use Test::More 0.88; use FindBin; use lib "$FindBin::Bin/lib"; use_ok('Catalyst::Test', 'TestApp'); my $response; ok(($response = request("/test?view=ExposeMethods&template=expose_methods.tt"))->is_success, 'request ok'); is($response->content, "magic added param", 'message ok'); ok(($response = request("/test?view=ExposeMethodsSubclassed&template=expose_methods.tt"))->is_success, 'request ok'); is($response->content, "magic added param", 'message ok'); done_testing; Catalyst-View-TT-0.45/t/utf8.t 000644 000000 000000 00000001715 13705324676 016121 0 ustar 00root wheel 000000 000000 use utf8; use warnings; use strict; use Test::More 0.88; use File::Spec; { package MyApp::Controller::Root; $INC{'MyApp/Controller/Root.pm'} = __FILE__; use base 'Catalyst::Controller'; sub heart :Path('♥') { my ($self, $c) = @_; $c->stash(hearts=>'♥♥♥'); $c->detach('View::HTML'); } package MyApp::View::HTML; $INC{'MyApp/View/HTML.pm'} = __FILE__; use base 'Catalyst::View::TT'; MyApp::View::HTML->config( ENCODING => 'UTF-8', INCLUDE_PATH=> File::Spec->catfile('t')); package MyApp; use Catalyst; MyApp->setup; } use Catalyst::Test 'MyApp'; if(MyApp->can('encoding') and MyApp->can('clear_encoding') ) { ok my $res = request '/root/♥'; is $res->code, 200, 'OK'; is $res->decoded_content, "This heart literal ♥
This is heart var ♥♥♥
\n", 'correct body'; is $res->content_charset, 'UTF-8'; } else { ok 1, 'Skipping the UTF8 Tests for older installed catalyst'; } done_testing; Catalyst-View-TT-0.45/t/14alt_content_type.t 000644 000000 000000 00000001032 13705324676 020743 0 ustar 00root wheel 000000 000000 use strict; use warnings; use Test::More 0.88; use FindBin; use lib "$FindBin::Bin/lib"; use_ok('Catalyst::Test', 'TestApp'); # Hack to support Catalyst v5.90080+ (JNAP) if(TestApp->can('encoding') and (my $enc = TestApp->encoding) and TestApp->can('clear_encoding')) { is(request("/test_alt_content_type")->header('Content-Type'), "text/plain; charset=${\$enc->mime_name}", "Plain text with ${\$enc->mime_name}"); } else { is(request("/test_alt_content_type")->header('Content-Type'), 'text/plain', 'Plain Text'); } done_testing; Catalyst-View-TT-0.45/t/lib/TestApp.pm 000644 000000 000000 00000000710 13706045361 017514 0 ustar 00root wheel 000000 000000 package TestApp; use strict; use warnings; use Catalyst; # qw/-Debug/; use Path::Class; our $VERSION = '0.01'; __PACKAGE__->config( name => 'TestApp', default_message => 'hi', default_view => 'TT::Pkgconfig', 'View::TT::Appconfig' => { PRE_CHOMP => 1, POST_CHOMP => 1, TEMPLATE_EXTENSION => '.tt', render_die => 1, }, ); __PACKAGE__->setup; Catalyst-View-TT-0.45/t/lib/TestApp/ 000755 000000 000000 00000000000 13706046477 017171 5 ustar 00root wheel 000000 000000 Catalyst-View-TT-0.45/t/lib/TestApp/Template/ 000755 000000 000000 00000000000 13706046477 020744 5 ustar 00root wheel 000000 000000 Catalyst-View-TT-0.45/t/lib/TestApp/FauxProvider.pm 000644 000000 000000 00000000636 13705324562 022143 0 ustar 00root wheel 000000 000000 package TestApp::FauxProvider; use Template::Constants; use base qw(Template::Provider); sub fetch { my $self = shift(); my $name = shift(); my $data = { name => $name, path => $name, text => 'Faux-tastic!', 'time' => time(), load => time() }; my ($page, $error) = $self->_compile($data); return ($page->{'data'}, $error); } 1; Catalyst-View-TT-0.45/t/lib/TestApp/View/ 000755 000000 000000 00000000000 13706046477 020103 5 ustar 00root wheel 000000 000000 Catalyst-View-TT-0.45/t/lib/TestApp/root/ 000755 000000 000000 00000000000 13706046477 020154 5 ustar 00root wheel 000000 000000 Catalyst-View-TT-0.45/t/lib/TestApp/Controller/ 000755 000000 000000 00000000000 13706046477 021314 5 ustar 00root wheel 000000 000000 Catalyst-View-TT-0.45/t/lib/TestApp/Controller/Root.pm 000644 000000 000000 00000004324 13706046127 022570 0 ustar 00root wheel 000000 000000 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}); $c->stash->{template} = $c->request->param('template'); } 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 $p_view = $c->request->param('view'); my $view = 'TestApp::View::' . ($p_view ? "TT::$p_view" : $c->config->{default_view}); no strict "refs"; push @{$view . '::include_path'}, "$additionalpath"; use strict; } } sub test_render : Local { my ($self, $c) = @_; $c->stash->{message} = eval { $c->view('TT::Appconfig')->render($c, $c->req->param('template'), {param => $c->req->param('param') || ''}) }; if (my $err = $@) { $c->response->body($err); $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 test_alt_content_type : Local { my ($self, $c) = @_; $c->stash( message => 'test_alt_content_type'); $c->forward('View::TT::AltContentType'); } sub end : Private { my ($self, $c) = @_; return 1 if $c->response->status =~ /^3\d\d$/; return 1 if $c->response->body; my $p_view = $c->request->param('view'); my $view = 'View::' . ($p_view ? "TT::$p_view" : $c->config->{default_view}); $c->forward($view); } 1; Catalyst-View-TT-0.45/t/lib/TestApp/root/any_include_path/ 000755 000000 000000 00000000000 13706046477 023462 5 ustar 00root wheel 000000 000000 Catalyst-View-TT-0.45/t/lib/TestApp/root/test_alt_content_type.tt 000644 000000 000000 00000000015 13705324562 025124 0 ustar 00root wheel 000000 000000 [% message %] Catalyst-View-TT-0.45/t/lib/TestApp/root/test.tt 000644 000000 000000 00000000015 13705324562 021471 0 ustar 00root wheel 000000 000000 [% message %] Catalyst-View-TT-0.45/t/lib/TestApp/root/test_include_path/ 000755 000000 000000 00000000000 13706046477 023652 5 ustar 00root wheel 000000 000000 Catalyst-View-TT-0.45/t/lib/TestApp/root/expose_methods.tt 000644 000000 000000 00000000043 13705324562 023541 0 ustar 00root wheel 000000 000000 [% exposed_method('added param') %] Catalyst-View-TT-0.45/t/lib/TestApp/root/specified_template.tt 000644 000000 000000 00000000055 13705324562 024344 0 ustar 00root wheel 000000 000000 I should be a [% param %] test in [% name %] Catalyst-View-TT-0.45/t/lib/TestApp/root/test_include_path/testpath.tt 000644 000000 000000 00000000016 13705324562 026045 0 ustar 00root wheel 000000 000000 [% message %] Catalyst-View-TT-0.45/t/lib/TestApp/root/any_include_path/test 000644 000000 000000 00000000015 13705324562 024351 0 ustar 00root wheel 000000 000000 [% message %] Catalyst-View-TT-0.45/t/lib/TestApp/View/TT/ 000755 000000 000000 00000000000 13706046477 020432 5 ustar 00root wheel 000000 000000 Catalyst-View-TT-0.45/t/lib/TestApp/View/TT/Includepath2.pm 000644 000000 000000 00000000541 13705324562 023303 0 ustar 00root wheel 000000 000000 package TestApp::View::TT::Includepath2; use FindBin; use Path::Class; use strict; use base 'Catalyst::View::TT'; my $includepath = dir($FindBin::Bin, '/lib/TestApp/root/test_include_path'); __PACKAGE__->config( PRE_CHOMP => 1, POST_CHOMP => 1, TEMPLATE_EXTENSION => '.tt', INCLUDE_PATH => $includepath, ); 1; Catalyst-View-TT-0.45/t/lib/TestApp/View/TT/Providerconfig.pm 000644 000000 000000 00000000651 13705324562 023743 0 ustar 00root wheel 000000 000000 package TestApp::View::TT::Providerconfig; use strict; use base 'Catalyst::View::TT'; __PACKAGE__->config( PRE_CHOMP => 1, POST_CHOMP => 1, TEMPLATE_EXTENSION => '.tt', PROVIDERS => [ { name => '+TestApp::FauxProvider', args => {} }, # { # name => '_file_', # args => {} # } ] ); 1; Catalyst-View-TT-0.45/t/lib/TestApp/View/TT/Appconfig.pm 000644 000000 000000 00000000126 13705324562 022666 0 ustar 00root wheel 000000 000000 package TestApp::View::TT::Appconfig; use strict; use base 'Catalyst::View::TT'; 1; Catalyst-View-TT-0.45/t/lib/TestApp/View/TT/Includepath3.pm 000644 000000 000000 00000000566 13705324562 023313 0 ustar 00root wheel 000000 000000 package TestApp::View::TT::Includepath3; use FindBin; use Path::Class; use strict; use base 'Catalyst::View::TT'; our @include_path; my $includepath = dir($FindBin::Bin, '/lib/TestApp/root/test_include_path'); __PACKAGE__->config( PRE_CHOMP => 1, POST_CHOMP => 1, TEMPLATE_EXTENSION => '.tt', INCLUDE_PATH => \@include_path, ); 1; Catalyst-View-TT-0.45/t/lib/TestApp/View/TT/Pkgconfig.pm 000644 000000 000000 00000000312 13705324562 022664 0 ustar 00root wheel 000000 000000 package TestApp::View::TT::Pkgconfig; use strict; use base 'Catalyst::View::TT'; __PACKAGE__->config( PRE_CHOMP => 1, POST_CHOMP => 1, TEMPLATE_EXTENSION => '.tt', ); 1; Catalyst-View-TT-0.45/t/lib/TestApp/View/TT/Classconfig.pm 000644 000000 000000 00000000302 13705324562 023207 0 ustar 00root wheel 000000 000000 package TestApp::View::TT::Classconfig; use strict; use base 'Catalyst::View::TT'; use TestApp::Template::Any; __PACKAGE__->config( CLASS => 'TestApp::Template::Any', ); 1; Catalyst-View-TT-0.45/t/lib/TestApp/View/TT/ExposeMethods.pm 000644 000000 000000 00000000527 13705324562 023554 0 ustar 00root wheel 000000 000000 package TestApp::View::TT::ExposeMethods; use Moose; extends 'Catalyst::View::TT'; __PACKAGE__->config( expose_methods => [q/exposed_method/], ); sub exposed_method { my ($self, $c, $some_param) = @_; unless ($some_param) { Catalyst::Exception->throw( "no param passed" ); } return 'magic ' . $some_param; } 1; Catalyst-View-TT-0.45/t/lib/TestApp/View/TT/ExposeMethodsSubclassed.pm 000644 000000 000000 00000000160 13705324562 025556 0 ustar 00root wheel 000000 000000 package TestApp::View::TT::ExposeMethodsSubclassed; use Moose; extends 'TestApp::View::TT::ExposeMethods'; 1; Catalyst-View-TT-0.45/t/lib/TestApp/View/TT/AltContentType.pm 000644 000000 000000 00000000260 13705324562 023674 0 ustar 00root wheel 000000 000000 package TestApp::View::TT::AltContentType; use strict; use base 'Catalyst::View::TT'; __PACKAGE__->config( TEMPLATE_EXTENSION => '.tt', content_type => 'text/plain', ); Catalyst-View-TT-0.45/t/lib/TestApp/View/TT/Encoding.pm 000644 000000 000000 00000000767 13705324562 022521 0 ustar 00root wheel 000000 000000 package TestApp::View::TT::Encoding; use strict; use base 'Catalyst::View::TT'; __PACKAGE__->config( PRE_CHOMP => 1, POST_CHOMP => 1, TEMPLATE_EXTENSION => '.tt', 'TEMPLATE_EXTENSION' => '.tt', 'DEFAULT_ENCODING' => 'utf-8', PROVIDERS => [ { name => 'Encoding', copy_config => [qw(INCLUDE_PATH DEFAULT_ENCODING PRE_CHOMP POST_CHOMP)] } ], ) if eval { require Template::Provider::Encoding; }; 1; Catalyst-View-TT-0.45/t/lib/TestApp/View/TT/Includepath.pm 000644 000000 000000 00000000546 13705324562 023226 0 ustar 00root wheel 000000 000000 package TestApp::View::TT::Includepath; use FindBin; use Path::Class; use strict; use base 'Catalyst::View::TT'; my $includepath = dir($FindBin::Bin, '/lib/TestApp/root/test_include_path'); __PACKAGE__->config( PRE_CHOMP => 1, POST_CHOMP => 1, TEMPLATE_EXTENSION => '.tt', INCLUDE_PATH => "aaa:$includepath", ); 1; Catalyst-View-TT-0.45/t/lib/TestApp/Template/Any.pm 000644 000000 000000 00000000635 13705324562 022026 0 ustar 00root wheel 000000 000000 use strict; use warnings; package TestApp::Template::Any; use base 'Template'; use FindBin; use Path::Class; sub new { my $class = shift; my $params = defined($_[0]) && ref($_[0]) eq 'HASH' ? shift : {@_}; my $includepath = dir($FindBin::Bin, '/lib/TestApp/root/any_include_path'); $params->{INCLUDE_PATH} = $includepath; return $class->SUPER::new( $params ); } 1; Catalyst-View-TT-0.45/t/root/heart 000644 000000 000000 00000000102 13705324562 017036 0 ustar 00root wheel 000000 000000This heart literal ♥
This is heart var [% hearts%]