]> Dogcows Code - chaz/git-codeowners/blob - lib/App/Codeowners/Formatter/Table.pm
fix printing wide char with YAML formatter
[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 =head1 DESCRIPTION
5
6 This is a L<App::Codeowners::Formatter> that formats output using L<Text::Table::Any>.
7
8 =cut
9
10 use warnings;
11 use strict;
12
13 our $VERSION = '9999.999'; # VERSION
14
15 use parent 'App::Codeowners::Formatter';
16
17 use App::Codeowners::Util qw(stringify);
18
19 sub finish {
20 my $self = shift;
21 my $results = shift;
22
23 eval { require Text::Table::Any } or die "Missing dependency: Text::Table::Any\n";
24
25 my $table = Text::Table::Any::table(
26 header_row => 1,
27 rows => [$self->columns, map { [map { stringify($_) } @$_] } @$results],
28 backend => $ENV{PERL_TEXT_TABLE},
29 );
30 print { $self->handle } $table;
31 }
32
33 1;
This page took 0.032211 seconds and 4 git commands to generate.