reducing size of the Devel::Cover html report
The HTML files generated by Devel::Cover are huge.
I ran coverage on HTML::Template and while the source code
is ~100K the HTML report is 2.5Mb
So I think some work should be done to reduce this size.
I made a simple change - removing leading spaces from the
templates - this reduced the file size by about 60% for HTML::Template.
The resulting file looks the same in Mozilla, please check it with other
browsers, eg. IE.
It is still huge ~870K but I could not find any easy way to remove
further large chunks without changing the resulting page.
What do you think about removing
1) the lines from the source code which are empty
2) removing the lines that display parts of the documentation ?
Gabor
--- Html_subtle.pm.original Fri Oct 24 21:23:58 2003
+++ Html_subtle.pm Fri Oct 24 21:43:50 2003
@@ -700,6 +700,10 @@
[% END %]
EOT
+foreach my $template (keys %Templates) {
+ $Templates{$template} =~ s/^\s+//gm;
+}
+
1;
=pod
Re: Trying to spear a phalanx shield for pod
Michael G Schwern wrote:
> Since skip_all will exit immediately you can fold that big "everything
> inside the else block" away.
>
> eval 'use Test::Pod';
> my $have_testpod = !$@ and $Test::Pod::VERSION >= 0.95;
> plan skip_all => "Test::Pod v0.95 required for testing POD"
> unless $have_testpod;
>
> my @files;
> my $blib = File::Spec->catfile(qw(blib lib));
> ...
There is a misprint in this line:
my $have_testpod = !$@ and $Test::Pod::VERSION >= 0.95;
It should read:
my $have_testpod = !$@ && $Test::Pod::VERSION >= 0.95;
Based on the excellent work from Lester & Schwern, I could not restrain
myself from shortening this a little more (since it will be included
in many distributions). My current short version is:
use Test::More;
use File::Spec;
use File::Find;
use strict;
eval 'use Test::Pod';
plan skip_all => "Test::Pod v0.95 required for testing POD"
if $@ || $Test::Pod::VERSION < 0.95;
my @files;
find( sub {push @files, $File::Find::name if /\.p(?:l|m|od)$/},
File::Spec->catfile( qw(blib lib) ) );
plan tests => scalar @files;
foreach my $file (@files) { pod_file_ok($file) }
Two questions:
1) Is using $File::Find::name portable on VMS and Mac OS?
(I'm confused about File::Find's use of 'Unix' names).
2) Which is preferred:
eval 'use Test::Pod';
or:
eval { require Test::Pod };
...
Test::Pod->import;
or does it not matter?
/-\
http://personals.yahoo.com.au - Yahoo! Personals
New people, new possibilities. FREE for a limited time.
