I've been trying to understand Ruby on a deeper level, and deconstructing a boiler-plate rails app, seemed like a good way to understand some of the niceties and elegance of writing a Ruby app that spans different files and directories.
In my current app, the dependency on the 'requires' between files is becomming slightly problematic (I'm finding I need to do things like requires '../../../lib/helper' and its getting a bit ugly.
I noticed that rails apps don't seem to suffer from this.
I did notice the line:
require File.expand_path('../../config/environment', __FILE__) And when I Google it I find lots of explanation about the Rails boot-up routine, etc, but no clear description about what that line DOES exactly.
In my travels, I've also come along this line:
$:.push File.join(File.dirname(__FILE__)) I've been wondering if somehow these might be a potential solution to my problem. Can anyone please explain what they do exactly?