From: Scott Gonyea Date: 2012-02-22T10:35:53+09:00 Subject: [ruby-core:42790] [ruby-trunk - Bug #6057] URI - Nonsensical Behavior Issue #6057 has been updated by Scott Gonyea. Agh, I copied the wrong output from irb, for the second one. Both results should be the same. ---------------------------------------- Bug #6057: URI - Nonsensical Behavior https://bugs.ruby-lang.org/issues/6057 Author: Scott Gonyea Status: Open Priority: Normal Assignee: Category: lib Target version: ruby -v: 1.9.3-p125 The behavior of Ruby's URI is confusing, to say the least. URI("http://foo.com/bar") + "baz" # => # URI.join("http://foo.com/baz", "bar") # => # I could at least understand this behavior being the case if we were adding "/bar" (although it'd still be non-intuitive). That URI throws away its current path makes it a tedious library. Net::HTTP expects it as an input, yet as you interact with URI, you are constantly massaging it into and out of string form. In my opinion, URI should model the behavior of Pathname. -- http://bugs.ruby-lang.org/