Module::Release::Kwalitee - Play the CPANTS game


Module-Release documentation Contained in the Module-Release distribution.

Index


Code Index:

NAME

Top

Module::Release::Kwalitee - Play the CPANTS game

SYNOPSIS

Top

The release script automatically loads this module if it thinks that you want to check the kwalitee of your module.

DESCRIPTION

Top

check_kwalitee

Run `cpants_lints.pl distname.tgz`. If it doesn't see "a 'perfect' distribution" it dies.

It looks in local_name to get the name of the distribution file.

cpants_lint
cpants_pass_regex

The regex to use to evaluate the output of cpants_lint.pl to see if everything was okay.

SEE ALSO

Top

Module::Release

SOURCE AVAILABILITY

Top

This source is in Github:

	git://github.com/briandfoy/module-release.git

AUTHOR

Top

brian d foy, <bdfoy@cpan.org>

COPYRIGHT AND LICENSE

Top


Module-Release documentation Contained in the Module-Release distribution.
package Module::Release::Kwalitee;

use strict;
use warnings;
use base qw(Exporter);
use vars qw($VERSION);

our @EXPORT = qw(check_kwalitee cpants_lint cpants_pass_regex );

$VERSION = '2.05';

sub check_kwalitee
	{
	eval "require Module::CPANTS::Analyse; 1" or
		$_[0]->_die( "You need Module::CPANTS::Analyse to check kwalitee" );

	$_[0]->_print( "Checking kwalitee... " );

	my $name    = $_[0]->local_file;
	my $program = $_[0]->cpants_lint;
	
	{
	no warnings 'uninitialized';
	$_[0]->_die( " no $name---aborting release\n" ) unless -e $name;
	}
	
	# XXX: what if it's not .tar.gz?
	my $messages = $_[0]->run( "$program $name" );

	my $regex = $_[0]->cpants_pass_regex;
	
	$_[0]->_die( "Kwalitee is less than perfect:\n$messages\n" )
		unless $messages =~ m/$regex/;

	$_[0]->_print( "done\n" );
	}

sub cpants_lint { "cpants_lint.pl" }

sub cpants_pass_regex { qr/a 'perfect' distribution!/ }

1;