Catalyst-View-CSS-Minifier-XS

 view release on metacpan or  search on metacpan

lib/Catalyst/View/CSS/Minifier/XS.pm  view on Meta::CPAN

67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
   # backcompat only
   $dir = $self->INCLUDE_PATH->subdir($dir) if $self->INCLUDE_PATH;
 
   @files = map {
      $_ =~ s/\.css$//;  $dir->file( "$_.css" )
   } grep { defined $_ && $_ ne '' } @files;
 
   my $output = $self->_combine_files($c, \@files);
 
   $c->res->headers->last_modified( max map stat($_)->mtime, @files );
   $c->res->body( $self->_minify($c, $output) );
}
 
sub _subinclude {
   my ( $self, $c, $original_stash, @files ) = @_;
 
   return unless $self->subinclude && $c->request->headers->referer;
 
   unless ( $c->request->headers->referer ) {
      $c->log->debug('javascripts called from no referer sending blank') if $c->debug;

t/01-basic.t  view on Meta::CPAN

18
19
20
21
22
23
24
25
26
27
28
29
30
ok $served, q{served data isn't blank};
my $path = File::Spec->catfile($FindBin::Bin, qw{lib TestApp root css foo.css});
open my $file, '<', $path;
 
my $str = q{};
while (<$file>) {
   $str .= $_;
}
 
is minify($str), $served, 'server actually minifed the css';
is $res->headers->last_modified, stat($path)->mtime, 'right modtime header';
 
done_testing;



( run in 0.471 second using v1.01-cache-2.11-cpan-00829025b61 )