NAME
Acme::CPANAuthors::Utils::Packages
SYNOPSIS
# you can't pass the raw content of 02packages.details.txt(.gz)
my
$packages
= Acme::CPANAuthors::Utils::Packages->new(
'cpan/modules/02packages.details.txt.gz'
);
my
$package
=
$packages
->
package
(
'Acme::CPANAuthors'
);
my
$dist
=
$packages
->distribution(
'I/IS/ISHIGAKI/Acme-CPANAuthors-0.12.tar.gz'
);
my
$latest
=
$packages
->latest_distribution(
'Acme-CPANAuthors'
);
DESCRIPTION
This is a subset of Parse::CPAN::Packages. The reading methods are similar in general (accessors are marked as read-only, though). Internals and data-parsing methods may be different, but you usually don't need to care.
METHODS
new
always takes a file name (both raw .txt
file and .txt.gz
file name are acceptable). Raw content of the file is not acceptable.
package
takes a name of a package, and returns an object that represents it.
distribution
takes a file name of a distribution, and returns an object that represents it.
latest_distribution
takes a name of a distribution, and returns an object that represents the latest version of it.
packages, distributions, latest_distributions
returns a list of stored packages or (latest) distribution objects.
package_count, distribution_count, latest_distribution_count
returns the number of stored packages or (latest) distributions.
PREAMBLE ACCESSORS
file, url, description, columns, intended_for, written_by, line_count, last_updated
These are accessors to the preamble information of 02packages.details.txt
.
PACKAGE ACCESSORS
package (name), version
my
$package
=
$packages
->
package
(
'Acme::CPANAuthors'
);
$package
->
package
,
"\n"
;
# Acme::CPANAuthors
$package
->version,
"\n"
;
# 0.12
distribution
returns an object that represents the distribution that the package belongs to.
DISTRIBUTION ACCESSORS
prefix (path), dist (name), version, maturity, filename, cpanid (pauseid), distvname
my
$dist
=
$packages
->distribution(
'I/IS/ISHIGAKI/Acme-CPANAuthors-0.12.tar.gz'
);
$dist
->prefix,
"\n"
;
# I/IS/ISHIGAKI/Acme-CPANAuthors-0.12.tar.gz
$dist
->dist,
"\n"
;
# Acme-CPANAuthors
$dist
->version,
"\n"
;
# 0.12
$dist
->maturity,
"\n"
;
# released
$dist
->filename,
"\n"
;
# Acme-CPANAuthors-0.12.tar.gz
$dist
->cpanid,
"\n"
;
# ISHIGAKI
$dist
->distvname,
"\n"
;
# Acme-CPANAuthors-0.12
packages (contains)
returns a list of objects that represent the packages the distribution contains. packages
method returns it as an array reference, contains
returns it as an array.
SEE ALSO
AUTHOR
Kenichi Ishigaki, <ishigaki@cpan.org>
COPYRIGHT AND LICENSE
Copyright (C) 2010 by Kenichi Ishigaki.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.