The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Gitalist::Git::CollectionOfRepositories - Interface and partial implementation of a collection of git repositories

SYNOPSIS

package My::Example::CollectionOfRepositories;
use Moose::Role;
use namespace::autoclean;

with 'Gitalist::Git::CollectionOfRepositories';

sub _build_repositories {
    my $self = shift;
    [ $self->get_repository('Gitalist') ];
}
sub _get_path_for_repository_name {
    my ($self, $name) = @_;
    '/var/example/' . $name . '.git';
}

my $collection = My::Example::CollectionOfRepositories->new
my $repository_list = $collection->repositories;
my $only_repository = $repository_list->[0];
my $named_repository = $repo->get_repository('Gitalist');

DESCRIPTION

This role provides an abstraction for a list of Repository directories.

ATTRIBUTES

repositories

An array of all Git::Gitalist::Repositorys.

METHODS

get_repository (Str $name)

Returns a Git::Gitalist::Repository for the given name. If $name is not a valid git repository an exception will be thrown.

SEE ALSO

Gitalist::Git::CollectionOfRepositories::FromListOfDirectories, Gitalist::Git::CollectionOfRepositories::FromDirectory, Git::Gitalist::Repository.

AUTHORS

See Gitalist for authors.

LICENSE

See Gitalist for the license.