From: Robert Klemme Date: 2007-08-15T16:14:57+09:00 Subject: Re: Does an Array#apply make any sense at all? 2007/8/15, nikolai.weibull@gmail.com : > On Aug 14, 8:32 pm, Eric Hodel wrote: > > > On Aug 14, 2007, at 04:40, nikolai.weib...@gmail.com wrote: > > > > On Aug 14, 11:50 am, Eric Hodel wrote: > > > > > Is there something wrong with Pathname#==? > > > > Yes, not that it can't be fixed, but the current definition is sort of > > > broken (on all systems): > > > Could you file a bug on the Ruby tracker? (Or has it been fixed?) > > Well, the documentation is pretty clear about what it does. Even > though I'd considered it bugged. Perhaps the semantics of Pathname#== > should be clarified before we post any change suggestions. > > So, should Pathname#== respect the platforms case insensitivity, for > example, on Windows and on Mac OS? > > Should Pathname#== try hard to make sure that both arguments are as > complete and clean as possible, for example, by calling > Pathname#expand_path on both arguments? This would have to take into > account that Pathname#== currently has taken any argument that > responds to #to_s. I dislike this kind of automation behind the scenes because there may be situations where you do not want this behavior. Also keep in mind that ultimately a safe comparison needs to access the file system which has a significant performance impact. I'd prefer either a method like #normalize which does all the necessary transformations which enable == to compare for identical file system paths or add a method that does the comparison explicitly. Maybe #realpath can be adjusted to deliver this. Just my 0.02EUR... Kind regards robert