NAME

JSAN::Index::Release - A JavaScript Archive Network (JSAN) Release

DESCRIPTION

This class provides objects for a single release of a distribution by an author

METHODS

In addition to the general methods provided by ORLite, it has the following methods

id

The id accessor returns the unique identifier for the release (an integer)

source

The source access returns the root-relative path within a JSAN mirror that the package can be found at.

distribution

The distribution method returns the JSAN::Index::Distribution for the distribution that this release is of.

author

The author method returns the JSAN::Index::Author for the JSAN author that uploaded the release.

version

The version accessor returns the version of the release.

created

The created accessor returns the time that the release was received and first indexed by the JSAN upload server.

Returns an integer in unix epoch time.

created_string

The created_string method returns the time that the release was recieved and first indexed by the JSAN upload server.

Is equivalent to scalar localtime $object->created.

Returns a time as a localtime string.

doc

The doc accessor returns the root-relative location of the documentation for this release on the http://openjsan.org/ website.

meta

The meta accessor returns the actual content of the META.yml file that came with the distribution.

meta_data

The meta_data method loads and deserialises the META.yml content contained in the index (and returned by the meta method above).

checksum

The checksum accessor returns the MD5 checksum for the release tarball.

latest

The latest accessor returns a boolean flag indicating if the release is the most recent release of the distribution.

requires

The requires method finds the set of run-time library dependencies for this release, as identified in the META.yml data contained in the index.

Returns a reference to a HASH where the key is the name of a library as a string, and the value is the version for the dependency (or zero if the dependency is not for a specific version).

requires_libraries

The requires_libraries method returns a list of the JSAN::Index::Library dependencies as identified by the META.yml file for the release.

requires_releases

The requires_releases method returns a list of the JSAN::Index::Release dependencies based on the dependencies specified in the META.yml file for the release.

build_requires

The build_requires method finds the set of build-time library dependencies for this release, as identified in the META.yml data contained in the index.

Returns a reference to a HASH where the key is the name of a library as a string, and the value is the version for the dependency (or zero if the dependency is not for a specific version).

build_requires_libraries

The build_requires_libraries method returns a list of the build-time JSAN::Index::Library dependencies as identified by the META.yml file for the release.

build_requires_releases

The requires_releases method returns a list of the JSAN::Index::Release build-time depedencies based on those specified in the META.yml file for the release.

file_path

The file_path method returns the location on the local disk where the release tarball should be, if mirrored.

mirror

The mirror method fetches the tarball from your JSAN currently configured JSAN mirror as determined by JSAN::Transport (if not already cached).

Returns a file path to the tarball on the local machine, or may emit an exception thrown by the underlying JSAN::Transport functions.

file_mirrored

The file_mirrored method checks to see if the release tarball has previously been downloaded to the local mirror.

Returns true if the file exists in the local mirror, or false if not.

archive

The archive method returns the release as an in-memory archive. Depending on the type, this should be either a Archive::Tar or an Archive::Zip object.

SUPPORT

Bugs should be reported via the CPAN bug tracker at

http://rt.cpan.org/NoAuth/ReportBug.html?Queue=JSAN-Client

For other issues, contact the author.

AUTHOR

Adam Kennedy <adamk@cpan.org>

SEE ALSO

JSAN::Index, JSAN::Shell, http://openjsan.org

COPYRIGHT

Copyright 2005 - 2007 Adam Kennedy.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.

NAME

JSAN::Index::Release - JSAN::Index class for the release table

SYNOPSIS

TO BE COMPLETED

DESCRIPTION

TO BE COMPLETED

METHODS

select

# Get all objects in list context
my @list = JSAN::Index::Release->select;

# Get a subset of objects in scalar context
my $array_ref = JSAN::Index::Release->select(
    'where id > ? order by id',
    1000,
);

The select method executes a typical SQL SELECT query on the release table.

It takes an optional argument of a SQL phrase to be added after the FROM release section of the query, followed by variables to be bound to the placeholders in the SQL phrase. Any SQL that is compatible with SQLite can be used in the parameter.

Returns a list of JSAN::Index::Release objects when called in list context, or a reference to an ARRAY of JSAN::Index::Release objects when called in scalar context.

Throws an exception on error, typically directly from the DBI layer.

count

# How many objects are in the table
my $rows = JSAN::Index::Release->count;

# How many objects 
my $small = JSAN::Index::Release->count(
    'where id > ?',
    1000,
);

The count method executes a SELECT COUNT(*) query on the release table.

It takes an optional argument of a SQL phrase to be added after the FROM release section of the query, followed by variables to be bound to the placeholders in the SQL phrase. Any SQL that is compatible with SQLite can be used in the parameter.

Returns the number of objects that match the condition.

Throws an exception on error, typically directly from the DBI layer.

ACCESSORS

id

if ( $object->id ) {
    print "Object has been inserted\n";
} else {
    print "Object has not been inserted\n";
}

Returns true, or throws an exception on error.

REMAINING ACCESSORS TO BE COMPLETED

SQL

The release table was originally created with the following SQL command.

CREATE TABLE release (
    id INTEGER PRIMARY KEY NOT NULL,
    distribution varchar (
        100
    )
    NOT NULL,
    author varchar (
        100
    )
    NOT NULL,
    checksum varchar (
        100
    )
    NOT NULL,
    created varchar (
        100
    )
    NOT NULL,
    doc varchar (
        100
    )
    NOT NULL,
    meta text,
    latest int (
        11
    )
    NOT NULL,
    source varchar (
        100
    )
    NOT NULL,
    srcdir varchar (
        100
    )
    NOT NULL,
    version varchar (
        100
    )
)

SUPPORT

JSAN::Index::Release is part of the JSAN::Index API.

See the documentation for JSAN::Index for more information.

COPYRIGHT

Copyright 2009 Adam Kennedy.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.