From: Marius Gavrilescu Date: Sun, 1 Dec 2013 19:42:00 +0000 (+0200) Subject: Fix compile error in ::Log::Entry and warning in ::Log X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=c259ad15c1e3ed8f643fda85c5c4f432aac2d6ef;p=gruntmaster-page.git Fix compile error in ::Log::Entry and warning in ::Log --- 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};