| « March 2010 | ||||||
| S | M | T | W | T | F | S |
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 | |||
About an hour ago, I saw Rael Dornfest's musings on Python. As I read it, I thought to myself, "Sounds like Rael would really like Ruby," but didn't think any more about it.
But just now NNW updated Chad Fowler's blog, and I see that Chad thought exactly the same thing! Rael, if one more person had the same thought, I think you're bound to give Ruby a try.
(Of course, I'm not sure this is really that significant; after all, every language bigot always thinks, "Oh, <my favorite language> would be perfect for that!" at the least provocation. But I've seen Rael's Perl code, and he really does need to give Ruby a try. And the source to RubLog might be a great place to start. :-)
All of the creation methods for the Time class take similar arguments, exemplified here by the Time.local method:
Time.local(year [, month, day, hour, min, sec, usec])
But the ParseDate::parsedate method that does a good job of parsing date information out of human-readable strings returns this array:
[year, mon, mday, hour, min, sec, zone, wday]
You really should be able to type Time.local(*ParseDate::parsedate(timeString)) but you can't. You've got to chop the last two elements off the array first. That's not hard in Ruby, but still ...
So far as I know, there may already be a remedy for this in CVS. But there really ought to be a Time.parsedate(aString) method that does the right thing.