Feature #7412

Pathname#relative_path_from does not support mixed directory separators on windows

Added by Syver Enstad about 3 years ago. Updated almost 2 years ago.

Assignee:Akira Tanaka


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")

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")

=> #<Pathname:../../..>


#1 Updated by Yusuke Endoh about 3 years ago

  • Assignee set to Akira Tanaka
  • Status changed from Open to Assigned
  • Target version set to 2.0.0

#2 Updated by Yusuke Endoh almost 3 years ago

  • Tracker changed from Bug to Feature

Looks a feature request.

Yusuke Endoh mame@tsg.ne.jp

#3 Updated by Koichi Sasada almost 3 years ago

ping -> akr

#4 Updated by Koichi Sasada almost 3 years ago

  • Target version changed from 2.0.0 to 2.1.0

#5 Updated by Hiroshi SHIBATA almost 2 years ago

  • Target version changed from 2.1.0 to current: 2.2.0

Also available in: Atom PDF