Commit | Line | Data |
76fa4452 |
1 | use MooseX::Declare; |
2 | |
3 | role Gitalist::Git::HasUtils { |
4 | use Gitalist::Git::Util; |
5 | |
6 | method BUILD {} |
7 | after BUILD { |
8 | # Force value build |
9 | $self->meta->get_attribute('_util')->get_read_method_ref->($self); |
10 | } |
11 | |
12 | has _util => ( |
13 | isa => 'Gitalist::Git::Util', |
14 | lazy => 1, |
15 | is => 'bare', |
16 | builder => '_build_util', |
17 | handles => [qw/ |
18 | run_cmd |
19 | run_cmd_fh |
20 | run_cmd_list |
21 | get_gpp_object |
22 | gpp |
23 | /], |
5c07fcf1 |
24 | traits => ['DoNotSerialize'] |
76fa4452 |
25 | ); |
26 | method _build_util { confess(shift() . " cannot build _util") } |
27 | } |
38b9e5c8 |
28 | |
29 | 1; |
775e96e0 |
30 | |
31 | __END__ |
32 | |
271f6b46 |
33 | =head1 NAME |
34 | |
35 | Gitalist::Git::HasUtils - Role for classes with an instance of Gitalist::Git::Util |
36 | |
775e96e0 |
37 | =head1 AUTHORS |
38 | |
39 | See L<Gitalist> for authors. |
40 | |
41 | =head1 LICENSE |
42 | |
43 | See L<Gitalist> for the license. |
44 | |
45 | =cut |