|
Module::DevAid - tools to aid perl module developers |
Module::DevAid - tools to aid perl module developers
This describes version 0.2201 of Module::DevAid.
use Module::DevAid;
my $da = Module::DevAid->new(
dist_name => 'My::Module',
modules => qw(lib/My/Module.pm lib/My/Module/Other.pm),
scripts => qw(scripts/myscript),
gen_readme => 1,
gen_todo => 1,
);
$da->generate_readme_file();
Module (and script) to aid with development, by helping (and testing) auto-building of certain files, and with the steps needed in building and committing a release.
At this point this only uses the darcs revision system.
Takes a project description, either through the command line options, or via a project config file, which defaults to 'mod_devaid.conf' in the current directory.
Features:
my $da = new(%args)
Create a new object. This first reads from the default config file (see the config_read manpage) and the defaults from there can be overridden with the following arguments:
qw(lib/My/Module.pm)If gen_readme is true, the README file will be generated from select sections of the pod_file file. The important ones are NAME, DESCRIPTION, INSTALLATION, REQUIRES and AUTHOR.
my $vsub = sub {
my $version = shift;
# code to update files
...
};
version_bump_code => $vsub
Reference to a function which will perform custom actions to automatically change the version-id. The default actions go through the modules and scripts and update anything matching a standard VERSION-setting string, and which matches a 'This describes version' string. This subroutine is for doing anything additional or different.
This is given one argument, the version string.
qw(scripts/myscript)
Set the configuration from a config file. This is called for the default config when ``new'' is invoked, so there's no need to call this unless you want to use an additional config file.
The information about a project can be given in a config file, which defaults to 'mod_devaid.conf' in the current directory. If you want to use a different file, set the MOD_DEVAID_CONF environment variable, and the module will use that.
The options which can be set in the config file are exactly the same as those which can be set in new.
The options are set with a 'option = value' setup. Blank lines are ignored.
For example:
dist_name = My::Module
modules = lib/My/Module.pm lib/My/Module/Other.pm
gen_readme = 1
Use with CAUTION.
This defines additional code which can be used for the automatic update of version numbers in files. It has to be defined all on one line, and basically be a subroutine definition, like so:
version_bump_code = sub { my $version = shift; # code to update files ... };
The list of files altered by the version_bump_code, so that all the version changes can be committed at the same time. This is needed because some tests require the test files to have the version-id in them, and therefore all version commits should be done at the same time, otherwise the tests will fail, and the commits won't work.
Do a release, using darcs as the revision control system.
Automate the update of the version, taken from version_file and old_version_file
Get the content which would be put in a TODO file generated using devtodo .todo file in project directory.
Returns a string.
Generate TODO file using devtodo .todo file in project directory. Uses get_todo_content().
Generate README content from PoD in module. Only uses selected sections, rather than the whole thing. Returns a string.
Generate README file from PoD in module. (uses get_readme_content)
Get the changes committed to darcs since the last release. Generate a more compact format than the darcs changes default.
Get the contents of what the new changes file should be. Takes version and old_version id strings as arguments. (uses get_new_changes) Returns a string.
Get the version-id of the previous release from old_version_file
Get the version-id of the up-and-coming release from version_file
These are documented for the developer only, and are not meant to be used by the outside.
Called by darcs_release. Overwrites the changes file and commits the change. (uses get_changes_content)
Called by darcs_release. Tags the release in darcs.
Getopt::Long
Pod::Usage
Data::Dumper
Test::More
perl(1).
To install this module, run the following commands:
perl Build.PL
./Build
./Build test
./Build install
Please report any bugs or feature requests to the author.
Kathryn Andersen (RUBYKAT)
perlkat AT katspace dot com
http://www.katspace.com
Copyright (c) 2004-2007 by Kathryn Andersen
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|
Module::DevAid - tools to aid perl module developers |