A class can be passwed to script
[catagits/CatalystX-HelpText.git] / lib / CatalystX / HelpText / Finder / TemplateToolkit / Regexp.pm
CommitLineData
54b1774e 1package CatalystX::HelpText::Finder::TemplateToolkit::Regexp;
2use Moose;
3use Moose::Autobox;
4use List::MoreUtils qw/ uniq /;
5
6sub find_helptext_keys_in_fn {
7 my ($self, $fn, $script) = @_;
8 open(FILE, $fn) or warn "Can't open $fn\n" && return;
9 my @keys = ();
10 while (<FILE>) {
11 if (my ($key) = m/help_text\(\s*['"](.*)['"]\s*\)/o) {
12 push @keys, $key;
13 }
14 }
15 close(FILE);
16 return [ uniq @keys ];
17}
18
191;