From: Bob Hutchison Date: 2010-11-29T23:12:33+09:00 Subject: Re: [ANN] relative-require v1.0 On 2010-11-27, at 1:02 PM, James Edward Gray II wrote: > On Nov 27, 2010, at 11:34 AM, Bob Hutchison wrote: > >> On 2010-11-27, at 7:48 AM, Urabe Shyouhei wrote: >> >>> Why don't you use require_relative which is a standard ruby feature? >> >> Is it? > > Yes. It was added in Ruby 1.9. > >> And it isn't documented on ruby-doc.org, so... > > Here's the documentation from the Pickaxe: Thanks James. Is there online documentation for Ruby that's complete? I know, for a fact, that there's a bunch of experienced Ruby developers who've never heard of this particular method. And of course, I'm curious what else is in those extensions. Cheers, Bob > > Requires a library whose path is relative to the file containing the call. Thus, if the directory 1.9 /usr/local/mylib/bin contains the file myprog.rb and that program contains the following line: > > require_relative "../lib/mylib" > > then Ruby will look for mylib in /usr/local/mylib/lib. require_relative cannot be called interactively in irb. > > James Edward Gray II ---- Bob Hutchison Recursive Design Inc. http://www.recursive.ca/ weblog: http://xampl.com/so