Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Module::Starter (or ::PBP) and Module::Build -- how do I configure the License and Copyright?

by Cuhulain (Sexton)
on Feb 07, 2010 at 16:56 UTC ( #821851=perlquestion: print w/ replies, xml ) Need Help??
Cuhulain has asked for the wisdom of the Perl Monks concerning the following question:

Venerable Monks,

Module::Starter::Simple.pm has a subroutine _get_licenses_mapping that lets the module developer select from perl, mit, bsd, add other license text.

How can I plugin my own license and copyright text (tailored to my employers standard commercial wording)? I don't want to edit Module::Starter::Simple.pm directly. (That way would be easy, but surely is heretical.)

I've struggled thru some postings here on plugins and (brian d foy's posting on) the template toolkit. brian's discussion seemed to use Make, and I cannot see if it will work with Build, which I prefer. Much of this material is very new and I do not understand the true path to enlightment.

I am a recent convert to module-starter and Module::Build, and (very recently) to OO Perl. So, if Monks recommend I try sub-classing methods like _get_licenses_mapping, I'd barely know where to start. I have just successfully applied Test::Perl::Critic (to brutal severity), Test::Kwalitee, and Test::MockObject. These are elements of a very impressive toolkit.

But I need to find a way to tailor the module framework to suit my company and project before trying to persuade my colleagues to adopt these brilliant development tools.

The default POD from Module::Starter is not compliant with default perlcritic policies. I've had to manually create the missing POD sections in my module. To fix this, should I switch to Module::Starter::PBP for future module creation in gvim? I appreciate that it is new so may have bugs -- one posting discussed a possible bug in handling spaces in pathnames.

Comment on Module::Starter (or ::PBP) and Module::Build -- how do I configure the License and Copyright?
Re: Module::Starter (or ::PBP) and Module::Build -- how do I configure the License and Copyright?
by Cuhulain (Sexton) on Feb 07, 2010 at 23:17 UTC
    Ahh - I may have found part of my own enlightenment.

    If I had read http://search.cpan.org/~dconway/Module-Starter-PBP-v0.0.3/lib/Module/Starter/PBP.pm, I'd have seen the advice to type

    perl -MModule::Starter::PBP=setup

    With the result that a directory of templates is created. I am free to tailor the templates, including setting up exactly the Licence and Copyright that I want.

    When I configure t/perlcritic.t to enforce brutal severity, and run build test, I am told that 2 POD sections (SUBROUTINES/METHODS, and LICENSE AND COPYRIGHT) are still missing. So, almost but not quite perlcritic safe.

    The former section may now be INTERFACE, and the latter is (Aussie/British-English spelling) LICENCE AND COPYRIGHT. Good -- but now I have to dig just a little deeper to discover how to tailor Test::Perl::Critic to permit these alternative section names.

    I'd welcome guidance on the right path.

Re: Module::Starter (or ::PBP) and Module::Build -- how do I configure the License and Copyright?
by Burak (Chaplain) on Feb 09, 2010 at 04:06 UTC
    Hmmm... Are you talking about adding a custom license template or using the "pre-defined" ones? If it's the latter, no extra work is needed with M::B. Just install Software::License and (for example) pass these to the constructor:
    license => 'perl', create_license => 1,
      From my original post:

      Module::Starter::Simple.pm has a subroutine _get_licenses_mapping that lets the module developer select from perl, mit, bsd, add other license text. How can I plugin my own license and copyright text (tailored to my employers standard commercial wording)? /

      From that, I think it's clear that I can already select "perl", for example, and standard text is plugged in. But that standard text is not tailored to my employers standard commercial wording.

      It looks like Module::Starter produces a template that falls far short of perlcritic standards, but a Build program that works despite pathnames embedding spaces. In contrast, Module::Starter::PBP produces a template that almost meets perlcritic standards, but a Build program that fails if pathnames embed spaces.

      The clumsy compromise seems to be to use Module::Starter::PBP once only to generate a template, then fix that template's few bugs and keep it, then always use Module::Starter to generate new frameworks and Build programs, but overwrite its template with the saved perlcritic compliant one (as a Vim plugin, say).

      Wouldn't it be nice if the few critical rough corners on Module::Starter::PBP were smoothed off . . .

      Or can any Monk recommend a better way towards a really classy, standardised, consistently-tailored module-production mechanism?

        1) create your own subclass to your standards 2) try Module::New
        falls far short of perlcritic standards

        Are you listening to yourself? I mean, really listening to yourself!

        Perl::Critic is the embodiment of: the Perl-shy in a Perl world; the belt-&-braces man in a just-what's-needed-world; a functional-zealot in a side-effects-are-inevitable world; an OO-zealot in a procedural-can-be-efficient-and-correct world.

        Perl::Critic is: Caution in Extremis, to point of paralysis; Careful to the point of paranoia; Deferential to the point of Indecisive; Follow my leader (even over the cliff).

        Perl::Critic is the Sum of all Fears!

        Imagine trying to live your life avoiding all the 51 million 200 thousand things that someone, somewhere believes are bad for you. Well that's what trying to follow Perl::Critic (with it's default settings) gives you.

        Every single prejudice, dogma, and misunderstanding that any ex-COBOL, C++, VBasic or Haskell programmer ever had on their first excursion in Perl; applied rote--like a 5 year old reciting their times tables--without any application of knowledge, understanding or judgement.

        Man up! Learn enough about the language you are programming in to make your own decisions. Make your own decisions and live with their consequences and learn from them; Don't let the machine tell you what to do!


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://821851]
Approved by davies
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2014-08-22 23:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (168 votes), past polls