On Aug 14, 11:50 am, Eric Hodel <drbr... / segment7.net> wrote:
> On Aug 14, 2007, at 02:40, nikolai.weib... / gmail.com wrote:
>
> > I wanted to write a simple method for comparing two paths on a Windows
> > system.
>
> 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):

  #
  # Compare this pathname with +other+.  The comparison is string-
based.
  # Be aware that two different paths (<tt>foo.txt</tt> and <tt>./
foo.txt</tt>)
  # can refer to the same file.
  #
  def ==(other)
    return false unless Pathname === other
    other.to_s == @path
  end
  alias === ==
  alias eql? ==

  nikolai