blib/lib/Mojolicious/Plugin/Text/Minify.pm

filter: Statementstmt 100% 16 / 16 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 96.1% 25 / 26 CC 3 SCAR 6.2
CC
3
Cov
95%
__ANON__
3.0
register
1.0
BEGIN
1.0
CRAP 1.9
↑ Summary
1 package Mojolicious::Plugin::Text::Minify;
2  
3 # ABSTRACT: remove HTML indentation on the fly
4  
5 3 ▶use v5.16; # Mojolicious minimum version
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 ▶use Mojo::Base 'Mojolicious::Plugin';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 3 ▶use Text::Minify::XS v0.6.2 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 3 our $VERSION = 'v0.2.4';
12  
13 3 ▶sub register {
Subroutine register: called CC=1 SCAR=0.0
Pod documented
14 3 my ($self, $app, $conf) = @_;
15 3 ▶ $app->hook( after_render => sub {
Subroutine __ANON__: called CC=3 SCAR=11.0
16 3 my ($c, $output, $format) = @_;
17  
18 3 ▶ return if $c->stash->{'mojox.no-minify'};
Branch: 1 branch
BranchTrueFalseTotal
if $c->stash->{"mojox.no-minify"} 1 2 3
19  
20 2 ▶ if ($format eq "html") {
Branch: 1 branch
BranchTrueFalseTotal
if ($format eq "html") 2 0 2
21 2 $$output = Text::Minify::XS::minify( $$output );
22 }
23 3 });
24  
25 }
26  
27 3 1;
28  
29 __END__
↑ Summary