From: Logan Capaldo Date: 2006-07-07T11:20:10+09:00 Subject: Re: Easy Pathname On Jul 6, 2006, at 6:39 PM, transfire@gmail.com wrote: > I find myself always using File.join, and never utilizing Pathname b/c > it's not as convenient to construct. This snippet occured to me to > make > it more paletable: > > class String > def /(dir) > Pathname.new( File.join(self,dir) ) > end > end > > class Pathname > def /(dir) > join(dir) > end > end > > path = '' / 'usr' / 'local' #=> # > > Good idea? Improvements? Better alternatives? > > T. > > It's neat but I've always thought that this should be the definition of String#/: class String alias_method :/, :split end