]>
Dogcows Code - chaz/git-codeowners/blob - lib/App/Codeowners/Formatter/CSV.pm
1 package App
::Codeowners
::Formatter
::CSV
;
2 # ABSTRACT: Format codeowners output as comma-separated values
8 our $VERSION = '0.49'; # VERSION
10 use parent
'App::Codeowners::Formatter';
12 use App
::Codeowners
::Util
qw(stringify);
17 $self->text_csv->print($self->handle, $self->columns);
24 $self->text_csv->print($self->handle, [map { stringify
($_) } @$result]);
31 $self->{text_csv
} ||= do {
32 eval { require Text
::CSV
} or die "Missing dependency: Text::CSV\n";
35 $options{escape_char
} = $self->escape_char if $self->escape_char;
36 $options{quote
} = $self->quote if $self->quote;
37 $options{sep
} = $self->sep if $self->sep;
38 if ($options{sep
} && $options{sep
} eq ($options{quote
} || '"')) {
39 die "Invalid separator value for CSV format.\n";
42 Text
::CSV-
>new({binary
=> 1, eol
=> $/, %options});
43 } or die "Failed to construct Text::CSV object";
47 sub sep
{ $_[0]->{sep
} || $_[0]->format }
48 sub quote
{ $_[0]->{quote
} }
49 sub escape_char
{ $_[0]->{escape_char
} }
61 App::Codeowners::Formatter::CSV - Format codeowners output as comma-separated values
69 This is a L<App::Codeowners::Formatter> that formats output using L<Text::CSV>.
75 Get the L<Text::CSV> instance.
79 Get the value used for L<Text::CSV/sep>.
83 Get the value used for L<Text::CSV/quote>.
87 Get the value used for L<Text::CSV/escape_char>.
91 Please report any bugs or feature requests on the bugtracker website
92 L<https://github.com/chazmcgarvey/git-codeowners/issues>
94 When submitting a bug or request, please include a test-file or a
95 patch to an existing test-file that illustrates the bug or desired
100 Charles McGarvey <chazmcgarvey@brokenzipper.com>
102 =head1 COPYRIGHT AND LICENSE
104 This software is copyright (c) 2019 by Charles McGarvey.
106 This is free software; you can redistribute it and/or modify it under
107 the same terms as the Perl 5 programming language system itself.
This page took 0.049023 seconds and 5 git commands to generate.