use List::MoreUtils qw/ uniq /;
use namespace::autoclean;
+has finder_class => (
+ isa => LoadableClass,
+ coerce => 1,
+ default => 'CatalystX::HelpText::Finder::TemplateToolkit',
+ handles => {
+ find_helptext_keys_in_fn => 'find_helptext_keys_in_fn',
+ }
+);
+
has help_files_path => (
is => 'ro',
isa => Dir,
sub _find_helptext_keys_in_fn {
my ($self, $fn) = @_;
- my $dir = $self->template_search_dir;
- my @keys = ();
- my $t = Template->new({
- INCLUDE_PATH => [ $self->template_search_dir ],
- ABSOLUTE => 1,
- });
- my $out;
- $t->process($fn, { help_text => sub { push @keys, shift } }, \$out);
- return [ uniq @keys ];
+ return $self->find_helptext_keys_in_fn($fn, $self);
}
sub _helptext_file_for_key_exists {