rename variable $buildpath -> $build_path
[scpubgit/App-SCS.git] / lib / App / SCS / PageSet.pm
index ce4c507..f5b9e5e 100644 (file)
@@ -67,16 +67,15 @@ sub _config_files_for {
   my @files = ();
   my @dirs = io->dir($path)->splitdir;
 
-
   shift @dirs;
   pop @dirs;
-  my $buildpath = io('');
+  my $build_path = io('');
 
   foreach my $dir (@dirs) {
-    $buildpath = $buildpath->catdir("/$dir");
+    $build_path = $build_path->catdir("/$dir");
     #/home/.../share/pages/blog.conf etc
 
-    my $file = $self->_top_dir->catfile("$buildpath.conf");
+    my $file = $self->_top_dir->catfile("$build_path.conf");
 
     if (!$file->exists || !$file->file || $file->empty) {
         next;
@@ -93,15 +92,10 @@ sub _inflate {
   (my $cache_name = $io->name) =~ s/\/([^\/]+)$/\/.htcache.$1.json/;
   my $cache = io($cache_name);
   my $config_files = $self->_config_files_for($path);
-  my $maxstat = 0;
-
-  if (scalar @$config_files) {
-    my $maxfile = reduce { $a->mtime > $b->mtime ? $a : $b } @$config_files;
-    $maxstat = $maxfile->mtime;
-  }
+  my $max_stat = max map $_->mtime, $io, @$config_files;
 
   if (-f $cache_name) {
-    if ($cache->mtime >= max($io->mtime, $maxstat)) {
+    if ($cache->mtime >= $max_stat) {
       return try {
         $self->_new_page($path, $self->_json->decode($cache->all));
       } catch {