This post originated from an RSS feed registered with Ruby Buzz
by Daniel Berger.
Original Post: This is what I mean by "Refactoring"
Feed Title: Testing 1,2,3...
Feed URL: http://djberg96.livejournal.com/data/rss
Feed Description: A blog on Ruby and other stuff.
Continuing work on Sapphire, I was going over the win32.c file (which is chock full of warnings, I might add), and I said to myself, "Self, what the fuck is this custom rb_w32_stat code for? Windows supports the stat function. Shouldn't the base code Just Work (TM)?".
So, I ripped it out, rebuilt the source using the stock file.c code, ran my own File::Stat test suite (about 500 tests) and, after all was said and done, there was one test failure. The mode. Because of a custom bitwise operator that MRI applies to the result. Easily fixed.
But, I'm still not satisfied. The File::Stat code is, as I believe I've blogged about before, pretty messy stuff, and it needs to be separated into its own source file and reworked, both for ease of maintenance & coding, as well as my own sanity.
In other news Heesob is working on an updated Kernel#select, but the initial attempt has some sort of bug. Which we spotted. Because, you know, tests. Actually, it was the Test::Unit test runner itself that revealed the bug. I have faith he'll work it out.