Is there a simpler way to get the absolute path of the current script?
path = File.dirname(File.expand_path(__FILE__))
Under some circumstances (like, you haven't changed the working
directory, and you can ensure that the working directory is the same as
the script) Dir.pwd might be all you need, right?
From: Joe Ruby MUDCRAP-CE