Friday, June 09, 2006

More Fun with RedGreen

Sean, the hacking partner mentioned in my announcement for RedGreen, seems to like it. This morning, he whipped up an 10 line patch (5 new lines, and 5 changed lines) to add RedGreen to autotest (part of the ZenTest package).

I originally wrote RedGreen in a fit of humor, but it looks like I may need to give it some more respect. I've gotten comments telling me how to add Win32 support and making a suggestion for improving it's ability to work better from within Rake. I've seen it on del.icio.us and ozmm.org. I've even seen google searches for it in my logs. I'll try to take an hour or two this weekend to do something nice for/to it, and send out a release on Monday.

Who'd have thought a silly little snippet of code would be so worthwhile? Next time, I'll try to take my little jokes more seriously.

11 comments:

Ryan Platte said...

Nah, keep joking. It's working for _why.

Sean said...

I told you we really needed it.

Sean said...

I'm missing something. How do I get Redgreen to work with autotest? I've installed both, but piping autotest through Redgreen doesn't work.

pate said...

Sean (the second one), RedGreen doesn't work with autotest yet. Sean (the other one) has put together an initial patch to autotest to make RedGreen work with it (autotest -c would invoke it). I'm going to be in Seattle this weekend, and plan on working with Eric to get RedGreen into autotest for anyone who wants to use it.

gordon said...

Thanks for this Pat.

I added this to to get it working on my windows machine:

require 'Win32/Console/ANSI' if PLATFORM =~ /win32/

Obviously, people will need to install for this to work.

Sean said...

Ahh! That would explain it. :) I'll keep an eye out, then. Thanks!

jakehow said...

Can you guys post a the patch so we can play around with it??

Anonymous said...

I'd LOVE to see RedGreen working with autotest. Please, please don't disregard it. That would make autotest even better and neater.

Anonymous said...

I use windowsXP.
I to work Redgreen,some steps need.
1.gem install win32console (gordon said before)
2.some dirty hack redgreen.rb.
line27 :@io.write(something)->print something
line46:Color.send($1.to_i != 0 || $2.to_i != 0 ? :red : :green, $&)->puts Color.send($1.to_i != 0 || $2.to_i != 0 ? :red : :green, $&).....insert command 'puts' top.
line54:old_long_display.sub('Failure', Color.red('Failure'))->print old_long_display.sub('Failure', Color.red('Failure'))
line61:old_long_display.sub('Error', Color.yellow('Error'))->print old_long_display.sub('Error', Color.yellow('Error'))

GlennFord said...

I love RedGreen for Autotest, but unfortunately lately I've run across a few bugs with it that cause autotest to crash with an error pointing to a RedGreen stacktrace. I have the latest gem of Autotest and RedGreen so I think I'm up to date, but I'm still having these problems:

1 - sometimes when I add new files/specs
2 - when I run with --format html instead of --format progress

Additionally, when I run with --format html and redgreen turned on, if at least one spec fails, autotest keeps running non-stop.

To fix all 3 of these issues, I changed a single line in redgreen.rb line 8:
if at.results.last.match(/^.* (\d+) failures, (\d+) errors$/)
to
if at.results.last && at.results.last.match(/^.* (\d+) failures, (\d+) errors$/)

Super simple, but it fixed all of my issues. Hopefully you can put it in a new gem soon so everyone can get it. Aside from that, thanks for making RedGreen!

GlennFord said...

Apparently fixing the unending autotest loop wasn't fixed in my change and it was only a fluke that it stopped for me briefly after making this edit. That bug is still at large, but my change still fixes the other 2 mentioned issues. Hopefully I'll track down the other problem soon, too!