Changeset 2220

Show
Ignore:
Timestamp:
05/03/07 06:03:46
Author:
miyagawa
Message:

Checking in changes prior to tagging of version 0.05. Changelog diff is:

=== Changes
==================================================================
--- Changes (revision 5888)
+++ Changes (local)
@@ -1,5 +1,12 @@

Revision history for Perl extension Catalyst::View
Jemplate

+0.05 Tue May 1 00:11:30 PDT 2007
+ - Fixed cache to work with new Catalyst::Plugin::Cache modules
+ (Thanks to Takeda Akihito)
+
+0.04 Fri Feb 23 09:59:06 PST 2007
+ - Added 'runtime' functionality to serve Jemplate.js (Fujiwara Shuichiro)
+

0.03 Fri Dec 1 02:16:38 PST 2006

- Added caching and the ability to specify which file to jemplatize (Daisuke Maki)

- Added Helper Catalyst::Helper::View
Jemplate (Daisuke Maki)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Catalyst-View-Jemplate/trunk/Changes

    r2113 r2220  
    11Revision history for Perl extension Catalyst::View::Jemplate 
     2 
     30.05  Tue May  1 00:11:30 PDT 2007 
     4        - Fixed cache to work with new Catalyst::Plugin::Cache modules 
     5          (Thanks to Takeda Akihito) 
     6 
     70.04  Fri Feb 23 09:59:06 PST 2007 
     8        - Added 'runtime' functionality to serve Jemplate.js (Fujiwara Shuichiro) 
    29 
    3100.03  Fri Dec  1 02:16:38 PST 2006 
  • Catalyst-View-Jemplate/trunk/MANIFEST

    r2112 r2220  
    44Makefile.PL 
    55MANIFEST                        This list of files 
    6 META.yml                        Module meta-data (added by MakeMaker) 
    76t/00_compile.t 
    87t/01_live.t 
  • Catalyst-View-Jemplate/trunk/MANIFEST.SKIP

    r1778 r2220  
    1010\.gz$ 
    1111\.cvsignore 
     12.shipit 
  • Catalyst-View-Jemplate/trunk/Makefile.PL

    r1806 r2220  
    55    'PREREQ_PM' => { 
    66        Test::More => 0.32, 
    7         Jemplate => 0.18
     7        Jemplate => 0.19
    88        Catalyst => 5.50, 
    99        File::Find::Rule => 0, 
  • Catalyst-View-Jemplate/trunk/lib/Catalyst/View/Jemplate.pm

    r2112 r2220  
    22 
    33use strict; 
    4 our $VERSION = '0.03'; 
     4our $VERSION = '0.05'; 
    55 
    66use base qw( Catalyst::View ); 
     
    3434 
    3535    my $data   = $c->stash->{jemplate}; 
    36     my $cache  = $c->can('cache') ? $c->cache("jemplate") : undef; 
     36    my $cache  = $c->can('curry_cache') ? $c->cache("jemplate") 
     37               : $c->can('cache')       ? $c->cache 
     38               :                          undef; 
    3739    my $output = ''; 
    3840 
     
    7173        } 
    7274 
     75        # add runtime 
     76        if ($data && $data->{runtime}) { 
     77            $output = Jemplate->runtime_source_code(); 
     78        } 
     79 
    7380        # xxx error handling? 
    74         $output = Jemplate->compile_template_files(@files); 
     81        $output .= Jemplate->compile_template_files(@files); 
    7582        if ($cache) { 
    7683            $cache->set($cache_key, $output); 
     
    119126      $c->stash->{jemplate} = { 
    120127          files => [ 'foo.tt', 'bar.tt' ] 
     128      } 
     129  } 
     130 
     131  # To serve Jemplate rutime 
     132  sub runtime : Path('Jemplate.js') { 
     133      my($self, $c) = @_; 
     134      $c->stash->{jemplate} = { 
     135          runtime => 1, 
     136          files   => [],  # runtime only 
    121137      } 
    122138  } 
  • Catalyst-View-Jemplate/trunk/t/01_live.t

    r2111 r2220  
    55use lib "$FindBin::Bin/lib"; 
    66 
    7 use Test::More tests => 12
     7use Test::More tests => 18
    88use Catalyst::Test 'TestApp'; 
    99 
     
    5050    like $response->content, qr!//line 1 "bar\.tt"!; 
    5151} 
     52 
     53{ 
     54    my $request = HTTP::Request->new( GET => "http://localhost/Jemplate.js" ); 
     55 
     56    ok( my $response = request($request), 'Request' ); 
     57    ok( $response->is_success, 'Response Successful 2xx' ); 
     58    is( $response->code, 200, 'Response Code' ); 
     59 
     60    is_deeply( [ $response->content_type ], [ 'text/javascript', 'charset=utf-8' ] ); 
     61 
     62    unlike $response->content, qr!//line 1 "foo\.tt"!; 
     63    like $response->content, qr!// Main Jemplate class!; 
     64} 
  • Catalyst-View-Jemplate/trunk/t/lib/TestApp.pm

    r2111 r2220  
    3636} 
    3737 
     38sub runtime : Path('Jemplate.js') { 
     39    my ( $self, $c ) = @_; 
     40 
     41    $c->stash->{jemplate} = { 
     42        runtime => 1, 
     43        files   => [], 
     44    }; 
     45    $c->forward('View::Jemplate'); 
     46} 
     47 
    38481;