}
1;
+
+=head1 NAME
+
+Gitalist::Git::CollectionOfRepositories - Interface and partial implementation of a collection of git repositories
+
+=head1 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');
+
+=head1 DESCRIPTION
+
+This role provides an abstraction for a list of Repository directories.
+
+=head1 ATTRIBUTES
+
+=head2 repositories
+
+An array of all L<Gitalist::Git::Repository>s.
+
+=head1 METHODS
+
+=head2 get_repository (Str $name)
+
+Returns a L<Gitalist::Git::Repository> for the given name.
+If C<$name> is not a valid git repository an exception will be thrown.
+
+=head1 SEE ALSO
+
+L<Gitalist::Git::CollectionOfRepositories::FromListOfDirectories>,
+L<Gitalist::Git::CollectionOfRepositories::FromDirectory>,
+L<Gitalist::Git::Repository>.
+
+=head1 AUTHORS
+
+See L<Gitalist> for authors.
+
+=head1 LICENSE
+
+See L<Gitalist> for the license.
+
+=cut
+
=head1 NAME
-Gitalist::Git::CollectionOfRepositories::FromDirectory - Model of a repository directory
+Gitalist::Git::CollectionOfRepositories::FromDirectory - Model of a directory containing git repositories
=head1 SYNOPSIS
The filesystem root of the C<Repo>.
-=head2 repositories
-
-An array of all L<Gitalist::Git::Repository>s found in C<repo_dir>.
-
-
-
-=head1 METHODS
-
-=head2 get_repository (Str $name)
-
-Returns a L<Gitalist::Git::Repository> for the given name.
-If C<$name> is not a valid git repository under C<$repo_dir>, an exception
-will be thrown.
-
-
-
=head1 SEE ALSO
-L<Gitalist::Git::Repository>
-
+L<Gitalist::Git::CollectionOfRepositories>, L<Gitalist::Git::Repository>
=head1 AUTHORS
is => 'ro',
required => 1,
);
- has repos_by_name => (
+ has _repos_by_name => (
isa => HashRef[NonEmptySimpleStr],
is => 'ro',
lazy_build => 1,
},
);
- method _build_repos_by_name {
+ method _build__repos_by_name {
{ map { basename($_) => $_ } $self->repos->flatten };
}
} # end class
1;
+
+=head1 NAME
+
+Gitalist::Git::CollectionOfRepositories::FromListOfDirectories - Model of a collection of git repositories
+
+=head1 SYNOPSIS
+
+ my $collection = Gitalist::Git::CollectionOfRepositories::FromListOfDirectories->new( repos => [qw/
+ /path/to/repos1
+ /path/to/repos2
+ /] );
+ my $repository_list = $collection->repositories;
+ my $first_repository = $repository_list->[0];
+ my $named_repository = $repo->get_repository('Gitalist');
+
+=head1 DESCRIPTION
+
+This class provides an abstraction for a list of Repository directories.
+
+=head1 ATTRIBUTES
+
+=head2 repos (C<< ArrayRef[NonEmptySimpleStr] >>)
+
+A list of git repository directories
+
+=head1 SEE ALSO
+
+L<Gitalist::Git::CollectionOfRepositories>, L<Gitalist::Git::Repository>
+
+=head1 AUTHORS
+
+See L<Gitalist> for authors.
+
+=head1 LICENSE
+
+See L<Gitalist> for the license.
+
+=cut
__END__
+=head1 NAME
+
+Gitalist::Git::HasUtils - Role for classes with an instance of Gitalist::Git::Util
+
=head1 AUTHORS
See L<Gitalist> for authors.
__END__
+=head1 NAME
+
+Gitalist::Git::Util - Class for utilities to run git or deal with Git::PurePerl
+
+=head1 SEE ALSO
+
+L<Git::PurePerl>.
+
=head1 AUTHORS
See L<Gitalist> for authors.