Catalyst-DispatchType-Regex

 view release on metacpan or  search on metacpan

t/lib/TestApp/View/Dump.pm  view on Meta::CPAN

package TestApp::View::Dump;

use strict;
use base 'Catalyst::View';

use Data::Dumper ();
use Scalar::Util qw(blessed weaken);

sub dump {
    my ( $self, $reference, $purity ) = @_;

    return unless $reference;

    $purity = defined $purity ? $purity : 1;

    my $dumper = Data::Dumper->new( [$reference] );
    $dumper->Indent(1);

t/lib/TestApp/View/Dump.pm  view on Meta::CPAN

    if ( my $output =
        $self->dump( $reference, $purity ) )
    {

        $c->res->headers->content_type('text/plain');
        $c->res->output($output);

        if ($context) {
            # Repair context
            $reference->{_context} = $context;
            weaken( $reference->{_context} );
        }

        if ($body) {
            # Repair body
            delete $reference->{__body_type};
            $reference->{_body} = $body;
        }

        return 1;
    }



( run in 1.724 second using v1.01-cache-2.11-cpan-39bf76dae61 )