On May 30, 2006, at 12:55 AM, Daniel Berger wrote: > Daniel Berger wrote: >> transfire / gmail.com wrote: > > <snip> > >>> More importantly, I think it would be nice if there were a >>> shorter way >>> to define a path, perhaps a percent literal like %p{a/b}. >> Good idea. I'm stealing it for pathname2. :) > > Well, I would have stolen it, except that I forgot that there's no > way to define % literals in Ruby 1.8 afaik. I'm not sure about 1.9. > > Related RCR: http://www.rcrchive.net/rcr/show/279 > > Regards, > > Dan > > Well, is this close enough? module Kernel def pn(s) Pathname.new(s) end end pn %{a/b} It almost looks like a % literal.