use IO::File;
use POSIX qw/strftime/;
use YAML::Any qw/LoadFile/;
-use Gruntmaster::Page qw/header footer/;
+use Gruntmaster::Page::Common qw/header footer/;
my %templates = (
en => <<'HTML',
sub generate{
my ($path, $lang) = @_;
- $path = ($path =~ m,log/(.*)/index,)[0];
+ my $id = ($path =~ m,log/(.*)/index,)[0];
+ $path =~ s,/index\.html,,;
my $template = $templates{$lang};
my $htc = HTML::Template::Compiled->new(scalarref => \$template);
- flock my $metafh = IO::File->new("<log/$path/meta.yml"), LOCK_SH;
- my $meta = LoadFile "log/$path/meta.yml";
+ flock my $metafh = IO::File->new("<$path/meta.yml"), LOCK_SH;
+ my $meta = LoadFile "$path/meta.yml";
my @tests = map {
$_->{time} = sprintf "%.4fs", $_->{time};
$_
} @{$meta->{results}};
- $htc->param(id => $path);
+ $htc->param(id => $id);
$htc->param(tests => \@tests);
$htc->output
}