CPAN::Index::Package - An object representing a CPAN package


CPAN-Index documentation Contained in the CPAN-Index distribution.

Index


Code Index:

NAME

Top

CPAN::Index::Package - An object representing a CPAN package

DESCRIPTION

Top

CPAN::Index::Package object represent CPAN packages in the index.

METHODS

Top

name

The name accessor returns the package namespace.

This is a valid Perl package name, such as "Foo::Bar".

version

The version accessor returns the current version of the package.

Returns a version object, or undef if the package is unversioned.

path

The path accessor returns the package's location, as a path relative to the CPAN author root.

That is, a string in the form "L/LB/LBROCARD/Acme-Colour-1.00.tar.gz".

SUPPORT

Top

Bugs should be reported via the CPAN bug tracker

http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CPAN-Index

For other issues, contact the author.

AUTHOR

Top

Adam Kennedy <cpan@ali.as>

SEE ALSO

Top

CPAN::Index, Parse::CPAN::Authors, Parse::CPAN::Packages

COPYRIGHT

Top


CPAN-Index documentation Contained in the CPAN-Index distribution.

package CPAN::Index::Package;

use strict;
use base 'DBIx::Class';
use version ();

use vars qw{$VERSION};
BEGIN {
	$VERSION = '0.01';
}

__PACKAGE__->load_components('Core');

__PACKAGE__->table('package');

__PACKAGE__->add_columns(
	name => {
		data_type         => 'varchar',
		size              => 255,
		is_nullable       => 0,
		is_auto_increment => 0,
		default_value     => '',
		},
	version => {
		accessor          => 'version_string',
		data_type         => 'varchar',
		size              => 32,
		is_nullable       => 1,
		is_auto_increment => 0,
		default_value     => '',
		},
	path => {
		data_type         => 'varchar',
		size              => 255,
		is_nullable       => 0,
		is_auto_increment => 0,
		default_value     => '',
		},
	);

__PACKAGE__->set_primary_key('name');

sub version {
	my $self  = shift;
	my $value = $self->version_string(@_);
	defined($value) ? version->new($value) : undef;
}

1;

__END__