in reply to Re: Dirctory structure for TT2 templates (in test *and* production)
in thread Dirctory structure for TT2 templates (in test *and* production)

I like your "Things that are never supposed to be changed" phrase. That's exactly my problem with using it. I want it to be different in development and production. It doesn't seem to be able to support that.

Perhaps I miss something, because it seems that you change gears from ShareDir is not useful to "it is what you want".

I don't see a way to configure ShareDir to do what I want: let the development paths shadow the production paths in development but have only one set of paths for production.

On another note, I'm not conversant in Catalyst. How does its directory structure work in development, then in production? Are they kept separate until 'build install', but somehow accessible in both environments?

  • Comment on Re^2: Dirctory structure for TT2 templates (in test *and* production)

Replies are listed 'Best First'.
Re^3: Dirctory structure for TT2 templates (in test *and* production)
by Your Mother (Archbishop) on Dec 02, 2010 at 16:00 UTC

    I think ShareDir can work for you with care and blib (I haven't done this so, consider it salted/untested). You'll just need to run something like this before using the code in dev:

    perl Makefile.PL && make # then- use blib; # or perl -Mblib ...executable...

    The blib stuff should function as production code would; i.e., ShareDir will find the right things in a relative fashion under, I think, blib/**/auto/... The pain being that you might need to run make all the time to see code changes.

    For Catalyst, take a look at the source code for home() in Catalyst::Utils. It uses the presence of a Makefile.PL (or other dev env markers) to determine the root of the application (local/anywhere v formally installed) and where it can find its files relatively. This is a bit of a systems/deployment decision more than a code choice though so I'm not sure I'd recommend it.