From c259ad15c1e3ed8f643fda85c5c4f432aac2d6ef Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Sun, 1 Dec 2013 21:42:00 +0200 Subject: [PATCH] Fix compile error in ::Log::Entry and warning in ::Log --- lib/Gruntmaster/Page/Log.pm | 2 +- lib/Gruntmaster/Page/Log/Entry.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Gruntmaster/Page/Log.pm b/lib/Gruntmaster/Page/Log.pm index d276f55..957b510 100644 --- a/lib/Gruntmaster/Page/Log.pm +++ b/lib/Gruntmaster/Page/Log.pm @@ -46,7 +46,7 @@ sub generate{ my @log = sort { $b->{id} <=> $a->{id} } map { my $meta = LoadFile "$path/$_/meta.yml"; +{ id => $_, - date => strftime ('%c' => localtime $meta->{date}), + date => (exists $meta->{date} ? strftime ('%c' => localtime $meta->{date}) : '?'), user => $meta->{user}, result => $meta->{result}, name => $meta->{name}, diff --git a/lib/Gruntmaster/Page/Log/Entry.pm b/lib/Gruntmaster/Page/Log/Entry.pm index 4b7a70d..4dd13ba 100644 --- a/lib/Gruntmaster/Page/Log/Entry.pm +++ b/lib/Gruntmaster/Page/Log/Entry.pm @@ -33,7 +33,7 @@ $templates{$_} .= footer $_ for keys %templates; sub generate{ my ($path, $lang) = @_; - $id = ($path =~ m,log/(.*)/index,)[0]; + my $id = ($path =~ m,log/(.*)/index,)[0]; $path =~ s,/index\.html,,; my $template = $templates{$lang}; -- 2.39.2