Project

General

Profile

Actions

Bug #2620

closed

Pathname#+ generates unexpected path when arg has leading /

Added by jondistad (Jon Distad) about 14 years ago. Updated almost 13 years ago.

Status:
Rejected
Assignee:
-
ruby -v:
ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-darwin10.2.0]
[ruby-core:27637]

Description

=begin
Pathname.new('/Users/username') + '/Desktop' #=> #Pathname:/Desktop

I would have expected it to return #Pathname:/Users/username/Desktop similar to the behavior of File.join.

I see that this behavior is documented in the code examples, but it is not explicitly mentioned. It is also semantically unusual to have a '+' method discard an operand.
=end

Actions #1

Updated by nobu (Nobuyoshi Nakada) about 14 years ago

  • Status changed from Open to Rejected

=begin
Expected behavior.
=end

Actions

Also available in: Atom PDF

Like0
Like0