On 05/06/2014 03:22 PM, Cymon wrote:
In my opinion, releasing your app the way you want it's... well, not releasing it. I think that if your only need is to make users download your app and using it you should just make a tarball out of it and find a smart way to manage dependencies.
Considering your answer to my second question, this is the route I'll go for now. `make tardist` and tell my users (read, co-workers) what dependencies to install.
Releasing your app (that is still releasing a perl module, at last) must involve your local repository and its paths because that's the essence of a release. Actualy there's no problem placing your app in a common @INC path and using it in a Dancer2 project. Your app is a perl module so, in your bin/app.pl, you can just import it with a use directive:
#!/usr/bin/env perl
use FindBin; use lib "$FindBin::Bin/../lib";
use Your::Released::App;
Your::Released::App->dance;
It's what I do here: https://github.com/cym0n/strehler/blob/master/src/lib/Strehler/Installation....
Ok, you'll need a bit of fine tuning about relative paths, but nothing impossibile to do.
This is good to know. I guess it makes sense that as long as the module is in @INC you can use it, no matter where app.pl is.
2.
Well, why hardcoding the server? Very few HTML magic is needed:
<a href="/foo">foo</a>
*facepalm* I knew that... Thank you, you've saved me from some horrific over-engineering.
A brutal find and replace in your code putting the server name is, in my opinion, a very bad idea. If you need the explicit name in the pages just make it an entry in the config.yml and then write a little piece of code adding this entry in every template parameters hash.
Talking about static elements and release question (as at 1.). If you realese "the real way" your app probably you statics elements (your public directory) will go in a very dark and gloomy place, difficult to be served by a webserver. For this, I suggest you to create a script that "sync" the public directory of the deployed app with the contents in your package.
Also helpful advice. Thank you very much.