X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FGitalist%2FGit%2FProject.pm;h=5a8096f8c756081aa7a1299f6a4ff3e556fb25a2;hb=01ced85be20bb1838c7271f28a85ab394913de3e;hp=c5e5f94a7adddd0211f835886e043157dcf0bb20;hpb=0617cbd0f82afd2766574793034615eebe16b9ca;p=catagits%2FGitalist.git diff --git a/lib/Gitalist/Git/Project.pm b/lib/Gitalist/Git/Project.pm index c5e5f94..5a8096f 100644 --- a/lib/Gitalist/Git/Project.pm +++ b/lib/Gitalist/Git/Project.pm @@ -12,9 +12,9 @@ class Gitalist::Git::Project { our $SHA1RE = qr/[0-9a-fA-F]{40}/; has name => ( isa => NonEmptySimpleStr, - is => 'ro' ); + is => 'ro', required => 1 ); has path => ( isa => "Path::Class::Dir", - is => 'ro'); + is => 'ro', required => 1); has description => ( isa => Str, is => 'ro', @@ -34,6 +34,10 @@ class Gitalist::Git::Project { handles => [ 'run_cmd' ], ); + method BUILD { + $self->$_() for qw/_util last_change owner description/; # Ensure to build early. + } + method _build__util { my $util = Gitalist::Git::Util->new( gitdir => $self->project_dir($self->path), @@ -116,7 +120,7 @@ The keys for each item will be: return @ret; } - + # FIXME - Why not just stay in Path::Class land and return a P::C::D here? method project_dir { my $dir = $self->path->stringify; $dir .= '/.git'