Technical
Require The Easy Way

How to require the easy(ruby) way.

I always had difficulty finding file for require, using ruby’s Dir.entries you can do the following:


Dir.entries(File.dirname(__FILE__) + "..")
=> [".", "..", ".svn", "authenticator"]

I could not show you this example fully, due to the literal misconseption of the instiki. But the idea is that if you cd to the folder from which the file is executed and use Dir.entries you will be able to figure out the full path, or at least see what irb sees there.

If you ask me, pretty readable.