What were they thinking?
I think Ruby is a much better language than Perl, but it’s definitely true that the libraries aren’t as mature. Here’s a problem that has just annoyed me for the second time.
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.