mascip has asked for the wisdom of the Perl Monks concerning the following question:
Hi all,
I create my modules with Module::Starter (for example My::Example).
My question is about how to automatize adding one class to an existing module. I would like to type
and have all folders and files created, as well as the boilerplates adapted.perl add_a_new_class_to_current_module.pl My::Example::Class
For example to add My::Example::Class in the My-Example module, here is what i do by hand; how can i automate it? Each time i want to do this, i create a few directories and files, all by hand (or copy-paste and rename them) :
and then modify the boilerplate code../lib/My/Example/Class.pm ./t/My/Example/Class/01_unit_test.t
After that, i add some custom Log::Log4perl logger code in a log/loggers.conf file, as well as in the two previous (.pm and .t) files.
I also often create a Test data builder class for new classes, in
It inherits from Example::Class, and just adds a few subroutines to make tests easier to write, without having to add these subroutines to the original class../t/lib/My/Example/Class/Builder.pm
~ ~ ~
It's all very little things, but they add up and i wonder whether i should make a script to do all of this from me.
But first, what are the existing tools that can help me make this process easier ? Can Module::Starter help me with this ? Or any other module ?
I'm considering starting to use Dist::Zilla. Could it help with this ? I guess, some boilerplate won't have to be written anymore, as plugins will add them to all of my classes. What about the folder and file creations?
I'm aware that for custom things like editing my log4perl configuration file, i will have to write my own scripts, but it's so smBut any help from existing modules would be welcome.
Cheers =)
|
|---|