Change 25382 by [EMAIL PROTECTED] on 2005/09/10 21:38:40
Integrate:
[ 25318]
Upgrade to Term::ANSIColor 1.10
Affected files ...
... //depot/maint-5.8/perl/lib/Term/ANSIColor.pm#6 integrate
... //depot/maint-5.8/perl/lib/Term/ANSIColor/ChangeLog#5 integrate
... //depot/maint-5.8/perl/lib/Term/ANSIColor/README#5 integrate
... //depot/maint-5.8/perl/lib/Term/ANSIColor/test.pl#4 integrate
Differences ...
==== //depot/maint-5.8/perl/lib/Term/ANSIColor.pm#6 (text) ====
Index: perl/lib/Term/ANSIColor.pm
--- perl/lib/Term/ANSIColor.pm#5~23692~ Wed Dec 29 04:03:15 2004
+++ perl/lib/Term/ANSIColor.pm Sat Sep 10 14:38:40 2005
@@ -1,8 +1,8 @@
# Term::ANSIColor -- Color screen output using ANSI escape sequences.
-# $Id: ANSIColor.pm,v 1.9 2004/12/04 01:29:12 eagle Exp $
+# $Id: ANSIColor.pm,v 1.10 2005/08/21 18:31:58 eagle Exp $
#
-# Copyright 1996, 1997, 1998, 2000, 2001, 2002
-# by Russ Allbery <[EMAIL PROTECTED]> and Zenin <[EMAIL PROTECTED]>
+# Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2005
+# by Russ Allbery <[EMAIL PROTECTED]> and Zenin
#
# This program is free software; you may redistribute it and/or modify it
# under the same terms as Perl itself.
@@ -34,7 +34,7 @@
# Don't use the CVS revision as the version, since this module is also in Perl
# core and too many things could munge CVS magic revision strings.
-$VERSION = 1.09;
+$VERSION = '1.10';
##############################################################################
# Internal data structures
@@ -182,8 +182,9 @@
if (defined $EACHLINE) {
my $attr = color (@codes);
join '',
- map { $_ && $_ ne $EACHLINE ? $attr . $_ . "\e[0m" : $_ }
- split (/(\Q$EACHLINE\E)/, $string);
+ map { $_ ne $EACHLINE ? $attr . $_ . "\e[0m" : $_ }
+ grep { length ($_) > 0 }
+ split (/(\Q$EACHLINE\E)/, $string);
} else {
color (@codes) . $string . "\e[0m";
}
@@ -465,7 +466,7 @@
=head1 COPYRIGHT AND LICENSE
Copyright 1996, 1997, 1998, 2000, 2001, 2002 Russ Allbery <[EMAIL PROTECTED]>
-and Zenin <[EMAIL PROTECTED]>. This program is free software; you may
-redistribute it and/or modify it under the same terms as Perl itself.
+and Zenin. This program is free software; you may redistribute it and/or
+modify it under the same terms as Perl itself.
=cut
==== //depot/maint-5.8/perl/lib/Term/ANSIColor/ChangeLog#5 (text) ====
Index: perl/lib/Term/ANSIColor/ChangeLog
--- perl/lib/Term/ANSIColor/ChangeLog#4~23692~ Wed Dec 29 04:03:15 2004
+++ perl/lib/Term/ANSIColor/ChangeLog Sat Sep 10 14:38:40 2005
@@ -1,3 +1,17 @@
+2005-08-21 Russ Allbery <[EMAIL PROTECTED]>
+
+ * ANSIColor.pm: Version 1.10 released.
+
+ * ANSIColor.pm (colored): Fix the $EACHLINE support to work
+ properly with a line consisting solely of "0". Remove Zenin's
+ now-defunct e-mail address from the documentation.
+ * test.pl: Test 0 and the empty string in combination with
+ $EACHLINE.
+
+ * tests/ansicolor: Add terminal test file from Joe Smith.
+ * tests/vt100-torture: Likewise.
+ * tests/README: Add an explanation of the test files.
+
2004-12-03 Russ Allbery <[EMAIL PROTECTED]>
* ANSIColor.pm: Version 1.09 released.
==== //depot/maint-5.8/perl/lib/Term/ANSIColor/README#5 (text) ====
Index: perl/lib/Term/ANSIColor/README
--- perl/lib/Term/ANSIColor/README#4~23692~ Wed Dec 29 04:03:15 2004
+++ perl/lib/Term/ANSIColor/README Sat Sep 10 14:38:40 2005
@@ -1,17 +1,15 @@
- Term::ANSIColor version 1.09
+ Term::ANSIColor version 1.10
(A simple ANSI text attribute control module)
- Copyright 1996, 1997, 1998, 2000, 2001, 2002
- Russ Allbery <[EMAIL PROTECTED]> and Zenin <[EMAIL PROTECTED]>. This
- program is free software; you may redistribute it and/or modify it under
- the same terms as Perl itself.
+ Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2005 Russ Allbery
+ <[EMAIL PROTECTED]> and Zenin. This program is free software; you may
+ redistribute it and/or modify it under the same terms as Perl itself.
I welcome bug reports and patches for this package at [EMAIL PROTECTED]
However, please be aware that I tend to be extremely busy and to get a
lot of mail. I'll save your mail and get to it as soon as I can, but
depending on how busy I am it may take me a couple of months.
-
INTRODUCTION
This module grew out of a thread on comp.lang.perl.misc where several of
@@ -46,7 +44,6 @@
Perl 5.6.0. You only need to install this module if you want a newer
version than came with Perl or if you have an old version of Perl.
-
INSTALLATION
Follow the standard installation procedure for Perl modules, which is to
@@ -65,7 +62,6 @@
Term::ANSIColor that came with Perl. You may wan to save a backup copy
of the standard version first.
-
THANKS
To Jon Lennox for looking at early versions of this module, providing
@@ -95,5 +91,11 @@
To Daniel Lindsley for the information about what Mac OS X Terminal
supports.
+
+ To Joe Smith for the test files that exercise a wide variety of VT100
+ escape sequences including the ECMA-48 color control codes.
+
+ To James Bowlin for catching a bug in colored when $EACHLINE is set that
+ caused it to not color lines consisting solely of 0.
To Larry Wall, as always, for Perl.
==== //depot/maint-5.8/perl/lib/Term/ANSIColor/test.pl#4 (xtext) ====
Index: perl/lib/Term/ANSIColor/test.pl
--- perl/lib/Term/ANSIColor/test.pl#3~23692~ Wed Dec 29 04:03:15 2004
+++ perl/lib/Term/ANSIColor/test.pl Sat Sep 10 14:38:40 2005
@@ -1,26 +1,25 @@
#!/usr/bin/perl
-# $Id: test.pl,v 1.4 2004/02/20 21:50:10 eagle Exp $
+# $Id: test.pl,v 1.5 2005/08/21 18:31:58 eagle Exp $
#
# test.pl -- Test suite for the Term::ANSIColor Perl module.
#
# Before "make install" is performed this script should be runnable with "make
# test". After "make install" it should work as "perl test.pl".
-############################################################################
+##############################################################################
# Ensure module can be loaded
-############################################################################
+##############################################################################
-BEGIN { $| = 1; print "1..13\n" }
+BEGIN { $| = 1; print "1..16\n" }
END { print "not ok 1\n" unless $loaded }
delete $ENV{ANSI_COLORS_DISABLED};
use Term::ANSIColor qw(:constants color colored uncolor);
$loaded = 1;
print "ok 1\n";
-
-############################################################################
+##############################################################################
# Test suite
-############################################################################
+##############################################################################
# Test simple color attributes.
if (color ('blue on_green', 'bold') eq "\e[34;42;1m") {
@@ -113,4 +112,25 @@
print "ok 13\n";
} else {
print "not ok 13\n";
+}
+
+# Test colored with 0 and EACHLINE.
+$Term::ANSIColor::EACHLINE = "\n";
+if (colored ('0', 'blue', 'bold') eq "\e[34;1m0\e[0m") {
+ print "ok 14\n";
+} else {
+ print "not ok 14\n";
+}
+if (colored ("0\n0\n\n", 'blue', 'bold')
+ eq "\e[34;1m0\e[0m\n\e[34;1m0\e[0m\n\n") {
+ print "ok 15\n";
+} else {
+ print "not ok 15\n";
+}
+
+# Test colored with the empty string and EACHLINE.
+if (colored ('', 'blue', 'bold') eq '') {
+ print "ok 16\n";
+} else {
+ print "not ok 16\n";
}
End of Patch.