sub _config_files_for {
my ($self, $path) = @_;
- my @files = ();
my @dir_parts = io->dir($path)->splitdir;
-
my @dirs = map io->dir('')->catdir(@dir_parts[1..$_]), 1..($#dir_parts - 1);
- return grep +($_->file and not $_->empty),
+ return grep +($_->is_file and $_->exists and not $_->empty),
map $self->_top_dir->catfile("${_}.conf"), @dirs;
}
my ($self, $type, $path, $io) = @_;
(my $cache_name = $io->name) =~ s/\/([^\/]+)$/\/.htcache.$1.json/;
my $cache = io($cache_name);
- my $config_files = $self->_config_files_for($path);
- my $max_stat = max map $_->mtime, $io, @$config_files;
+ my @config_files = $self->_config_files_for($path);
+ my $max_stat = max map $_->mtime, $io, @config_files;
if (-f $cache_name) {
if ($cache->mtime >= $max_stat) {
my $extracted = $self->${\"_extract_from_${type}"}($raw);
my $jsony = JSONY->new;
- my $config = reduce { merge($a, $jsony->load($b->all)) } [], @$config_files;
+ my $config = reduce { merge($a, $jsony->load($b->all)) } [], @config_files;
$extracted->{plugins} = pond_read_datum('[' . $extracted->{plugins} . ']');