Baseline - Launch of backpan.org
[catagits/BackPAN-Web.git] / lib / BackPAN / Index / Release.pm
CommitLineData
b67ffc2e 1package BackPAN::Index::Release;
2
3use strict;
4use warnings;
5
6use overload
7 q[""] => sub { $_[0]->distvname },
8 fallback => 1;
9
10use BackPAN::Index::Role::AsHash;
11
12sub data_methods {
13 return qw(dist version cpanid date path maturity);
14}
15
16sub filename {
17 my $self = shift;
18 return $self->path->filename;
19}
20
21# Compatibility with PBP
22sub prefix {
23 my $self = shift;
24 return $self->path;
25}
26
271;
28
29__END__
30
31=head1 NAME
32
33BackPAN::Index::Release - A single release of a distribution
34
35=head1 SYNOPSIS
36
37 my $b = BackPAN::Index->new();
38
39 # Find version 1.2.3 of Acme-Colour
40 my $release = $b->release("Acme-Colour", '1.2.3');
41
42 print " CPANID: " . $release->cpanid . "\n";
43 print " Date: " . $release->date . "\n";
44 print " Dist: " . $release->dist . "\n";
45 print "Distvname: " . $release->distvname . "\n";
46 print " Filename: " . $release->filename . "\n";
47 print " Maturity: " . $release->maturity . "\n";
48 print " Path: " . $release->path . "\n";
49 print " Version: " . $release->version . "\n";
50
51=head1 DESCRIPTION
52
53BackPAN::Index::Release objects represent releases,
54individual tarballs/zip files, of a distribution on BackPAN.
55
56For example, Acme-Pony-1.2.3.tar.gz is a release of the Acme-Pony
57distribution.
58
59=head1 METHODS
60
61=head2 cpanid
62
63 my $cpanid = $release->cpanid;
64
65Returns the PAUSE ID of the author of the release.
66
67=head2 date
68
69 my $date = $release->date;
70
71Returns the date of the release, in UNIX epoch seconds.
72
73=head2 dist
74
75 my $dist_name = $release->dist;
76
77Returns the name of the distribution this release belongs to.
78
79=head2 distvname
80
81 my $distvname = $release->distvname;
82
83Returns the name of the distribution, hyphen, and version.
84
85=head2 filename
86
87 my $filename = $release->filename;
88
89Returns the filename of the release, just the file part.
90
91=head2 maturity
92
93 my $maturity = $release->maturity;
94
95Returns the maturity of the release.
96
97=head2 path
98
99 my $path = $release->path;
100
101Returns the full path on CPAN to the release. This is a
102L<BackPAN::File> object.
103
104=head2 version
105
106 my $version = $release->version;
107
108Returns the version of the release:
109
110=head2 as_hash
111
112 my $data = $release->as_hash;
113
114Returns a hash ref containing the data inside C<$release>.
115
116
117=head1 AUTHOR
118
119Leon Brocard <acme@astray.com> and Michael G Schwern <schwern@pobox.com>
120
121=head1 COPYRIGHT
122
123Copyright (C) 2005-2009, Leon Brocard
124
125This module is free software; you can redistribute it or modify it under
126the same terms as Perl itself.
127
128=head1 SEE ALSO
129
130L<BackPAN::Index>, L<BackPAN::Index::Dist>, L<BackPAN::Index::File>
131