NAME

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

DESCRIPTION

This class provides objects for named distributions in the JSAN index.

METHODS

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

name

The name accessor returns the name of the distribution.

doc

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

releases

The releases method finds and retrieves all of the releases of the distribution.

Returns a list of JSAN::Index::Release objects.

latest_release

One distribution generally has a number of releases.

The latest_release method returns the JSAN::Index::Release object that represents the most recent release of the distribution.

extract_libs to => $path

The extract_libs method will extract the libraries for the most recent version of the distribution to the local filesystem.

It takes named parameters to control its behaviour.

to

The to parameter specifies the destination for the files to be extracted to. When passed as a single string, this is taken to be a directory on the local host.

No other destination options other than the local filesystem are available at this time, but more destination options are expected at a later date.

Returns the number of files extracted, or dies on error.

extract_tests to => $path

The extract_tests method will extract the test scripts for the most recent release of the distribution to the local filesystem.

Returns the number of files extracted, or dies on error.

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::Distribution - JSAN::Index class for the distribution table

SYNOPSIS

TO BE COMPLETED

DESCRIPTION

TO BE COMPLETED

METHODS

select

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

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

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

It takes an optional argument of a SQL phrase to be added after the FROM distribution 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::Distribution objects when called in list context, or a reference to an ARRAY of JSAN::Index::Distribution 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::Distribution->count;

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

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

It takes an optional argument of a SQL phrase to be added after the FROM distribution 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

name

if ( $object->name ) {
    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 distribution table was originally created with the following SQL command.

CREATE TABLE distribution (
    name varchar (
        100
    )
    NOT NULL,
    doc varchar (
        100
    )
    NOT NULL,
    PRIMARY KEY (
        name
    )
)

SUPPORT

JSAN::Index::Distribution 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.