Perl6-Pugs

 view release on metacpan or  search on metacpan

misc/sixpan/JIB/lib/JIB/Repository.pm  view on Meta::CPAN

package JIB::Repository;

use strict;
use warnings;
use base 'Object::Accessor';
use JIB::Config;
use JIB::Package;
use JIB::Constants;

use YAML;
use Path::Class;
use Params::Check qw(check);
use Log::Message::Simple qw(:STD);

=head1 METHODS

=head2 $repo = JIB::Repository->new(...);

Required arguments:

=over 4

=item root

The root directory of the repository

=item pool

Path to the pool directory of the repository. $root/jibs if not specified.

=item pool_rel

The path to the pool directory that will be put into the index files. jibs/ if
not specified.

=item index

Path to the index directory. default: $root/dists

=item index_file

Path to the main index file. default: $root/dists/index

=back

=cut

{
    my $config = JIB::Config->new;

    sub new {
        my $class = shift;
        my %args = @_;

        my ($root, $pool, $pool_rel, $index, $index_file, $pkgs);
        my $tmpl = {
            root => {
                required    => 1,
                store       => \$root
            },
            config => {
                no_override => 1,
                default     => $config
            },
            pool => {
                store => \$pool,
                #XXX allow?
            },
            pool_rel => {
                store => \$pool_rel,
            },
            index => {
                store => \$index



( run in 3.090 seconds using v1.01-cache-2.11-cpan-99c4e6809bf )