FWIW, there is a precedent: man 1 basename .  It was no doubt modelled after
this.

I agree a more intention-revealing name would be desirable.

George.

On Mon, Jun 1, 2009 at 2:29 AM, Martin DeMello <martindemello / gmail.com>wrote:

> On Mon, Jun 1, 2009 at 6:11 AM, Michael Fellinger <m.fellinger / gmail.com>
> wrote:
> > require 'pathname'
> >
> > fn = Pathname('/a/b/c/d.e')
> > # #<Pathname:/a/b/c/d.e>
> >
> > fn.dirname + fn.basename('.*')
> > # #<Pathname:/a/b/c/d>
>
> Passing a suffix to basename is pretty unintuitive - I'd never have
> thought to look there. File.split (and/or Pathname#split) seems a lot
> cleaner to me.
>
> martin
>
>