]> Dogcows Code - chaz/git-codeowners/blob - lib/App/Codeowners/Formatter/Table.pm
cba514782f81f7cbb5014574ce907ab1916ac214
[chaz/git-codeowners] / lib / App / Codeowners / Formatter / Table.pm
1 package App::Codeowners::Formatter::Table;
2 # ABSTRACT: Format codeowners output as a table
3
4
5 use warnings;
6 use strict;
7
8 our $VERSION = '0.48'; # VERSION
9
10 use parent 'App::Codeowners::Formatter';
11
12 use App::Codeowners::Util qw(stringify);
13 use Encode qw(encode);
14
15 sub finish {
16 my $self = shift;
17 my $results = shift;
18
19 eval { require Text::Table::Any } or die "Missing dependency: Text::Table::Any\n";
20
21 my $table = Text::Table::Any::table(
22 header_row => 1,
23 rows => [$self->columns, map { [map { stringify($_) } @$_] } @$results],
24 backend => $ENV{PERL_TEXT_TABLE},
25 );
26 print { $self->handle } encode('UTF-8', $table);
27 }
28
29 1;
30
31 __END__
32
33 =pod
34
35 =encoding UTF-8
36
37 =head1 NAME
38
39 App::Codeowners::Formatter::Table - Format codeowners output as a table
40
41 =head1 VERSION
42
43 version 0.48
44
45 =head1 DESCRIPTION
46
47 This is a L<App::Codeowners::Formatter> that formats output using L<Text::Table::Any>.
48
49 =head1 BUGS
50
51 Please report any bugs or feature requests on the bugtracker website
52 L<https://github.com/chazmcgarvey/git-codeowners/issues>
53
54 When submitting a bug or request, please include a test-file or a
55 patch to an existing test-file that illustrates the bug or desired
56 feature.
57
58 =head1 AUTHOR
59
60 Charles McGarvey <chazmcgarvey@brokenzipper.com>
61
62 =head1 COPYRIGHT AND LICENSE
63
64 This software is copyright (c) 2019 by Charles McGarvey.
65
66 This is free software; you can redistribute it and/or modify it under
67 the same terms as the Perl 5 programming language system itself.
68
69 =cut
This page took 0.035512 seconds and 3 git commands to generate.