Merge: Apply optional params in strip_extension, basename and join
authorJean Privat <jean@pryen.org>
Mon, 20 Jul 2015 13:33:45 +0000 (09:33 -0400)
committerJean Privat <jean@pryen.org>
Mon, 20 Jul 2015 13:33:45 +0000 (09:33 -0400)
Using optional parameters, the methods `strip_extension`, `basename` and `join` have a default behavior that fit most usage.

* `Collection::join` appends all elements of the collection by default, the same as `join("")`. This is the old behavior of `Collection::to_s`.

* `String::strip_extension` removes the rightmost extension by default, the same as `s.strip_extension("." + s.file_extension)`.

* `String::basename` does not strip the extension by default.

I haven't updated any users of `strip_extension` because the default behavior requires more work. Thus changing the already existing calls to something else would slow down the programs by a very small margin.

Pull-Request: #1575
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>


Trivial merge