You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by Justin Mason <jm...@jmason.org> on 2004/01/30 23:02:58 UTC

Re: plugin design Q: reading rules code from plugin .pm's directly

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Theo Van Dinter writes:
> On Sat, Jan 24, 2004 at 08:36:49PM -0800, Justin Mason wrote:
> > This would avoid the need for 2 files for every plugin, one for the
> > perl code and one for the SpamAssassin rules code to load it.
> > 
> > The SpamAssassin rules-file parser would just have to know that
> > in a .pm, only the =head1 RULE CODE pod section is parsed.
> 
> hmmm.  how about letting the plugin inject the conf via an init_conf()
> call or something?  That way we don't have to read another file (and
> deal with the parsing), and you still get the benefit?

True.  yes, we could do that -- although I would prefer to avoid this:

  sub new {
    .....perl code...
  }
  sub othermethod1 {
    .....perl code...
  }
  sub othermethod2 {
    .....perl code...
  }
  sub init_conf {
    q{

	...wierd embedded SpamAssassin rules...

    };
  }

IMO, it's actually *more* confusing mixing the perl code and SpamAssassin
rules that directly, than the POD concept was.

- --j.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Exmh CVS

iD8DBQFAGtSSQTcbUG5Y7woRAr6tAKCC5LLdXkeUstDxYe1Gk9nnL7c4mACg3k09
9TC34oCAEbLpypEh+JbWcx8=
=1i6C
-----END PGP SIGNATURE-----