Improved Repo's POD.
Zachary Stevens [Sun, 13 Dec 2009 02:09:57 +0000 (02:09 +0000)]
lib/Gitalist/Git/Repo.pm
t/02git_repo.t

index a8fff7e..4ea803e 100644 (file)
@@ -68,7 +68,7 @@ Gitalist::Git::Repo - Model of a repository directory
 
     my $repo = Gitalist::Git::Repo->new( repo_dir => $Dir );
     my $project_list = $repo->projects;
-    my $first_project = @$project_list[0];
+    my $first_project = $project_list->[0];
     my $named_project = $repo->get_project('Gitalist');
 
 =head1 DESCRIPTION
@@ -82,11 +82,11 @@ objects to work with.
 
 =head2 repo_dir (C<Path::Class::Dir>)
 
-The filesystem root of the Repo.
+The filesystem root of the C<Repo>.
 
 =head2 projects
 
-An array of all Repos found in C<repo_dir>.
+An array of all L<Gitalist::Git::Project>s found in C<repo_dir>.
 
 
 
@@ -94,8 +94,10 @@ An array of all Repos found in C<repo_dir>.
 
 =head2 get_project (Str $name)
 
-Returns a L<Gitalist::Git::Project> for the specified project
-name.
+Returns a L<Gitalist::Git::Project> 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
index 65a31e2..2344d8d 100644 (file)
@@ -27,8 +27,8 @@ my $repoEmpty = Path::Class::Dir->new('t/lib/repositories/empty.git');
 ok( ! $repo->_is_git_repo( $repoEmpty ), 'is_git_repo is false for empty dir' );
 
 my $project_list = $repo->projects;
-isa_ok(@$project_list[0], 'Gitalist::Git::Project');
 ok(scalar @{$project_list} == 3, 'list_projects returns an array with the correct number of members' );
+isa_ok($project_list->[0], 'Gitalist::Git::Project');
 is($project_list->[0]->{name}, 'bare.git', 'list_projects has correct name for "bare.git" repo' );
 
 dies_ok {