On 10/30/06, Robert Klemme <shortcutter / googlemail.com> wrote:

> I played around already :-)
>
> def find_dir
>    caller.each do |cl|
>      if %r{^(.*):\d+(?::in )?$} =~ cl
>        f = $1
>        return File.dirname(f) if f != __FILE__
>      end
>    end
>    raise "Not found"
> end
>

Very nice.

I realized after I posted that ':' could be a valid character in a
filename, so my above try at it won't work anyway.

-- 
Lou.