jjn1056/Plack-Middleware-Debug-DBIC-QueryLog — pull request #1 by bokutin (2014-10-24 08:06:47+00:00)
Title: rewind template DATA

Hello.

I use this module very conveniently.

I am doing the pre-loading of the module, but I have encountered a bug template becomes empty.
% plack -MPlack::Middleware::Debug::DBIC::QueryLog ...

I tried to write a patch.

If it is good, thank you to merge.

Cheers,
Tomohiro Hosaka

% pwd
/home/bokutin/code/reading/Plack-Middleware-Debug-DBIC-QueryLog
% cat reuse.pl
use Modern::Perl;
use Plack::Middleware::Debug::DBIC::QueryLog;

my $o1 = Plack::Middleware::Debug::DBIC::QueryLog->new;
my $o2 = Plack::Middleware::Debug::DBIC::QueryLog->new;

say "--------------";
say $o1->template->( count => 1, elapsed_time => 1, sorted_queries => [] ) =~ s/#plDebug .where.*/.../rs;
say "--------------";
say $o2->template->( count => 1, elapsed_time => 1, sorted_queries => [] ) =~ s/#plDebug .where.*/.../rs;
say "--------------";
% perl reuse.pl
--------------