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

perl add_a_new_class_to_current_module.pl My::Example::Class
and have all folders and files created, as well as the boilerplates adapted.

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) :

./lib/My/Example/Class.pm ./t/My/Example/Class/01_unit_test.t
and then modify the boilerplate code.
~ Edit : i just realized that Module::Starter::Smart can help with this. But when i try to use it in Windows XP, it seems to not understand that it should just add a module to the distro. It creates a new distro instead. I might not have set it up correctly - i added this line the the module-starter config file: plugin: Module::Starter::Smart . But anyway, i want to automatize more than just this :

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

./t/lib/My/Example/Class/Builder.pm
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.

~ ~ ~
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 =)


In reply to Adding a class to a module - Can Module::Starter or Dist::Zilla help? by mascip

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.