[Catalyst-dev] [Catalyst] Major (for me) problem fixed!
Brian Cassidy
brian.cassidy at nald.ca
Mon Jul 31 20:24:35 CEST 2006
Jonathan Rockway wrote:
> qr{[\/:]\w+[.]pm$};
>
> Not quite as elegant (!), but it works. Halfway.
>
[*SNIP*]
> near line188 in Module::Pluggable::Object.pm, and replace the qr// part
> with that big regex above. All unit tests pass, and Catalyst works
> great. It loads valid modules, and ignores emacs' tempfiles. Exciting!
>
No, this doesn't really work. The file_regex option is used in many
spots, including the one you've specified. So, i tried it out as part of
my YAML config:
setup_components:
file_regex: !!perl/regexp:
REGEXP: '[/:]\w[.]pm$'
and debugged the output of $locator->plugins, which returns...
$VAR1 = [];
...sadly. To me, we should try to work /with/ MPO rather than try to
adjust it's core. So, we should set our own default options instead.
FYI, the "only" and "except" options don't really work against filenames...
i tried a test with an app of mine: NALD::FormMail. i copied my "Email"
controller as ".#Email.pm" in the same dir as the rest of them. On line
90 of Module::Pluggable::Object it loops through each plugin name.
Here's what i got:
NALD::FormMail::Controller::Email
NALD::FormMail::Controller::Authorization
NALD::FormMail::Controller::.#Email
NALD::FormMail::Model::FormMail
NALD::FormMail::View::TT
So, i added the following option to my YAML config (see my last cat list
posting for the same thing):
setup_components:
except: !!perl/regexp:
REGEXP: #
And the result from $locator->plugins:
$VAR1 = [
'NALD::FormMail::Controller::Email',
'NALD::FormMail::Model::FormMail',
'NALD::FormMail::View::TT',
'NALD::FormMail::Controller::Authorization'
];
All is well! So, perhaps more rules along that line should be added as
defaults?
-Brian
More information about the Catalyst-dev
mailing list