2013-01-07 Russ Allbery <rra@stanford.edu>
* ANSIColor.pm: Version 4.02 released.
* Makefile.PL: Add the minimum Perl version to the package
metadata.
* t/basic256.t: List the tag first in the import list for
compatibility with the Exporter from Perl 5.6.2. Thanks to David
Cantrell for the testing and debugging.
2012-12-31 Russ Allbery <rra@stanford.edu>
* ANSIColor.pm: Version 4.01 released.
* t/strict.t: During coverage checking, skip generic tests that
don't run module code for a significant speed-up.
* examples/generate-colors: Add POD documentation.
* t/critic.t: Also check the examples directory.
* t/pod.t: Likewise.
* t/pod-spelling.t: Likewise.
* t/aliases-env.t: Fix logic for skipping tests when Test::Warn is
not installed.
2012-12-30 Russ Allbery <rra@stanford.edu>
* ANSIColor.pm: Version 4.00 released.
* LICENSE: New file summarizing copyright and license information.
* examples/generate-colors: Add support for "basic" and "bright"
test file types that test all the other supported attributes.
* tests/README: Remove VT100 test files. The license was unclear,
and the new generate-colors example script does everything they do
of significance for this package plus more.
* tests/ansicolor: Likewise.
* tests/vt100-torture: Likewise.
* ANSIColor.pm (PUSHCOLOR): Take an array like all the other
constant functions and join all arguments together before
manipulating it.
* t/basic.t: Multiple new tests for various weird edge cases.
* ANSIColor.pm (AUTOLOAD): Only honor ANSI_COLORS_DISABLED if it
is set to a true value.
(color): Likewise.
(colored): Likewise.
* t/basic.t: Test that ANSI_COLORS_DISABLED must be true.
* t/synopsis.t: New test for SYNOPSIS syntax.
* ANSIColor.pm: Add COMPATIBILITY section to the documentation,
collecting all information about when features were introduced and
adding the version of Perl that they shipped with. Add
appropriate version numbers to the use statements in the SYNOPSIS.
* ANSIColor.pm: Use coloralias to load aliases from the
environment. Improve commenting in the SYNOPSIS. Document the
new alias name restrictions.
(coloralias): New function to set a color alias. Enforce
restrictions on the acceptable alias name.
* t/aliases-env.t: Adjust warning test for new error message.
* t/aliases-func.t: New test of coloralias.
2012-12-29 Stephen Thirlwall <stephen.thirlwall@strategicdata.com.au>
Russ Allbery <rra@stanford.edu>
* ANSIColor.pm: Add support for custom color names configured with
the ANSI_COLORS_ALIASES environment variable as set during module
load.
(color): Support custom colors.
(colorvalid): Likewise.
* t/aliases-env.t: New test of custom colors from the environment.
* t/basic.t: Delete ANSI_COLORS_ALIASES from the environment before
module load to avoid any effects from the test runner's settings.
* t/basic256.t: Likewise.
* t/eval.t: Likewise.
* t/stringify.t: Likewise.
* t/taint.t: Likewise.
2012-12-28 Kurt Starsinic <kstarsinic@gmail.com>
Russ Allbery <rra@stanford.edu>
* ANSIColor.pm: Add constants (with tag :constants256) and
attributes for 256-color emulators.
(uncolor): Support the three-part 256-color codes.
* t/basic256.t: New test for 256-color support.
* examples/generate-colors: New script to generate 256-color test
or demonstration files.
2012-12-28 Russ Allbery <rra@stanford.edu>
* t/basic.t: Test uncolor with \e[m and '' as only arguments.
* ANSIColor.pm: $AUTOLOCAL takes precedence over $AUTORESET,
reversing the previous behvior. Document the precedence.
* t/basic.t: Test for $AUTOLOCAL vs. $AUTORESET precedence.
* t/taint.t: New check for proper untainting in AUTOLOAD.
* ANSIColor.pm: Comment the untainting of $AUTOLOAD so that it
isn't accidentally removed as apparently unnecessary.
* t/strict.t: Ignore t/taint.t for coverage checking, since
Test::Strict doesn't know how to invoke tests that require
tainting.
* t/strict.t: Add test suite coverage checking if running the test
in maintainer mode.
* ANSIColor.pm (AUTOLOAD): Drop a redundant check on the result of
eval so that 100% test coverage can be achieved.
* t/basic.t: Remove taint checking, which is incompatible with
coverage testing. Add tests to achieve 100% coverage.
* t/eval.t: Remove taint checking.
* t/stringify.t: Likewise.
* ANSIColor.pm: Document $Term::ANSIColor::AUTOLOCAL.
* ANSIColor.pm (AUTOLOAD): Support ANSI_COLORS_DISABLED in the
generated constant subs. Fixes a bug where the environment
variable would be ignored if the constant were used before it was
set.
* t/basic.t: Test for proper ANSI_COLORS_DISABLED support in
generated constant subs.
* t/critic.t: New test that runs perlcritic (and perltidy) on all
source files and checks for violations.
* t/data/perlcriticrc: New file.
* t/data/perltidyrc: New file.
* ANSIColor.pm: Substantial reworking to improve coding style and
layout. Update to Perl 5.6 syntax. Unconditionally load Carp for
simplicity.
* Makefile.PL: Require Perl 5.6. Remove conditionals for
configuration that was not supported prior to Perl 5.6.
* t/basic.t: Update coding style.
* t/eval.t: Likewise.
* t/stringify.t: Likewise.
* t/minimum-version.t: New test for the minimum required version
of Perl.
* t/pod-coverage.t: New test for POD coverage.
* ANSIColor.pm: Add use warnings.
* Makefile.PL: Add use strict and use warnings.
* t/strict.t: New test for strict and warnings in all code.
* t/pod.t: Update coding style.
* t/pod-spelling.t: Use Test::Spelling instead of including a
less-tested version of the same code. Update coding style.
2012-03-18 Russ Allbery <rra@stanford.edu>
* ANSIColor.pm: Version 3.02 released.
* ANSIColor.pm (AUTOLOAD): Only return pass-through behavior if
the function that was called was one of our constants, rather than
turning every unknown function in the Term::ANSIColor namespace
into a passthrough join function when colors are disabled.
* t/basic.t: Test proper error reporting with colors disabled.
* ANSIColor.pm (AUTOLOAD): Preserve an existing value of $@ when
generating a constant sub and restore it afterwards. Diagnose
errors in creating the constant sub and die instead of ignoring
them.
* t/eval.t: New test for $@ preservation.
* ANSIColor.pm: Add italic and the ITALIC constant. Document that
the support for it is rare.
* t/basic.t: Test italic and ITALIC support.
* ANSIColor.pm: Add "mistyped" as a stopword, required by the
latest aspell on Debian.
2011-07-20 Russ Allbery <rra@stanford.edu>
* ANSIColor.pm: Version 3.01 released.
* Makefile.PL: Change the DISTNAME to Term-ANSIColor.
* ANSIColor.pm (colored): Only interpret an initial array
reference as a list of colors, not any initial reference, allowing
the colored function to work properly on objects with
stringification defined. Thanks, Revilo Reegiles.
* t/stringify.t: New test for proper behavior with non-array
references in colored.
2011-03-13 Russ Allbery <rra@stanford.edu>
* ANSIColor.pm: Fix two syntax errors in the SYNOPSIS. Thanks,
Jan Hartung.
2010-10-08 Russ Allbery <rra@stanford.edu>
* ANSIColor.pm: Warn in the documentation that attributes are not
supported in and will not work with Perl formats.
2010-04-11 Russ Allbery <rra@stanford.edu>
* ANSIColor.pm: Update the URL for ECMA-048 in the documentation.
Upstream changes:
2010-01-24 Russ Allbery <rra@stanford.edu>
* ANSIColor.pm: Version 3.00 released.
* t/basic.t: Add some basic tests for bright color support.
* ANSIColor.pm: Reorganize the documentation and be clearer about
the function interface parameters. Reword the explanation of
bright and regular colors, and provide some advice about which
to use.
2010-01-24 Jakob Ilves <illvilja@gmail.com>
* ANSIColor.pm: Add bright versions of the basic eight foreground
and background colors using the 9x and 10x codes, supported by
emulators with 16 color support.
Upstream changes:
2009-08-30 Russ Allbery <rra@stanford.edu>
* ANSIColor.pm: Version 2.02 released.
* ANSIColor.pm: Update compatibility matrix to reflect that xterm
now supports blink.
* ANSIColor.pm (colorvalid): New function to check whether an
attribute is known.
* t/basic.t: Test colorvalid.
- Updating package for p5 module ANSIColor from 2.00 to 2.01
- Adding licese (perl license as named in META.yml)
- Adding destdir support
Upstream changes:
2009-07-04 Russ Allbery <rra@stanford.edu>
* ANSIColor.pm: Version 2.01 released.
* t/basic.t: Test error handling in color, colored, and uncolor.
* ANSIColor.pm (uncolor): When reporting errors for bad escape
sequences, don't include the leading \e[ or trailing m in the
error message.
* ANSIColor.pm: Add section headings to the DESCRIPTION section of
the module since it's getting rather long.
(colorstrip): New function to remove ANSI color codes from
strings. Thanks, Paul Miller.
* t/basic.t: New tests for colorstrip.
* ANSIColor.pm (AUTOLOAD): Untaint $AUTOLOAD, required by Perl
5.10 when running in taint mode. Thanks, Tim Bellinghausen.
* t/basic.t: Two new tests for AUTOLOAD error handling. Enable
warnings and taint mode.
- Updating package for p5 module Term::ANSIColor to 2.00
Upstream changes:
2009-02-28 Russ Allbery <rra@stanford.edu>
* ANSIColor.pm: Version 2.00 released.
* Makefile.PL: Add LICENSE to the distribution metadata for Perl
5.10 and later.
* ANSIColor.pm: Add explicit return statements instead of relying
on the implicit return of the last expression. Use all caps for
all global variables.
* ANSIColor.pm: Add the new functions to a :pushpop export tag.
(PUSHCOLOR): New function that stores in an internal stack the
attributes that are being set.
(POPCOLOR): New function that pops the attributes being set and
sets the attributes previously found on the stack.
(LOCALCOLOR): New function that surrounds its argument in
PUSHCOLOR and POPCOLOR.
(AUTOLOAD): If $AUTOLOCAL is set, surround all color constants
with an implicit LOCALCOLOR.
* t/basic.t: Test PUSHCOLOR, POPCOLOR, and LOCALCOLOR.
* t/pod-spelling.t: Rewrite to use Test::More. Support and prefer
aspell.
* ANSIColor.pm: Fix additional spelling errors and rewrap the POD
documentation to a 74-character margin.
* t/basic.t: Rewrite to use Test::More.
* t/pod.t: Likewise.
* ANSIColor.pm (AUTOLOAD): If ANSI_COLORS_DISABLED is set, return
the stringified arguments rather than creating a sub. This allows
colors to work later if ANSI_COLORS_DISABLED is unset rather than
making its effects permanent. It also avoids adding a reset
escape sequence when $AUTORESET and ANSI_COLORS_DISABLED are both
set.
2008-09-14 Russ Allbery <rra@stanford.edu>
* ANSIColor.pm: Add faint as a synonym for dark and improve the
documentation of text attributes.
* t/pod-spelling.t: New check to spell-check POD documentation
using ispell with Pod::Spell.
* ANSIColor.pm: Fix spelling and markup errors in documentation
and add stop-words where appropriate.
This module has two interfaces, one through color() and colored()
and the other through constants. It also offers the utility function
uncolor(), which has to be explicitly imported to be used (see
"SYNOPSIS").
color() takes any number of strings as arguments and considers them
to be space-separated lists of attributes. It then forms and returns
the escape sequence to set those attributes. It doesn't print it
out, just returns it, so you'll have to print it yourself if you
want to (this is so that you can save it as a string, pass it to
something else, send it to a file handle, or do anything else with
it that you might care to).
uncolor() performs the opposite translation, turning escape sequences
into a list of strings.