--0016e6475cfc7e6f41046b443372
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

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  athname('/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
>
>

--0016e6475cfc7e6f41046b443372
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

FWIW, there is a precedent: man 1 basename .It was no doubt modelled after this.<br><br>I agree a more intention-revealing name would be desirable.<br><br>George.<br><br><div class="gmail_quote">On Mon, Jun 1, 2009 at 2:29 AM, Martin DeMello <span dir="ltr">&lt;<a href="mailto:martindemello / gmail.com" target="_blank">martindemello / gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>On Mon, Jun 1, 2009 at 6:11 AM, Michael Fellinger &lt;<a href="mailto:m.fellinger / gmail.com" target="_blank">m.fellinger / gmail.com</a>&gt; wrote:<br>


&gt; require &#39;pathname&#39;<br>
&gt;<br>
&gt; fn = Pathname(&#39;/a/b/c/d.e&#39;)<br>
&gt; # #&lt;Pathname:/a/b/c/d.e&gt;<br>
&gt;<br>
&gt; fn.dirname + fn.basename(&#39;.*&#39;)<br>
&gt; # #&lt;Pathname:/a/b/c/d&gt;<br>
<br>
</div>Passing a suffix to basename is pretty unintuitive - I&#39;d never have<br>
thought to look there. File.split (and/or Pathname#split) seems a lot<br>
cleaner to me.<br>
<font color="#888888"><br>
martin<br>
<br>
</font></blockquote></div><br>

--0016e6475cfc7e6f41046b443372--