From: Alex Young Date: 2011-11-14T19:53:31+09:00 Subject: [ruby-core:41014] Re: [ruby-trunk - Feature #5628] Module#basename On 14/11/11 10:19, Benoit Daloze wrote: > On 14 November 2011 07:32, Andrew Grimm wrote: >> >> Issue #5628 has been updated by Andrew Grimm. >> >> >> I'm not sure about the method name. What should happen with File::basename ? Should it call super when there's no arguments, and do its own thing when called with an argument? I'd prefer Ruby to tell me that I forgot to pass in a string! > > I also agree this would be useful. > But the name 'basename' is probably not the best. > I remember I used simple_name for this, but it's not appealing. > I like this - I use .split("::").last all over the place. A few alternatives, since I agree it would be unfortunate to overload .basename: .inner_name .last_name .primary_name .name( false ) .name( :full => false ) -- Alex