Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
In a recent discussion in the CB, castaway mentioned that she missed a list of required modules in the documentation of one of my modules. This initially resulted in the code snippet Auto-document prerequisites in README.

Not being happy with the result, I decided to put this into a module which is on CPAN now: Devel::Required.

From the pod:

NAME
Devel::Required - Automatic update of required modules documentation

SYNOPSIS
 use ExtUtils::MakeMaker;
 eval "use Devel::Required"; # auto-update documentation if needed
 WriteMakefile (
  NAME         => "Your::Module",
  VERSION_FROM => "lib/Your/Module.pm",
  PREREQ_PM    => { 'Foo' => '1.0', 'Bar::Baz' => '0.05' }
 );

DESCRIPTION
The Devel::Required module only serves a purpose in the development environment of an author of a CPAN module (or more precisely: a user of the ExtUtils::MakeMaker module. It makes sure that any changes to the required modules specified in the Makefile.PL are automatically reflected in the README file and in the main source file (if implicitely specified).

It takes the information given with the PREREQ_PM parameter and writes this to the README file, as well as to the POD of the file specified with the VERSION_FROM parameter.

This module should only be installed on the system of the developer.

The following files will be changed:

README
The README file should exists in the current directory. It should at least have this marker text:
 Required Modules:            <- must start at beginning of line
                              <- empty line
                              <- another empty line
After Makefile.PL is executed (using the example of the SYNOPSIS, the above will be changed to:
 Required Modules:            <- must start at beginning of line
  Foo (1.0)                   <- added
  Bar::Baz (0.05)             <- added
                              <- empty line
                              <- another empty line

No changes will be made if the marker text is not found.

Module file
The file indicated with the "VERSION_FROM" parameter, will be searched for a marker text that consists of the lines:
 =head1 REQUIRED MODULES      <- must start at beginning of line
                              <- empty line
 =(anything)                  <- any other pod directive

After Makefile.PL is executed (using the example of the SYNOPSIS, the above will be changed to:

 =head1 REQUIRED MODULES      <- must start at beginning of line
                              <- empty line
 Foo (1.0)                    <- added
 Bar::Baz (0.05)              <- added
                              <- empty line
 =(anything)                  <- any other pod directive
No changes will be made if the marker text is not found.

Now only to change of all my modules to use this new feature... ;-)

Liz


In reply to How the CB created another CPAN module: Devel::Required by liz

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others making s'mores by the fire in the courtyard of the Monastery: (12)
    As of 2014-07-28 14:42 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite superfluous repetitious redundant duplicative phrase is:









      Results (200 votes), past polls