[Jifty-commit] r6522 - in Template-Declare/trunk: . lib/Template

Jifty commits jifty-commit at lists.jifty.org
Fri Feb 27 15:04:47 EST 2009


Author: alexmv
Date: Fri Feb 27 15:04:46 2009
New Revision: 6522

Modified:
   Template-Declare/trunk/   (props changed)
   Template-Declare/trunk/lib/Template/Declare.pm
   Template-Declare/trunk/t/utils.pl

Log:
 r42798 at kohr-ah:  chmrr | 2009-02-27 14:57:17 -0500
 Support, but deprecate, Template::Declare->buffer->data(...) usage


Modified: Template-Declare/trunk/lib/Template/Declare.pm
==============================================================================
--- Template-Declare/trunk/lib/Template/Declare.pm	(original)
+++ Template-Declare/trunk/lib/Template/Declare.pm	Fri Feb 27 15:04:46 2009
@@ -8,7 +8,7 @@
 use Class::ISA;
 use String::BufferStack;
 
-our $VERSION = "0.37";
+our $VERSION = "0.38";
 
 use base 'Class::Data::Inheritable';
 __PACKAGE__->mk_classdata('roots');
@@ -30,7 +30,14 @@
 __PACKAGE__->buffer( String::BufferStack->new );
 __PACKAGE__->around_template( undef );
 
-*String::BufferStack::data = \&String::BufferStack::buffer;
+*String::BufferStack::data = sub {
+    my $ref = shift;
+    if (@_) {
+        warn "Template::Declare->buffer->data called with argument; this usage is deprecated";
+        ${$ref->buffer_ref} = join("", @_);
+    }
+    return $ref->buffer;
+};
 
 use vars qw/$TEMPLATE_VARS/;
 

Modified: Template-Declare/trunk/t/utils.pl
==============================================================================
--- Template-Declare/trunk/t/utils.pl	(original)
+++ Template-Declare/trunk/t/utils.pl	Fri Feb 27 15:04:46 2009
@@ -5,21 +5,20 @@
 
 sub ok_lint {
     my $html = shift;
-  
-    if (! eval { require HTML::Lint } ) {
-        ok(1, "HTML::Lint not installed. Skipping");
-        return
-    }
 
+SKIP:
     {
-    my $lint = HTML::Lint->new;
-     $lint->parse($html); 
-     is( $lint->errors, 0, "Lint checked clean" );
-    foreach my $error ( $lint->errors ) {
-        diag( $error->as_string );
-        }}
+        skip "HTML::Lint not installed. Skipping", 1
+            unless eval { require HTML::Lint; 1 };
 
-}
+        my $lint = HTML::Lint->new;
+        $lint->parse($html);
+        is( $lint->errors, 0, "Lint checked clean" );
+        foreach my $error ( $lint->errors ) {
+            diag( $error->as_string );
+        }
+    }
 
+}
 
 1;


More information about the Jifty-commit mailing list