Guest User

Untitled

a guest
Apr 26th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. diff --git a/lib/Nim/Plugin/Entry/File.pm b/lib/Nim/Plugin/Entry/File.pm
  2. index 521d2a3..a8fb73f 100644
  3. --- a/lib/Nim/Plugin/Entry/File.pm
  4. +++ b/lib/Nim/Plugin/Entry/File.pm
  5. @@ -3,6 +3,8 @@ use Any::Moose;
  6.  
  7. with 'Nim::Plugin';
  8.  
  9. +has suffix => ( is => 'rw', isa => 'Str', default => 'txt' );
  10. +
  11. use Carp;
  12. use Nim::Entry;
  13.  
  14. @@ -25,10 +27,10 @@ sub find {
  15. $context->conf->data_dir->recurse( callback => sub {
  16. my $f = $_[0];
  17. return unless -f $f;
  18. - return unless $f->basename =~ /\.txt$/;
  19. + return unless $f->basename =~ /\.$self->{suffix}$/;
  20.  
  21. (my $path = $f->parent) =~ s/^$dir//;
  22. - (my $name = $f->basename) =~ s/\.txt$//;
  23. + (my $name = $f->basename) =~ s/\.$self->{suffix}$//;
  24.  
  25. $context->log->info('find: %s', $f);
Add Comment
Please, Sign In to add comment