Just another Perl shrine | |
PerlMonks |
Re: Adding a class to a module - Can Module::Starter or Dist::Zilla help?by kcott (Archbishop) |
on Aug 12, 2012 at 08:43 UTC ( [id://986943]=note: print w/replies, xml ) | Need Help?? |
"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 ..." Please show your .module-starter/config file and the full command you used. Without this, we can't tell if the setup is correct or if you used it correctly. For instance, modules have colons (e.g. --module=Some::Class) whereas distros have a hyphen (e.g. --distro=Some-Class) - perhaps those got mixed up on your commandline. While I appreciate that your question specifically asks about "adding to an existing module", I'll just point out that you can create multiple modules in a single distribution without using any plugins, e.g.
Using the plugin Module::Starter::Smart, I can run
My::Example has boilerplate with author and email (from config). I added a little POD text (to later check this wasn't being overwritten) and ran
My::Example was not overwritten and My::Example::Class has boilerplate with author and email (from config). This appears to cover your "... have all folders and files created, as well as the boilerplates adapted." requirement. For your specific customisations (e.g. logger code), perhaps consider writing your own plugin. You may find Module::Starter::Plugin and Module::Starter::Plugin::Template to be useful if you choose to do this. Taking a look at the source of existing plugins (e.g. Module::Starter::Smart and Module::Starter::PBP) may also be helpful. I noticed that Module::Starter::Smart has: UPDATE: This plugin only covers the simplest use cases. For advanced usage, check out Module::Starter::AddModule. I'm not familiar with that module - it may be of use to you. -- Ken
In Section
Seekers of Perl Wisdom
|
|