Change other uses of 'project' to 'repository'.
Zachary Stevens [Sat, 19 Dec 2009 03:01:58 +0000 (03:01 +0000)]
19 files changed:
lib/Gitalist.pm
lib/Gitalist/Controller/Root.pm
lib/Gitalist/Git/CollectionOfRepositories.pm
lib/Gitalist/Git/CollectionOfRepositories/FromDirectory.pm
lib/Gitalist/Git/CollectionOfRepositories/FromListOfDirectories.pm
lib/Gitalist/Git/Object.pm
lib/Gitalist/Git/Object/HasTree.pm
lib/Gitalist/Git/Repository.pm
lib/Gitalist/Git/Util.pm
lib/Gitalist/Model/GitRepos.pm
root/_footer_feeds.tt2
root/_header_feeds.tt2
root/gitweb.css
root/index.tt2
t/01app.t
t/02git_CollectionOfRepositories_FromDirectory.t
t/02git_Repository.t
t/02git_object.t
t/02git_util.t

index b5a3cca..e5e38ec 100644 (file)
@@ -26,10 +26,10 @@ __PACKAGE__->setup();
 
 around uri_for => sub {
   my ($orig, $c) = (shift, shift);
-  my $project_name = $c->stash->{'Repository'} && $c->stash->{'Repository'}->name;
+  my $repository_name = $c->stash->{'Repository'} && $c->stash->{'Repository'}->name;
   my $hash = ref($_[-1]) eq 'HASH' ? pop @_ : {};
   my $params = Catalyst::Utils::merge_hashes(
-    { p => $hash->{p} || $project_name },
+    { p => $hash->{p} || $repository_name },
     $hash,
   );
   delete $params->{p} unless defined $params->{p} && length $params->{p};
index 1567377..892a1d9 100644 (file)
@@ -46,8 +46,8 @@ sub index : Chained('base') PathPart('') Args(0) {
   $c->detach($c->req->param('a'))
     if $c->req->param('a');
 
-  my @list = @{ $c->model()->projects };
-  die 'No projects found in '. $c->model->repo_dir
+  my @list = @{ $c->model()->repositories };
+  die 'No repositories found in '. $c->model->repo_dir
     unless @list;
 
   my $search = $c->req->param('s') || '';
@@ -60,17 +60,17 @@ sub index : Chained('base') PathPart('') Args(0) {
 
   $c->stash(
     search_text => $search,
-    projects    => \@list,
+    repositories    => \@list,
     action      => 'index',
   );
 }
 
 # FIXME - WTF is this for?
-sub project_index : Chained('base') Args(0) {
+sub repository_index : Chained('base') Args(0) {
   my ( $self, $c ) = @_;
 
-  my @list = @{ $c->model()->projects };
-  die 'No projects found in '. $c->model->repo_dir
+  my @list = @{ $c->model()->repositories };
+  die 'No repositories found in '. $c->model->repo_dir
     unless @list;
 
   $c->response->content_type('text/plain');
@@ -79,6 +79,11 @@ sub project_index : Chained('base') Args(0) {
   );
   $c->response->status(200);
 }
+# FIXME - maintain compatibility with previous URI
+sub project_index : Chained('base') Args(0) {
+    my ( $self, $c) = @_;
+    $c->detach('repository_index');
+}
 
 =head2 summary
 
@@ -88,18 +93,18 @@ A summary of what's happening in the repo.
 
 sub summary : Chained('base') Args(0) {
   my ( $self, $c ) = @_;
-  my $project = $c->stash->{Repository};
-  $c->detach('error_404') unless $project;
+  my $repository = $c->stash->{Repository};
+  $c->detach('error_404') unless $repository;
   my $commit = $self->_get_object($c);
-  my @heads  = @{$project->heads};
+  my @heads  = @{$repository->heads};
   my $maxitems = Gitalist->config->{paging}{summary} || 10;
   $c->stash(
     commit    => $commit,
-    log_lines => [$project->list_revs(
+    log_lines => [$repository->list_revs(
         sha1 => $commit->sha1,
         count => $maxitems,
     )],
-    refs      => $project->references,
+    refs      => $repository->references,
     heads     => [ @heads[0 .. ($#heads < $maxitems ? $#heads : $maxitems)] ],
     action    => 'summary',
   );
@@ -113,10 +118,10 @@ The current list of heads (aka branches) in the repo.
 
 sub heads : Chained('base') Args(0) {
   my ( $self, $c ) = @_;
-  my $project = $c->stash->{Repository};
+  my $repository = $c->stash->{Repository};
   $c->stash(
     commit => $self->_get_object($c),
-    heads  => $project->heads,
+    heads  => $repository->heads,
     action => 'heads',
   );
 }
@@ -129,10 +134,10 @@ The current list of tags in the repo.
 
 sub tags : Chained('base') Args(0) {
   my ( $self, $c ) = @_;
-  my $project = $c->stash->{Repository};
+  my $repository = $c->stash->{Repository};
   $c->stash(
     commit => $self->_get_object($c),
-    tags   => $project->tags,
+    tags   => $repository->tags,
     action => 'tags',
   );
 }
@@ -140,19 +145,19 @@ sub tags : Chained('base') Args(0) {
 sub blame : Chained('base') Args(0) {
   my($self, $c) = @_;
 
-  my $project = $c->stash->{Repository};
+  my $repository = $c->stash->{Repository};
   my $h  = $c->req->param('h')
-       || $project->hash_by_path($c->req->param('hb'), $c->req->param('f'))
+       || $repository->hash_by_path($c->req->param('hb'), $c->req->param('f'))
        || die "No file or sha1 provided.";
   my $hb = $c->req->param('hb')
-       || $project->head_hash
+       || $repository->head_hash
        || die "Couldn't discern the corresponding head.";
   my $filename = $c->req->param('f') || '';
 
-  my $blame = $project->get_object($hb)->blame($filename);
+  my $blame = $repository->get_object($hb)->blame($filename);
   $c->stash(
     blame    => $blame,
-    head     => $project->get_object($hb),
+    head     => $repository->get_object($hb),
     filename => $filename,
 
     # XXX Hack hack hack, see View::SyntaxHighlight
@@ -166,22 +171,22 @@ sub blame : Chained('base') Args(0) {
 
 sub _blob_objs {
   my ( $self, $c ) = @_;
-  my $project = $c->stash->{Repository};
+  my $repository = $c->stash->{Repository};
   my $h  = $c->req->param('h')
-       || $project->hash_by_path($c->req->param('hb'), $c->req->param('f'))
+       || $repository->hash_by_path($c->req->param('hb'), $c->req->param('f'))
        || die "No file or sha1 provided.";
   my $hb = $c->req->param('hb')
-       || $project->head_hash
+       || $repository->head_hash
        || die "Couldn't discern the corresponding head.";
 
   my $filename = $c->req->param('f') || '';
 
-  my $blob = $project->get_object($h);
-  $blob = $project->get_object(
-    $project->hash_by_path($h || $hb, $filename)
+  my $blob = $repository->get_object($h);
+  $blob = $repository->get_object(
+    $repository->hash_by_path($h || $hb, $filename)
   ) if $blob->type ne 'blob';
 
-  return $blob, $project->get_object($hb), $filename;
+  return $blob, $repository->get_object($hb), $filename;
 }
 
 =head2 blob
@@ -276,12 +281,12 @@ Exposes a given commit.
 
 sub commit : Chained('base') Args(0) {
   my ( $self, $c ) = @_;
-  my $project = $c->stash->{Repository};
+  my $repository = $c->stash->{Repository};
   my $commit = $self->_get_object($c);
   $c->stash(
       commit      => $commit,
-      diff_tree   => ($project->diff(commit => $commit))[0],
-      refs      => $project->references,
+      diff_tree   => ($repository->diff(commit => $commit))[0],
+      refs      => $repository->references,
       action      => 'commit',
   );
 }
@@ -332,7 +337,7 @@ Expose an abbreviated log of a given sha1.
 sub shortlog : Chained('base') Args(0) {
   my ( $self, $c ) = @_;
 
-  my $project  = $c->stash->{Repository};
+  my $repository  = $c->stash->{Repository};
   my $commit   = $self->_get_object($c, $c->req->param('hb'));
   my $filename = $c->req->param('f') || '';
 
@@ -348,8 +353,8 @@ sub shortlog : Chained('base') Args(0) {
 
   $c->stash(
       commit    => $commit,
-      log_lines => [$project->list_revs(%logargs)],
-      refs      => $project->references,
+      log_lines => [$repository->list_revs(%logargs)],
+      refs      => $repository->references,
       page      => $page,
       filename  => $filename,
       action    => 'shortlog',
@@ -371,10 +376,10 @@ sub log : Chained('base') Args(0) {
 sub history : Chained('base') Args(0) {
     my ( $self, $c ) = @_;
     $self->shortlog($c);
-    my $project = $c->stash->{Repository};
-    my $file = $project->get_object(
-        $project->hash_by_path(
-            $project->head_hash,
+    my $repository = $c->stash->{Repository};
+    my $file = $repository->get_object(
+        $repository->hash_by_path(
+            $repository->head_hash,
             $c->stash->{filename}
         )
     );
@@ -391,17 +396,17 @@ The tree of a given commit.
 
 sub tree : Chained('base') Args(0) {
   my ( $self, $c ) = @_;
-  my $project = $c->stash->{Repository};
+  my $repository = $c->stash->{Repository};
   my $commit  = $self->_get_object($c, $c->req->param('hb'));
   my $filename = $c->req->param('f') || '';
   my $tree    = $filename
-    ? $project->get_object($project->hash_by_path($commit->sha1, $filename))
-    : $project->get_object($commit->tree_sha1)
+    ? $repository->get_object($repository->hash_by_path($commit->sha1, $filename))
+    : $repository->get_object($commit->tree_sha1)
   ;
   $c->stash(
       commit    => $commit,
       tree      => $tree,
-      tree_list => [$project->list_tree($tree->sha1)],
+      tree_list => [$repository->list_tree($tree->sha1)],
       path      => $c->req->param('f') || '',
       action    => 'tree',
   );
@@ -434,7 +439,7 @@ The action for the search form.
 sub search : Chained('base') Args(0) {
   my($self, $c) = @_;
   $c->stash(current_action => 'GitRepos');
-  my $project = $c->stash->{Repository};
+  my $repository = $c->stash->{Repository};
   my $commit  = $self->_get_object($c);
   # Lifted from /shortlog.
   my %logargs = (
@@ -450,7 +455,7 @@ sub search : Chained('base') Args(0) {
 
   $c->stash(
       commit  => $commit,
-      results => [$project->list_revs(%logargs)],
+      results => [$repository->list_revs(%logargs)],
       action  => 'search',
          # This could be added - page      => $page,
   );
@@ -469,7 +474,7 @@ sub search_help : Chained('base') Args(0) {
 
 =head2 atom
 
-Provides an atom feed for a given project.
+Provides an atom feed for a given repository.
 
 =cut
 
@@ -482,15 +487,15 @@ sub atom : Chained('base') Args(0) {
   $feed->title($host . ' - ' . Gitalist->config->{name});
   $feed->updated(~~DateTime->now);
 
-  my $project = $c->stash->{Repository};
+  my $repository = $c->stash->{Repository};
   my %logargs = (
-      sha1   => $project->head_hash,
+      sha1   => $repository->head_hash,
       count  => Gitalist->config->{paging}{log} || 25,
       ($c->req->param('f') ? (file => $c->req->param('f')) : ())
   );
 
   my $mk_title = $c->stash->{short_cmt};
-  for my $commit ($project->list_revs(%logargs)) {
+  for my $commit ($repository->list_revs(%logargs)) {
     my $entry = XML::Atom::Entry->new;
     $entry->title( $mk_title->($commit->comment) );
     $entry->id($c->uri_for('commit', {h=>$commit->sha1}));
@@ -506,32 +511,32 @@ sub atom : Chained('base') Args(0) {
 
 =head2 rss
 
-Provides an RSS feed for a given project.
+Provides an RSS feed for a given repository.
 
 =cut
 
 sub rss : Chained('base') Args(0) {
   my ($self, $c) = @_;
 
-  my $project = $c->stash->{Repository};
+  my $repository = $c->stash->{Repository};
 
   my $rss = XML::RSS->new(version => '2.0');
   $rss->channel(
     title          => lc(Sys::Hostname::hostname()) . ' - ' . Gitalist->config->{name},
-    link           => $c->uri_for('summary', {p=>$project->name}),
+    link           => $c->uri_for('summary', {p=>$repository->name}),
     language       => 'en',
-    description    => $project->description,
+    description    => $repository->description,
     pubDate        => DateTime->now,
     lastBuildDate  => DateTime->now,
   );
 
   my %logargs = (
-      sha1   => $project->head_hash,
+      sha1   => $repository->head_hash,
       count  => Gitalist->config->{paging}{log} || 25,
       ($c->req->param('f') ? (file => $c->req->param('f')) : ())
   );
   my $mk_title = $c->stash->{short_cmt};
-  for my $commit ($project->list_revs(%logargs)) {
+  for my $commit ($repository->list_revs(%logargs)) {
     # XXX Needs work ....
     $rss->add_item(
         title       => $mk_title->($commit->comment),
@@ -552,8 +557,8 @@ sub opml : Chained('base') Args(0) {
 
   $opml->head(title => lc(Sys::Hostname::hostname()) . ' - ' . Gitalist->config->{name});
 
-  my @list = @{ $c->model()->projects };
-  die 'No projects found in '. $c->model->repo_dir
+  my @list = @{ $c->model()->repositories };
+  die 'No repositories found in '. $c->model->repo_dir
     unless @list;
 
   for my $proj ( @list ) {
@@ -621,19 +626,19 @@ sub snapshot : Chained('base') Args(0) {
 sub base : Chained('/root') PathPart('') CaptureArgs(0) {
   my($self, $c) = @_;
 
-  my $project = $c->req->param('p');
-  if (defined $project) {
+  my $repository = $c->req->param('p');
+  if (defined $repository) {
     eval {
-      $c->stash(Repository => $c->model('GitRepos')->get_repository($project));
+      $c->stash(Repository => $c->model('GitRepos')->get_repository($repository));
     };
     if ($@) {
       $c->detach('/error_404');
     }
   }
 
-  my $a_project = $c->stash->{Repository} || $c->model()->projects->[0];
+  my $a_repository = $c->stash->{Repository} || $c->model()->repositories->[0];
   $c->stash(
-    git_version => $a_project->run_cmd('--version'),
+    git_version => $a_repository->run_cmd('--version'),
     version     => $Gitalist::VERSION,
 
     # XXX Move these to a plugin!
@@ -655,7 +660,7 @@ sub base : Chained('/root') PathPart('') CaptureArgs(0) {
 
 sub end : ActionClass('RenderView') {
     my ($self, $c) = @_;
-    # Give project views the current HEAD.
+    # Give repository views the current HEAD.
     if ($c->stash->{Repository}) {
         $c->stash->{HEAD} = $c->stash->{Repository}->head_hash;
     }
@@ -691,7 +696,7 @@ Populate the header and footer. Perhaps not the best location.
 
 =head2 index
 
-Provides the project listing.
+Provides the repository listing.
 
 =head2 end
 
@@ -707,7 +712,7 @@ Attempt to render a view, if needed.
 
 =head2 opml
 
-=head2 project_index
+=head2 repository_index
 
 =head1 AUTHORS
 
index 031a659..18dd195 100644 (file)
@@ -6,14 +6,14 @@ role Gitalist::Git::CollectionOfRepositories {
     use Moose::Autobox;
     use aliased 'Gitalist::Git::Repository';
 
-    has projects => (
+    has repositories => (
         is => 'ro',
         isa => ArrayRef['Gitalist::Git::Repository'],
         required => 1,
         lazy_build => 1,
     );
     method get_repository (NonEmptySimpleStr $name) {
-        my $path = $self->_get_path_for_project_name($name);
+        my $path = $self->_get_path_for_repository_name($name);
         die "Not a valid git repository."
             unless $self->_is_git_repo($path);
         return Repository->new( $path );
@@ -23,11 +23,11 @@ role Gitalist::Git::CollectionOfRepositories {
         return -f $dir->file('HEAD') || -f $dir->file('.git', 'HEAD');
     }
     requires qw/
-        _build_projects
-        _get_path_for_project_name
+        _build_repositories
+        _get_path_for_repository_name
     /;
 
-    around _build_projects {
+    around _build_repositories {
         [sort { $a->name cmp $b->name } $self->$orig->flatten];
     }
 }
index 2638839..abd3219 100644 (file)
@@ -18,7 +18,7 @@ class Gitalist::Git::CollectionOfRepositories::FromDirectory
         $self->repo_dir->resolve;
     }
 
-    method _get_path_for_project_name (NonEmptySimpleStr $name) {
+    method _get_path_for_repository_name (NonEmptySimpleStr $name) {
         my $path = $self->repo_dir->subdir($name)->resolve;
         die "Directory traversal prohibited"
             unless $self->repo_dir->contains($path);
@@ -26,11 +26,11 @@ class Gitalist::Git::CollectionOfRepositories::FromDirectory
     }
 
     ## Builders
-    method _build_projects {
+    method _build_repositories {
         my $dh = $self->repo_dir->open || die "Could not open repo_dir";
         my @ret;
         while (my $dir_entry = $dh->read) {
-            # try to get a project for each entry in repo_dir
+            # try to get a repository for each entry in repo_dir
              eval {
                  my $p = $self->get_repository($dir_entry);
                  push @ret, $p;
@@ -49,9 +49,9 @@ Gitalist::Git::CollectionOfRepositories::FromDirectory - Model of a repository d
 =head1 SYNOPSIS
 
     my $repo = Gitalist::Git::CollectionOfRepositories::FromDirectory->new( repo_dir => $Dir );
-    my $project_list = $repo->projects;
-    my $first_project = $project_list->[0];
-    my $named_project = $repo->get_repository('Gitalist');
+    my $repository_list = $repo->repositories;
+    my $first_repository = $repository_list->[0];
+    my $named_repository = $repo->get_repository('Gitalist');
 
 =head1 DESCRIPTION
 
@@ -63,7 +63,7 @@ This class provides a list of Repositories found in the given directory.
 
 The filesystem root of the C<Repo>.
 
-=head2 projects
+=head2 repositories
 
 An array of all L<Gitalist::Git::Repository>s found in C<repo_dir>.
 
index ee25e8a..ba66185 100644 (file)
@@ -17,7 +17,7 @@ class Gitalist::Git::CollectionOfRepositories::FromListOfDirectories with Gitali
         lazy_build => 1,
         traits => ['Hash'],
         handles => {
-            _get_path_for_project_name => 'get',
+            _get_path_for_repository_name => 'get',
         },
     );
 
@@ -26,7 +26,7 @@ class Gitalist::Git::CollectionOfRepositories::FromListOfDirectories with Gitali
     }
 
     ## Builders
-    method _build_projects {
+    method _build_repositories {
         [ map { $self->get_repository($_) } $self->repos->flatten ];
     }
 }                               # end class
index b3e32ed..4448790 100644 (file)
@@ -5,8 +5,8 @@ class Gitalist::Git::Object {
     use MooseX::Types::Moose qw/Str Int Bool Maybe ArrayRef/;
     use MooseX::Types::Common::String qw/NonEmptySimpleStr/;
 
-    # project and sha1 are required initargs
-    has project => ( isa => 'Gitalist::Git::Repository',
+    # repository and sha1 are required initargs
+    has repository => ( isa => 'Gitalist::Git::Repository',
                      required => 1,
                      is => 'ro',
                      weak_ref => 1,
@@ -78,7 +78,7 @@ class Gitalist::Git::Object {
         S_IFGITLINK => 0160000,
     };
 
-    # submodule/subproject, a commit object reference
+    # submodule/subrepository, a commit object reference
     sub S_ISGITLINK($) {
         return (($_[0] & S_IFMT) == S_IFGITLINK)
     }
index 13f78bc..a01b90b 100644 (file)
@@ -21,7 +21,7 @@ role Gitalist::Git::Object::HasTree {
                                     type => $type,
                                     sha1 => $object,
                                     file => $file,
-                                    project => $self->project,
+                                    repository => $self->repository,
                                   );
         }
         return \@ret;
index 4aee01e..eaefb94 100644 (file)
@@ -96,7 +96,7 @@ class Gitalist::Git::Repository with Gitalist::Git::HasUtils {
         chomp($type);
         my $class = 'Gitalist::Git::Object::' . ucfirst($type);
         $class->new(
-            project => $self,
+            repository => $self,
             sha1 => $sha1,
             type => $type,
         );
@@ -227,7 +227,7 @@ class Gitalist::Git::Repository with Gitalist::Git::HasUtils {
     ## BUILDERS
     method _build_util {
         Gitalist::Git::Util->new(
-            project => $self,
+            repository => $self,
         );
     }
 
@@ -339,10 +339,10 @@ Gitalist::Git::Repository - Model of a git repository
 =head1 SYNOPSIS
 
     my $gitrepo = dir('/repo/base/Gitalist');
-    my $project = Gitalist::Git::Repository->new($gitrepo);
-     $project->name;        # 'Gitalist'
-     $project->path;        # '/repo/base/Gitalist/.git'
-     $project->description; # 'Unnamed repository.'
+    my $repository = Gitalist::Git::Repository->new($gitrepo);
+     $repository->name;        # 'Gitalist'
+     $repository->path;        # '/repo/base/Gitalist/.git'
+     $repository->description; # 'Unnamed repository.'
 
 =head1 DESCRIPTION
 
index ffccaf8..dcf1e78 100644 (file)
@@ -7,12 +7,12 @@ class Gitalist::Git::Util {
     use Symbol qw(geniosym);
     use MooseX::Types::Common::String qw/NonEmptySimpleStr/;
 
-    has project => (
+    has repository => (
         isa => 'Gitalist::Git::Repository',
         handles => { gitdir => 'path' },
         is => 'bare', # No accessor
         weak_ref => 1, # Weak, you have to hold onto me.
-        predicate => 'has_project',
+        predicate => 'has_repository',
     );
     has _git      => ( isa => NonEmptySimpleStr, is => 'ro', lazy_build => 1 );
     sub _build__git {
@@ -32,15 +32,15 @@ EOR
         isa => 'Git::PurePerl', is => 'ro', lazy => 1,
         default => sub {
             my $self = shift;
-            confess("Cannot get gpp without project")
-                unless $self->has_project;
+            confess("Cannot get gpp without repository")
+                unless $self->has_repository;
             Git::PurePerl->new(gitdir => $self->gitdir);
         },
     );
 
     method run_cmd (@args) {
         unshift @args, ( '--git-dir' => $self->gitdir )
-            if $self->has_project;
+            if $self->has_repository;
 #        print STDERR 'RUNNING: ', $self->_git, qq[ @args], $/;
         run [$self->_git, @args], \my($in, $out, $err);
 
@@ -50,7 +50,7 @@ EOR
     method run_cmd_fh (@args) {
         my ($in, $out, $err) = (geniosym, geniosym, geniosym);
         unshift @args, ('--git-dir' => $self->gitdir)
-            if $self->has_project;
+            if $self->has_repository;
 #        print STDERR 'RUNNING: ', $self->_git, qq[ @args], $/;
         run [$self->_git, @args],
             '<pipe', $in,
index 487dac5..deff310 100644 (file)
@@ -61,7 +61,7 @@ sub _build_repo_dir {
 after BUILD => sub {
     my $self = shift;
     # Explode loudly at app startup time if there is no list of
-    # projects or repos dir, rather than on first hit
+    # repositories or repos dir, rather than on first hit
     $self->_repos_count || $self->repo_dir;
 };
 
index 0709866..3e99e51 100644 (file)
@@ -28,5 +28,5 @@
       href="[% c.uri_for('opml') %]">OPML</a>
     <a
       class="rss_logo"
-      href="[% c.uri_for('project_index') %]">TXT</a>
+      href="[% c.uri_for('repository_index') %]">TXT</a>
   [% END %]
index 7db8f4a..2183ab5 100644 (file)
   [% ELSE %]
   <link
     rel="alternate"
-    title="[% c.config.sitename %] Git projects list"
-    href="[% c.uri_for('project_index') %]"
+    title="[% c.config.sitename %] Git repositories list"
+    href="[% c.uri_for('repository_index') %]"
     type="text/plain; charset=utf-8"
   > 
   <link
     rel="alternate"
-    title="[% c.config.sitename %] Git projects feeds"
+    title="[% c.config.sitename %] Git repositories feeds"
     href="[% c.uri_for('opml') %]"
     type="text/x-opml"
   >
index 446a1c3..e5473aa 100644 (file)
@@ -282,18 +282,18 @@ table.diff_tree span.file_status.copied {
 }
 
 /* noage: "No commits" */
-table.project_list td.noage {
+table.repository_list td.noage {
        color: #808080;
        font-style: italic;
 }
 
 /* age2: 60*60*24*2 <= age */
-table.project_list td.age2, table.blame td.age2 {
+table.repository_list td.age2, table.blame td.age2 {
        font-style: italic;
 }
 
 /* age1: 60*60*2 <= age < 60*60*24*2 */
-table.project_list td.age1 {
+table.repository_list td.age1 {
        color: #009900;
        font-style: italic;
 }
@@ -304,7 +304,7 @@ table.blame td.age1 {
 }
 
 /* age0: age < 60*60*2 */
-table.project_list td.age0 {
+table.repository_list td.age0 {
        color: #009900;
        font-style: italic;
        font-weight: bold;
index f08809d..9d1544d 100644 (file)
@@ -5,7 +5,7 @@
    </p>
   </form>
 
-  <table class="project_list">
+  <table class="repository_list">
     <thead>
        <tr>
            <th>Repository</th>
@@ -28,7 +28,7 @@
     </tfoot>
 
     <tbody class='listing'>
-      [% FOR p IN projects %]
+      [% FOR p IN repositories %]
        <tr>
            <td><a class="list" href="[% c.uri_for('/summary', {p=p.name}) %]">[% p.name %]</a></td>
            <td><a class="list" title="[% p.description %]" href="[% c.uri_for('/summary', {p=p.name} ) %]">[% abridged_description(p.description)  %]</a></td>
index 09544e2..2ed2537 100644 (file)
--- a/t/01app.t
+++ b/t/01app.t
@@ -18,8 +18,8 @@ for my $p (qw/ repo1 nodescription /) {
 }
 
 my $response = request('/summary?p=DoesNotExist');
-is $response->code, 404, 'invalid project 404s';
-like $response->content, qr/Page not found/, 'invalid project handled correctly';
+is $response->code, 404, 'invalid repository 404s';
+like $response->content, qr/Page not found/, 'invalid repository handled correctly';
 
 is request('/summary?p=../../../')->code, 404, 'directory traversal failed';
 
index c1f1ac8..41f7699 100644 (file)
@@ -26,25 +26,25 @@ my $repoWorking = Path::Class::Dir->new('t/lib/repositories/working');
 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;
-ok(scalar @{$project_list} == 3, 'list_projects returns an array with the correct number of members' );
-isa_ok($project_list->[0], 'Gitalist::Git::Repository');
-is($project_list->[0]->{name}, 'bare.git', 'list_projects has correct name for "bare.git" repo' );
+my $repository_list = $repo->repositories;
+ok(scalar @{$repository_list} == 3, '->repositories is an array with the correct number of members' );
+isa_ok($repository_list->[0], 'Gitalist::Git::Repository');
+is($repository_list->[0]->{name}, 'bare.git', '->repositories has correct name for "bare.git" repo' );
 
 dies_ok {
-    my $project = $repo->get_repository('NoSuchRepository');
-} 'throws exception for invalid project';
+    my $repository = $repo->get_repository('NoSuchRepository');
+} 'throws exception for invalid repository';
 
 dies_ok {
-    my $project = $repo->get_repository();
-} 'throws exception for no project';
+    my $repository = $repo->get_repository();
+} 'throws exception for no repository';
 
 dies_ok {
-    my $project = $repo->get_repository('../../../');
+    my $repository = $repo->get_repository('../../../');
 } 'throws exception for directory traversal';
 
-my $project = $repo->get_repository('repo1');
-isa_ok($project, 'Gitalist::Git::Repository');
+my $repository = $repo->get_repository('repo1');
+isa_ok($repository, 'Gitalist::Git::Repository');
 
 
 # check for bug where get_repository blew up if repo_dir
index 738c7f7..e8ee762 100644 (file)
@@ -25,15 +25,15 @@ BEGIN { use_ok 'Gitalist::Git::Repository' }
 
 dies_ok {
     my $proj = Gitalist::Git::Repository->new();
-} 'New project with no args';
+} 'New repository with no args';
 
 use Path::Class;
 my $gitdir = dir("$Bin/lib/repositories/repo1");
 
 my $proj = Gitalist::Git::Repository->new($gitdir);
 isa_ok($proj, 'Gitalist::Git::Repository');
-is($proj->path, $gitdir, 'project path is set');
-isa_ok($proj->path, 'Path::Class::Dir', 'project path');
+is($proj->path, $gitdir, 'repository path is set');
+isa_ok($proj->path, 'Path::Class::Dir', 'repository path');
 is($proj->name, qw/repo1/, 'repository name is set');
 is($proj->description, qq/some test repository/, 'repository description loaded');
 isa_ok($proj->last_change, 'DateTime', 'last_change');
index 5a56041..f6fa33d 100644 (file)
@@ -7,7 +7,7 @@ use Data::Dumper;
 
 use Path::Class;
 use Gitalist::Git::Repository;
-my $project = Gitalist::Git::Repository->new(
+my $repository = Gitalist::Git::Repository->new(
     dir("$Bin/lib/repositories/repo1"),
 );
 
@@ -19,7 +19,7 @@ BEGIN {
     }
 
 my $object = Gitalist::Git::Object::Tree->new(
-    project => $project,
+    repository => $repository,
     sha1 => '729a7c3f6ba5453b42d16a43692205f67fb23bc1',
     type => 'tree',
     file => 'dir1',
@@ -35,7 +35,7 @@ is($object->size, 33, "size is correct");
 
 # Create object from sha1.
 my $obj2 = Gitalist::Git::Object::Blob->new(
-    project => $project,
+    repository => $repository,
     sha1 => '5716ca5987cbf97d6bb54920bea6adde242d87e6',
 );
 isa_ok($obj2, 'Gitalist::Git::Object::Blob', 'blob object');
@@ -53,7 +53,7 @@ dies_ok {
 } 'comment is an empty string';
 
 my $commit_obj = Gitalist::Git::Object::Commit->new(
-    project => $project,
+    repository => $repository,
     sha1 => '3f7567c7bdf7e7ebf410926493b92d398333116e',
 );
 isa_ok($commit_obj, 'Gitalist::Git::Object::Commit', "commit object");
index 9a3d59d..94f82f7 100644 (file)
@@ -15,7 +15,7 @@ my $gitdir = dir("$Bin/lib/repositories/repo1");
 
 my $proj = Gitalist::Git::Repository->new($gitdir);
 my $util = Gitalist::Git::Util->new(
-    project => $proj,
+    repository => $proj,
 );
 isa_ok($util, 'Gitalist::Git::Util');