File Coverage

blib/lib/Web/AssetLib/MinifierEngine.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             package Web::AssetLib::MinifierEngine;
2              
3 7     7   530874 use Moose;
  7         306667  
  7         51  
4              
5             with 'Web::AssetLib::Role::Logger';
6              
7 7     7   31920 no Moose;
  7         11  
  7         27  
8             1;
9              
10             =pod
11            
12             =encoding UTF-8
13            
14             =head1 NAME
15              
16             Web::AssetLib::MinifierEngine - a base class for writing your own Minifier Engine
17              
18             =head1 SYNOPSIS
19              
20             package My::Library::MinifierEngine;
21              
22             use Method::Signatures;
23             use Moose;
24              
25             extends 'Web::AssetLib::MinifierEngine';
26              
27             method minify( :$contents!, :$type ) {
28             # do minification
29             return $minified;
30             }
31              
32             =head1 USAGE
33              
34             If you have a need for a special file minification scenario, you
35             can simply extend this class, and it will plug in to the rest of
36             the Web::AssetLib pipeline.
37              
38             The only requirement is that your Output Engine implements the
39             L<< minify(...)|/"minify( :$contents!, :$type )" >>
40             method, which returns the minfied string.
41              
42             =head1 IMPLEMENTATION
43              
44             =head2 minify( :$contents!, :$type )
45              
46             C<< $contents >> and C<< $type >> are both strings. Minify the content, and
47             return it as a string.
48              
49             =head1 SEE ALSO
50              
51             L<Web::AssetLib::MinifierEngine::Standard>
52              
53             =head1 AUTHOR
54            
55             Ryan Lang <rlang@cpan.org>
56              
57             =cut