Skip to content

Commit

Permalink
Fix get_namespaces when File root dir doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
jonswar committed Oct 14, 2009
1 parent aa1665e commit 2b1a9c2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ Revision history for CHI

0.29 Aug 31, 2009

* Fixes
- Fix synopsis of Memory cache in main docs - RT #50360 - reported by zloyrusskiy
- Fix get_namespaces when File root dir doesn't exist
- Fix tests to use label for log matching

0.28 Aug 31, 2009

* Fixes
Expand Down
6 changes: 4 additions & 2 deletions lib/CHI/Driver/File.pm
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,13 @@ sub generate_temporary_filename {
sub get_namespaces {
my ($self) = @_;

my @contents = read_dir( $self->root_dir() );
my $root_dir = $self->root_dir();
return () if !-d $root_dir;
my @contents = read_dir($root_dir);
my @namespaces =
map { $self->unescape_for_filename($_) }
grep { $self->is_escaped_for_filename($_) }
grep { -d fast_catdir( $self->root_dir(), $_ ) } @contents;
grep { -d fast_catdir( $root_dir, $_ ) } @contents;
return @namespaces;
}

Expand Down

0 comments on commit 2b1a9c2

Please sign in to comment.