X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=lib%2FApp%2FCodeowners%2FFormatter%2FString.pm;h=6fb775e2943718f30458d4b34ef76c1e11e6f845;hb=2fe281b6b85d01d6290d3c91c54232e9152cc377;hp=6303fb5f428c0eb8df74db6b6d438c21fe69acfa;hpb=8449a6dac8b4adf0e20bceecbff921d6dc598701;p=chaz%2Fgit-codeowners diff --git a/lib/App/Codeowners/Formatter/String.pm b/lib/App/Codeowners/Formatter/String.pm index 6303fb5..6fb775e 100644 --- a/lib/App/Codeowners/Formatter/String.pm +++ b/lib/App/Codeowners/Formatter/String.pm @@ -5,13 +5,12 @@ package App::Codeowners::Formatter::String; use warnings; use strict; -our $VERSION = '0.43'; # VERSION +our $VERSION = '0.50'; # VERSION use parent 'App::Codeowners::Formatter'; use App::Codeowners::Util qw(stringf zip); use Color::ANSI::Util 0.03 qw(ansifg); -use Encode qw(encode); sub stream { my $self = shift; @@ -27,7 +26,7 @@ sub stream { ); my $text = stringf($self->format, %info); - print { $self->handle } encode('UTF-8', $text), "\n"; + print { $self->handle } $text, "\n"; } sub _expand_filter_args { @@ -54,7 +53,7 @@ sub _colored { my $text = shift; my $rgb = shift or return $text; - return $text if $ENV{NO_COLOR}; + return $text if $ENV{NO_COLOR} || (defined $ENV{COLOR_DEPTH} && !$ENV{COLOR_DEPTH}); $rgb =~ s/^(.)(.)(.)$/$1$1$2$2$3$3/; if ($rgb !~ m/^[0-9a-fA-F]{6}$/) { @@ -136,7 +135,7 @@ App::Codeowners::Formatter::String - Format codeowners output using printf-like =head1 VERSION -version 0.43 +version 0.50 =head1 DESCRIPTION @@ -159,7 +158,7 @@ Charles McGarvey =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2019 by Charles McGarvey. +This software is copyright (c) 2021 by Charles McGarvey. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.