Skip to content

Commit

Permalink
improved Morbo to ignore dotfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Aug 27, 2011
1 parent b3b8f75 commit 43d95c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changes
Expand Up @@ -2,6 +2,7 @@ This file documents the revision history for Perl extension Mojolicious.

1.93 2011-08-27 00:00:00
- Added EXPERIMENTAL support for escaped tags to Mojo::Template.
- Improved Morbo to ignore dotfiles.
- Improved documentation.
- Fixed trimming bug in Mojo::Template.
- Fixed a few small bugs in Mojo::Template.
Expand Down
3 changes: 2 additions & 1 deletion lib/Mojo/Home.pm
Expand Up @@ -87,8 +87,9 @@ sub list_files {
my @files;
find {
wanted => sub {
push @files, join '/',
my @parts =
File::Spec->splitdir(File::Spec->abs2rel($File::Find::name, $dir));
push @files, join '/', @parts unless $parts[-1] =~ /^\./;
},
no_chdir => 1
}, $dir;
Expand Down

1 comment on commit 43d95c3

@kberov
Copy link
Contributor

@kberov kberov commented on 43d95c3 Sep 2, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be convenient IMHO to have an optional parameter $ignore_files_pattern = [qr/.conf$/,qr/^README/, qr/^somespecificfiletxt$/];
So one can push to the list of files only "safe" files.
sub list_files {
my ($self, $dir, $ignore_files_pattern) = @_;
....

Please sign in to comment.