Merge remote branch 'origin/suppress_data_dumper_warnings'
Tomas Doran [Fri, 21 Oct 2011 14:55:50 +0000 (08:55 -0600)]
* origin/suppress_data_dumper_warnings:
  fixing to work with perl 5.8
  Suppressing Data::Dumper warnings in test t/aggregate/live_component_controller_action_action.t

t/lib/TestApp/View/Dump.pm
t/lib/TestApp/View/Dump/Action.pm

index a59e417..d7cc1a2 100644 (file)
@@ -7,13 +7,15 @@ use Data::Dumper ();
 use Scalar::Util qw(blessed weaken);
 
 sub dump {
-    my ( $self, $reference ) = @_;
+    my ( $self, $reference, $purity ) = @_;
 
     return unless $reference;
 
+    $purity = defined $purity ? $purity : 1;
+
     my $dumper = Data::Dumper->new( [$reference] );
     $dumper->Indent(1);
-    $dumper->Purity(1);
+    $dumper->Purity($purity);
     $dumper->Useqq(0);
     $dumper->Deepcopy(1);
     $dumper->Quotekeys(0);
@@ -23,7 +25,7 @@ sub dump {
 }
 
 sub process {
-    my ( $self, $c, $reference ) = @_;
+    my ( $self, $c, $reference, $purity ) = @_;
 
     # Force processing of on-demand data
     $c->prepare_body;
@@ -37,7 +39,7 @@ sub process {
     my $context = delete $reference->{_context};
 
     if ( my $output =
-        $self->dump( $reference ) )
+        $self->dump( $reference, $purity ) )
     {
 
         $c->res->headers->content_type('text/plain');
index a8c7a97..e15af5a 100644 (file)
@@ -5,7 +5,7 @@ use base qw[TestApp::View::Dump];
 
 sub process {
     my ( $self, $c ) = @_;
-    return $self->SUPER::process( $c, $c->action );
+    return $self->SUPER::process( $c, $c->action, 0 );
 }
 
 1;