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