Project

General

Profile

Bug #15564

Pathname#+(pathpart) returns pathpart when pathpart is absolute

Added by Malakai97 (Bryan Hockey) 25 days ago. Updated 21 days ago.

Status:
Open
Priority:
Normal
Target version:
-
ruby -v:
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]
[ruby-core:91268]

Description

abs = Pathname.new("/abs/dir")
my = Pathname.new("/my/path")

# actual
my/abs # => #<Pathname:/abs/dir>

# expected
my/abs # => #<Pathname:/my/dir/abs/dir>

While this behavior is desirable in #expand_path, here I believe it is very surprising.

I am happy to submit a patch for this should it be confirmed as a bug.

History

Updated by Malakai97 (Bryan Hockey) 25 days ago

Also affects #/
Also affects #join

Updated by znz (Kazuhiro NISHIYAMA) 21 days ago

  • Assignee set to akr (Akira Tanaka)

Also available in: Atom PDF