[Templates] RFC: Template::Provider::PAR - allows PAR directories in the INCLUDE path

Nick Woolley nickwoolley@yahoo.co.uk
Sat, 01 Sep 2007 12:15:42 +0100


Hello - new subscriber here,

I have a script which uses TT, but I've been contemplating embedding it
in a PAR archive with a server based on HTTP::Server::Simple.   I'd like
to embed the templates too, so it's all nicely self-contained.

There didn't seem to be any prior art on CPAN, and I didn't find any 
mention of the idea of INCLUDE'ing templates from within a PAR on this 
mailing list.

I did however find out it would seem to be possible using the 
LOAD_TEMPLATE config option and a custom Template::Provider implementation.

Originally I was going to ask here if it had been done already, and if 
there were any pointers or advice people could offer - in fact, I did, 
but I didn't use the right channel and eventually realised the message 
didn't get through.

In the intervening time, I had a look at the base Template::Provider 
module and at Template::Provider::DBIC from CPAN, and managed to write 
Template::Provider::PAR, which seems to work.  (It was much simpler than 
I expected, once I'd unpicked the base class, although there are one or 
two trivial things about T::P I would have liked to change.)

So, as this seems like something other people would find useful, the 
next step would seem to be to try and get it on CPAN.  I have a PAUSE ID 
already (NPW, this will be my first upload), but first I wanted to ask:

  - is Template::Provider::PAR a vacant and sensible name?
  - are there any other, possibly more mature implementations?
  - are there any TT-specific guidelines I should follow when I upload
    it? (i.e. besides [1])

After I've uploaded it, would also be interested in any feedback in the 
implementation, since this is also my first venture into the TT internals.

Thanks,

Nick



1.
- Add POD
- Add tests
- read:
    perlmodstyle
    http://newfoundation.socialtext.net/perl5/index.cgi?cpan_packaging
    http://www.perlmonks.org/?node_id=431702