Now that more than half of the program of GSoC has passed, Franck asked for me to do a write-up of my work, so everybody can check it and evaluate to see if it can be merged with the current devel repo of Dancer.
You can check my whole work at my repo in github, and if you care to make changes, just PR at will :)
Dancer::Script module is a mash-up between the old script/dancer utility that we currently use to scaffold every new Dancer application and some other content that I added with management from Sawyer and Franck.
Dancer::Script makes use of Dancer::Object and Dancer::Logger, the last so we can get better log outputs from the whole scaffolding process
So what happened to
Well, it became a 8 lines executables that only calls
In the same matter, I modified
dispatch.fcgi so it will call
Dancer::Script::run_scaffold_fcgi runs the code for the deployment of
FastCGI. This way, every new change in Plack/PSGI that the team encounters and wish to add, can be directly added to
Dancer::Script without the need of scaffolding a new Dancer application in every update that is done to Dancer. Since there are common releases and quick-updates in between weeks, I believe that this is a justified method.
Dancer::Script makes use of
Dancer::Logger, the following methods replaced good ol’
So if we do
dancer -a Hello::World we get a pretty output like the following:
Carlos-Computer:test $ dancer -a Hello::World debug> Writing directory: Hello-World debug> Successfully wrote the directory: Hello-World debug> Writing directory: Hello-World/bin debug> Successfully wrote the directory: Hello-World/bin debug> Writing file: Hello-World/bin/app.pl debug> Successfully wrote: Hello-World/bin/app.pl .............
The same goes for
Is that all?
Well, feature-wise speaking it is. But the other good part is that
Dancer::Script is fully an object module that can be run without
script/dancer. For example:
So if you need to do something really specific with
Dancer::Script, you don’t need to call
script/dancer and run your automagically work.
But that’s not all!
Now that we have
Dancer::Script, it will allow for future subclassing for extra features that anybody could write themselves. We’ll also be able to easily add plugins so we could have flavors of
Dancer::Script. Just like the ones that create a
Dist::Zilla based dist or a Dancer plugin dist, etc… A lot of possibilities. :)
This is the current state of my work, I hope you like it, and expect feedback of all kind. Thanks for your time.