autotest, unit-diff, and color output?

R

Rob Sanheim

I'm using autotest with all its test driven goodness, and I believe
that uses unit-diff to present a "saner" view of test difference
output.

I'd like to do colorize the output from unit-diff so its similar to
what you see on a changeset on trac, for instance. Does anyone know
anything that can colorize diffs in ruby, or know of a good starting
point? Or at least where to start for outputting color in the
terminal, so I can do "#{color.red} stuff" instead of using control
characters.

thanks,
Rob
 
T

Trans

Rob said:
I'm using autotest with all its test driven goodness, and I believe
that uses unit-diff to present a "saner" view of test difference
output.

I'd like to do colorize the output from unit-diff so its similar to
what you see on a changeset on trac, for instance. Does anyone know
anything that can colorize diffs in ruby, or know of a good starting
point? Or at least where to start for outputting color in the
terminal, so I can do "#{color.red} stuff" instead of using control
characters.

you can try facets' ansicode lib written primarily by Florian Frank.

t.
 
E

Eric Hodel

I'm using autotest with all its test driven goodness, and I believe
that uses unit-diff to present a "saner" view of test difference
output.

It does.
I'd like to do colorize the output from unit-diff so its similar to
what you see on a changeset on trac, for instance. Does anyone know
anything that can colorize diffs in ruby, or know of a good starting
point? Or at least where to start for outputting color in the
terminal, so I can do "#{color.red} stuff" instead of using control
characters.

The easiest way to do this is to write (or find) a color-capable diff
executable. This way you don't have to change unit_diff, just your
path.
 
R

Rob Sanheim

The easiest way to do this is to write (or find) a color-capable diff
executable. This way you don't have to change unit_diff, just your
path.

Thanks for the responses everyone. Some quick google searches didn't
turn up any drop in color replacements for diff, though I did find it
as a feature request submitted for diff, but way to recently for any
code to be written yet.

- Rob
 
M

Martin DeMello

Thanks for the responses everyone. Some quick google searches didn't
turn up any drop in color replacements for diff, though I did find it
as a feature request submitted for diff, but way to recently for any
code to be written yet.

$ esearch colordiff
[ Results for search key : colordiff ]
[ Applications found : 1 ]

* app-misc/colordiff
Latest version available: 1.0.5-r2
Latest version installed: 1.0.5-r2
Size of downloaded files: 41 kB
Homepage: http://colordiff.sourceforge.net/
Description: Colorizes output of diff
License: GPL-2

martin
 
R

Rob Sanheim

$ esearch colordiff
[ Results for search key : colordiff ]
[ Applications found : 1 ]

* app-misc/colordiff
Latest version available: 1.0.5-r2
Latest version installed: 1.0.5-r2
Size of downloaded files: 41 kB
Homepage: http://colordiff.sourceforge.net/
Description: Colorizes output of diff
License: GPL-2

martin

Thanks, apparently I should've searched on one word instead of "color diff". :)

- rob
 
M

Martin DeMello

$ esearch colordiff
[ Results for search key : colordiff ]
[ Applications found : 1 ]

Thanks, apparently I should've searched on one word instead of "color diff". :)

It's easier when you know it's there :) I found it the first time by
searching for 'diff' in the portage tree

martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top