Make gpp instance a public attribute.
Zachary Stevens [Fri, 13 Nov 2009 00:17:09 +0000 (00:17 +0000)]
lib/Gitalist/Git/HasUtils.pm
lib/Gitalist/Git/Util.pm
t/02git_util.t

index 69addbc..2274304 100644 (file)
@@ -13,7 +13,11 @@ after BUILD => sub {
 has _util => ( isa => 'Gitalist::Git::Util',
                is => 'ro',
                lazy_build => 1,
-               handles => [ 'run_cmd', 'run_cmd_list', 'get_gpp_object' ],
+               handles => [ 'run_cmd',
+                            'run_cmd_list',
+                            'get_gpp_object',
+                            'gpp',
+                        ],
            );
 
 sub _build__util { confess(shift() . " cannot build _util") }
index ece7b51..988ed03 100644 (file)
@@ -27,7 +27,7 @@ EOR
         return $git;
     }
 
-    has _gpp      => (
+    has gpp      => (
         isa => 'Git::PurePerl', is => 'ro', lazy => 1,
         default => sub {
             my $self = shift;
@@ -52,7 +52,7 @@ EOR
     }
 
     method get_gpp_object (NonEmptySimpleStr $sha1) {
-        return $self->_gpp->get_object($sha1) || undef;
+        return $self->gpp->get_object($sha1) || undef;
     }
 
 } # end class
index 685e347..30d12c8 100644 (file)
@@ -20,6 +20,6 @@ my $util = Gitalist::Git::Util->new(
 isa_ok($util, 'Gitalist::Git::Util');
 
 like( $util->_git, qr#/git$#, 'git binary found');
-isa_ok($util->_gpp, 'Git::PurePerl', 'gpp instance created');
+isa_ok($util->gpp, 'Git::PurePerl', 'gpp instance created');
 
 done_testing;