[Jifty-commit] r3863 - in jifty/trunk: lib/Jifty/View/Declare lib/Jifty/Web

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sun Aug 12 19:01:51 EDT 2007


Author: sterling
Date: Sun Aug 12 19:01:50 2007
New Revision: 3863

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/View/Declare/Compile.pm
   jifty/trunk/lib/Jifty/Web/PageRegion.pm

Log:
 r8581 at riddle:  andrew | 2007-08-12 18:01:14 -0500
 Added more POD to fix coverage issues and added a description to the client_cacheable and client_cache_content methods of PageRegion.


Modified: jifty/trunk/lib/Jifty/View/Declare/Compile.pm
==============================================================================
--- jifty/trunk/lib/Jifty/View/Declare/Compile.pm	(original)
+++ jifty/trunk/lib/Jifty/View/Declare/Compile.pm	Sun Aug 12 19:01:50 2007
@@ -12,14 +12,60 @@
          CVf_METHOD CVf_LOCKED CVf_LVALUE CVf_ASSERTION
 	 PMf_KEEP PMf_GLOBAL PMf_CONTINUE PMf_EVAL PMf_ONCE PMf_SKIPWHITE
 	 PMf_MULTILINE PMf_SINGLELINE PMf_FOLD PMf_EXTENDED);
+
 BEGIN {
     die "You need a custom version of B::Deparse from http://svn.jifty.org/svn/jifty.org/B/"
         unless B::Deparse->can('e_method')
 }
+
+=head1 NAME
+
+Jifty::View::Declare::Compile - Compile Jifty templates into JavaScript
+
+=head1 DESCRIPTION
+
+B<EXPERIMENTAL:> This code is currently under development and experimental. You will need to get the version of the L<B::Deparse> package from the Subversion repository at:
+
+  http://svn.jifty.org/svn/jifty.org/B/
+
+in order to use this class.
+
+This is a subclass of L<B::Deparse> that compiles Perl into JavaScript with the intention of allowing Jifty applications to render L<Template::Declare> templates on the client.
+
+This class does the dirty work of translating a Perl code reference in JavaScript. 
+
+See L<Jifty::Web::PageRegion/client_cache_content>.
+
+=head1 METHODS
+
+=head2 is_scope
+
+See L<B::Deparse>.
+
+=cut
+
 sub is_scope { goto \&B::Deparse::is_scope }
+
+=head2 is_state
+
+See L<B::Deparse>
+
+=cut
+
 sub is_state { goto \&B::Deparse::is_state }
+
+=head2 null
+
+See L<B::Deparse>
+
+=cut
+
 sub null { goto \&B::Deparse::null }
 
+=head2 padname
+
+=cut
+
 sub padname {
     my $self = shift;
     my $targ = shift;
@@ -32,6 +78,10 @@
         map {@{$_||[]}} @CGI::EXPORT_TAGS{qw/:html2 :html3 :html4 :netscape :form/}
 );
 
+=head2 deparse
+
+=cut
+
 sub deparse {
     my $self = shift;
     my $ret = $self->SUPER::deparse(@_);
@@ -39,6 +89,10 @@
     return $ret;
 }
 
+=head2 loop_common
+
+=cut
+
 sub loop_common {
     my $self = shift;
     my($op, $cx, $init) = @_;
@@ -94,6 +148,10 @@
     return $self->SUPER::loop_common(@_);
 }
 
+=head2 maybe_my
+
+=cut
+
 sub maybe_my {
     my $self = shift;
     my($op, $cx, $text) = @_;
@@ -108,6 +166,10 @@
     }
 }
 
+=head2 maybe_parens_func
+
+=cut
+
 sub maybe_parens_func {
     my $self = shift;
     my($func, $text, $cx, $prec) = @_;
@@ -115,6 +177,10 @@
 
 }
 
+=head2 const
+
+=cut
+
 sub const {
     my $self = shift;
     my($sv, $cx) = @_;
@@ -124,10 +190,28 @@
     return $self->SUPER::const(@_);
 }
 
+=head2 pp_undef
+
+=cut
+
 sub pp_undef { 'null' }
+
+=head2 pp_sne
+
+=cut
+
 sub pp_sne { shift->binop(@_, "!=", 14) }
+
+=head2 pp_grepwhile
+
+=cut
+
 sub pp_grepwhile { shift->mapop(@_, "grep") }
 
+=head2 mapop
+
+=cut
+
 sub mapop {
     my $self = shift;
     my($op, $cx, $name) = @_;
@@ -149,12 +233,20 @@
     return "(".join(", ", @exprs).").select(function (\$_) $code)";
 }
 
+=head2 e_anoncode
+
+=cut
+
 sub e_anoncode {
     my ($self, $info) = @_;
     my $text = $self->deparse_sub($info->{code});
     return "function () " . $text;
 }
 
+=head2 e_anonhash
+
+=cut
+
 sub e_anonhash {
     my ($self, $info) = @_;
     my @exprs = @{$info->{exprs}};
@@ -165,6 +257,10 @@
     return '{' . join(", ", @pairs) . '}';
 }
 
+=head2 pp_entersub
+
+=cut
+
 sub pp_entersub {
     my $self = shift;
     my $ret = $self->SUPER::pp_entersub(@_);
@@ -173,6 +269,10 @@
     return $ret;
 }
 
+=head2 e_method
+
+=cut
+
 sub e_method {
     my ($self, $info) = @_;
     my $obj = $info->{object};
@@ -190,6 +290,10 @@
     return $kid . "(" . $args . ")"; # parens mandatory
 }
 
+=head2 walk_linesq
+
+=cut
+
 sub walk_lineseq {
     my ($self, $op, $kids, $callback) = @_;
     my $xcallback = $callback;
@@ -201,10 +305,20 @@
     $self->SUPER::walk_lineseq($op, $kids, $callback);
 }
 
+=head2 compile_to_js
+
+=cut
+
 sub compile_to_js {
     my $class = shift;
     my $code = shift;
     return 'function() '.$class->new->coderef2text($code);
 }
 
+=head1 SEE ALSO
+
+L<B::Deparse>, L<Jifty::Web::PageRegion/client_cache_content>
+
+=cut
+
 1;

Modified: jifty/trunk/lib/Jifty/Web/PageRegion.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web/PageRegion.pm	(original)
+++ jifty/trunk/lib/Jifty/Web/PageRegion.pm	Sun Aug 12 19:01:50 2007
@@ -388,6 +388,8 @@
 
 =head2 client_cacheable
 
+Returns the client cacheable state of the regions path. Returns false if the template has not been marked as client cacheable. Otherwise it returns the string "static" or "action" based uon the cacheable attribute set on the template.
+
 =cut
 
 sub client_cacheable {
@@ -397,7 +399,9 @@
     return Jifty::View::Declare::BaseClass->client_cacheable($self->path);
 }
 
-=head2 client_cacheable
+=head2 client_cache_content
+
+Returns the template as JavaScript code.
 
 =cut
 


More information about the Jifty-commit mailing list