From: shibata.hiroshi@... Date: 2014-01-30T06:16:41+00:00 Subject: [ruby-core:60269] [ruby-trunk - Feature #7412] Pathname#relative_path_from does not support mixed directory separators on windows Issue #7412 has been updated by Hiroshi SHIBATA. Target version changed from 2.1.0 to current: 2.2.0 ---------------------------------------- Feature #7412: Pathname#relative_path_from does not support mixed directory separators on windows https://bugs.ruby-lang.org/issues/7412#change-44750 * Author: Syver Enstad * Status: Assigned * Priority: Normal * Assignee: Akira Tanaka * Category: lib * Target version: current: 2.2.0 ---------------------------------------- =begin The support for mixing backslashes and forward slashes in the pathname module in the standard library seems to be broken on windows require 'pathname' base = Pathname.new("c:\\") filepath = Pathname.new("c:/foo/bar/file.ext") base.relative_path_from(filepath) raises `ArgumentError: different prefix: "c:\\" and "c:/foo/bar/file.ext"` Changing filepath to contain backslashes fixes the problem filepath = Pathname.new("c:\\foo\\bar\\file.ext") base.relative_path_from(filepath) `=> #` =end -- http://bugs.ruby-lang.org/