File Coverage

blib/lib/File/HashCache/JavaScript.pm
Criterion Covered Total %
statement 9 9 100.0
branch 1 2 50.0
condition n/a
subroutine 3 3 100.0
pod 0 1 0.0
total 13 15 86.6


line stmt bran cond sub pod time code
1             # Copyright © 2009-2013 David Caldwell and Jim Radford.
2             #
3             # This library is free software; you can redistribute it and/or modify
4             # it under the same terms as Perl itself, either Perl version 5.12.4 or,
5             # at your option, any later version of Perl 5 you may have available.
6              
7             package File::HashCache::JavaScript;
8 2     2   25407 use JavaScript::Minifier::XS;
  2         2141  
  2         118  
9 2     2   545 use File::HashCache;
  2         18  
  2         273  
10              
11             our $VERSION = '1.0.2'; # Sadly, needs to stay here as long as File-HashCache-Javascript-0.10.0 is on CPAN.
12              
13             sub new {
14 3     3 0 2006503 my $class = shift;
15 3         32 my %options = (minify => 1, @_);
16 3 50       72 return File::HashCache->new(cache_dir => 'js',
17             process_js => [ \&File::HashCache::pound_include,
18             $options{minify} ? \&JavaScript::Minifier::XS::minify : (), ],
19             %options);
20             }
21              
22             1;
23              
24             __END__