=begin
Luis Lavena wrote:
On Wed, Nov 4, 2009 at 6:59 PM, Yukihiro Matsumoto matz@ruby-lang.org wrote:
Hi,
In message "Re: [ruby-core:26540] [Bug #2336] pathname compare fails in windows"
on Thu, 5 Nov 2009 04:48:46 +0900, Roger Pack redmine@ruby-lang.org writes:
|>> Pathname.new('c:/').relative_path_from Pathname.new('/')
|ArgumentError: different prefix: "c:/" and "/"
Could you tell me what did you expect from above code?
For me, Windows ignorant, the error seems natural consequence from
#relative_path_from.
Even Pathname2 [1], which was conceived as more Windows-friendly
version fails with the same error
I try not to be smarter than the Windows API. From the
PathRelativePathTo() documentation:
This function takes a pair of paths and generates a relative path from
one to the other. The paths do not have to be fully-qualified, but they
must have a common prefix, or the function will fail and return FALSE.
The problem is that '/' should be considering the same drive unit as
C:/, or should be considering the current one? (Dir.pwd)
Why C? Why not ENV['HOMEDRIVE']? Or the root of the current user's home
directory? Or...well, you see where I'm going with this.
Regards,
Dan
=end