Small cleanups
[catagits/Gitalist.git] / lib / Gitalist / Git / HasUtils.pm
1 package Gitalist::Git::HasUtils;
2 use Moose::Role;
3 use Gitalist::Git::Util;
4 use namespace::autoclean;
5
6 sub BUILD {}
7 after BUILD => sub {
8     my $self = shift;
9     $self->meta->get_attribute('_util')->get_read_method_ref->($self); # Force value build.
10 };
11
12 has _util => ( isa => 'Gitalist::Git::Util',
13                lazy => 1,
14                is => 'bare',
15                builder => '_build_util',
16                handles => [ 'run_cmd',
17                             'run_cmd_fh',
18                             'run_cmd_list',
19                             'get_gpp_object',
20                             'gpp',
21                         ],
22            );
23
24 sub _build_util { confess(shift() . " cannot build _util") }
25
26 1;
27
28 __END__
29
30 =head1 AUTHORS
31
32 See L<Gitalist> for authors.
33
34 =head1 LICENSE
35
36 See L<Gitalist> for the license.
37
38 =cut