Move all POD below the code, for ::Repo and ::Project.
[catagits/Gitalist.git] / lib / Gitalist / Git / Repo.pm
index b31faff..18c7ecd 100644 (file)
@@ -1,39 +1,11 @@
 use MooseX::Declare;
 
-=head1 NAME
-
-Gitalist::Git::Repo - Model of a repository directory
-
-=head1 SYNOPSIS
-
-    my $repo = Gitalist::Git::Repo->new( repo_dir => $Dir );
-    my $project_list = $repo->projects;
-    my $first_project = @$project_list[0];
-    my $named_project = $repo->project('Gitalist');
-
-=head1 DESCRIPTION
-
-This class models a Gitalist Repo, which is a collection of
-Projects (git repositories).  It is used for creating Project
-objects to work with.
-
-=cut
-
-
 class Gitalist::Git::Repo {
     use MooseX::Types::Common::String qw/NonEmptySimpleStr/;
     use MooseX::Types::Path::Class qw/Dir/;
     use MooseX::Types::Moose qw/ArrayRef/;
     use aliased 'Gitalist::Git::Project';
 
-=head1 ATTRIBUTES
-
-=head2 repo_dir
-
-L<Path::Class::Dir> for the root of the Repo.
-
-=cut
-
     has repo_dir => (
         isa => Dir,
         is => 'ro',
@@ -41,13 +13,6 @@ L<Path::Class::Dir> for the root of the Repo.
         coerce => 1,
     );
 
-=head2 projects
-
-An array of L<Gitalist::Git::Project> for each valid git repo
-found in repo_dir.
-
-=cut
-
     has projects => (
         is => 'ro',
         isa => ArrayRef['Gitalist::Git::Project'],
@@ -55,16 +20,7 @@ found in repo_dir.
         lazy_build => 1,
     );
 
-
-=head1 METHODS
-
-=head2 project
-
-Returns a L<Gitalist::Git::Project> for the specified project
-name.
-
-=cut
-
+    ## Public methods
     method project (NonEmptySimpleStr $project) {
         my $path = $self->repo_dir->subdir($project)->resolve;
         die "Directory traversal prohibited" unless $self->repo_dir->contains($path);
@@ -72,7 +28,7 @@ name.
         return Project->new( $self->repo_dir->subdir($project) );
     }
 
-
+    ## Builders
     method _build_projects {
         my $base = $self->repo_dir;
         my $dh = $base->open || die "Could not open $base";
@@ -90,6 +46,7 @@ name.
         return [sort { $a->name cmp $b->name } @ret];
     }
 
+    ## Private methods
     # Determine whether a given directory is a git repo.
     method _is_git_repo ($dir) {
         return -f $dir->file('HEAD') || -f $dir->file('.git', 'HEAD');
@@ -98,6 +55,50 @@ name.
 
 __END__
 
+=head1 NAME
+
+Gitalist::Git::Repo - Model of a repository directory
+
+=head1 SYNOPSIS
+
+    my $repo = Gitalist::Git::Repo->new( repo_dir => $Dir );
+    my $project_list = $repo->projects;
+    my $first_project = @$project_list[0];
+    my $named_project = $repo->project('Gitalist');
+
+=head1 DESCRIPTION
+
+This class models a Gitalist Repo, which is a collection of
+Projects (git repositories).  It is used for creating Project
+objects to work with.
+
+=cut
+
+=head1 ATTRIBUTES
+
+=head2 repo_dir
+
+L<Path::Class::Dir> for the root of the Repo.
+
+=cut
+
+=head2 projects
+
+An array of L<Gitalist::Git::Project> for each valid git repo
+found in repo_dir.
+
+=cut
+
+
+=head1 METHODS
+
+=head2 project (NonEmptySimpleStr $project)
+
+Returns a L<Gitalist::Git::Project> for the specified project
+name.
+
+=cut
+
 =head1 SEE ALSO
 
 L<Gitalist::Git::Project>