[Jifty-commit] r6770 - jifty/trunk/lib/Jifty/View/Declare

Jifty commits jifty-commit at lists.jifty.org
Thu Apr 9 23:10:10 EDT 2009


Author: alexmv
Date: Thu Apr  9 23:10:09 2009
New Revision: 6770

Modified:
   jifty/trunk/lib/Jifty/View/Declare/Handler.pm

Log:
Avoid use of "packge HTML::Mason::Exception", which cause PAUSE to hate us

Modified: jifty/trunk/lib/Jifty/View/Declare/Handler.pm
==============================================================================
--- jifty/trunk/lib/Jifty/View/Declare/Handler.pm	(original)
+++ jifty/trunk/lib/Jifty/View/Declare/Handler.pm	Thu Apr  9 23:10:09 2009
@@ -100,30 +100,30 @@
     return undef;
 }
 
-package HTML::Mason::Exception;
-no warnings 'redefine';
+{
+    no warnings 'redefine';
 
-sub template_stack {
-    my $self = shift;
-    return [] unless Jifty->handler and Jifty->handler->buffer;
-    unless ($self->{_stack}) {
-        $self->{_stack} = [reverse grep defined $_, map {$_->{from}} @{Jifty->handler->buffer->{stack}}],
+    sub HTML::Mason::Exception::template_stack {
+        my $self = shift;
+        return [] unless Jifty->handler and Jifty->handler->buffer;
+        unless ($self->{_stack}) {
+            $self->{_stack} = [reverse grep defined $_, map {$_->{from}} @{Jifty->handler->buffer->{stack}}],
+        }
+        return $self->{_stack};
     }
-    return $self->{_stack};
-}
 
-sub as_text
-{
-    my ($self) = @_;
-    my $msg = $self->full_message;
-    my @template_stack = @{$self->template_stack};
-    if (@template_stack) {
-        my $stack = join("\n", map { sprintf("  [%s]", $_) } @template_stack);
-        return sprintf("%s\nTemplate stack:\n%s\n", $msg, $stack);
-    } else {
-        my $info = $self->analyze_error;
-        my $stack = join("\n", map { sprintf("  [%s:%d]", $_->filename, $_->line) } @{$info->{frames}});
-        return sprintf("%s\nStack:\n%s\n", $msg, $stack);
+    sub HTML::Mason::Exception::as_text {
+        my ($self) = @_;
+        my $msg = $self->full_message;
+        my @template_stack = @{$self->template_stack};
+        if (@template_stack) {
+            my $stack = join("\n", map { sprintf("  [%s]", $_) } @template_stack);
+            return sprintf("%s\nTemplate stack:\n%s\n", $msg, $stack);
+        } else {
+            my $info = $self->analyze_error;
+            my $stack = join("\n", map { sprintf("  [%s:%d]", $_->filename, $_->line) } @{$info->{frames}});
+            return sprintf("%s\nStack:\n%s\n", $msg, $stack);
+        }
     }
 }
 


More information about the Jifty-commit mailing list