Revert "Merge remote branch 't0m/json' into json"
[catagits/Gitalist.git] / lib / Gitalist / Git / HasUtils.pm
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         /],
24     );
25     method _build_util { confess(shift() . " cannot build _util") }
26 }
27
28 1;
29
30 __END__
31
32 =head1 NAME
33
34 Gitalist::Git::HasUtils - Role for classes with an instance of Gitalist::Git::Util
35
36 =head1 AUTHORS
37
38 See L<Gitalist> for authors.
39
40 =head1 LICENSE
41
42 See L<Gitalist> for the license.
43
44 =cut