Small cleanups
Tomas Doran [Sun, 6 Dec 2009 13:33:26 +0000 (13:33 +0000)]
lib/Gitalist/Git/HasUtils.pm
lib/Gitalist/Git/Project.pm

index e162e20..99a2d61 100644 (file)
@@ -6,13 +6,13 @@ use namespace::autoclean;
 sub BUILD {}
 after BUILD => sub {
     my $self = shift;
-    # Force value build. A little convoluted as we don't have an accessor :)
-    $self->_util;
+    $self->meta->get_attribute('_util')->get_read_method_ref->($self); # Force value build.
 };
 
 has _util => ( isa => 'Gitalist::Git::Util',
-               is => 'ro',
-               lazy_build => 1,
+               lazy => 1,
+               is => 'bare',
+               builder => '_build_util',
                handles => [ 'run_cmd',
                             'run_cmd_fh',
                             'run_cmd_list',
@@ -21,7 +21,7 @@ has _util => ( isa => 'Gitalist::Git::Util',
                         ],
            );
 
-sub _build__util { confess(shift() . " cannot build _util") }
+sub _build_util { confess(shift() . " cannot build _util") }
 
 1;
 
index ea425e2..0abb3e7 100644 (file)
@@ -340,7 +340,7 @@ FIXME Should this return objects?
     }
 
     ## BUILDERS
-    method _build__util {
+    method _build_util {
         Gitalist::Git::Util->new(
             project => $self,
         );