Commit | Line | Data |
38b9e5c8 |
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; |
50d45f00 |
9 | $self->meta->get_attribute('_util')->get_read_method_ref->($self); # Force value build. |
38b9e5c8 |
10 | }; |
11 | |
12 | has _util => ( isa => 'Gitalist::Git::Util', |
50d45f00 |
13 | lazy => 1, |
14 | is => 'bare', |
15 | builder => '_build_util', |
defb0050 |
16 | handles => [ 'run_cmd', |
aa7f1f92 |
17 | 'run_cmd_fh', |
defb0050 |
18 | 'run_cmd_list', |
19 | 'get_gpp_object', |
20 | 'gpp', |
21 | ], |
38b9e5c8 |
22 | ); |
23 | |
50d45f00 |
24 | sub _build_util { confess(shift() . " cannot build _util") } |
38b9e5c8 |
25 | |
26 | 1; |
775e96e0 |
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 |