[ruby-core:63923] Re: [ruby-trunk - Bug #10075] URI#join needs documentation of its behavior

From: Avdi Grimm <avdi@...>
Date: 2014-07-21 23:45:16 UTC
List: ruby-core #63923
On Mon, Jul 21, 2014 at 10:40 AM, <[email protected]> wrote:

> Here's my thoughts on this: every other Ruby method I can think of named
> `#join` works by concatenating its arguments together with a separator
> (possibly with some additional logic to remove redundant separators and
> such).
>

This has caught me by surprise multiple times as well. I don't question the
need for a method with these semantics, but the choice of name "join" seems
misleading. Too late to change it now, but I wouldn't mind seeing it
aliased to a less surprising name (perhaps "#merge_path", per RFC3986) and
the "join" version eventually deprecated.

In This Thread

Prev Next