From: Josh Cheek Date: 2011-06-12T18:59:57+09:00 Subject: Re: RFC - One word alias for require_relative --0016e644c7305d7fd204a580dd59 Content-Type: text/plain; charset=ISO-8859-1 Back in the blissful days before I understood the `$LOAD_PATH` or the difference between `Dir.pwd` and `File.dirname(__FILE__)`, I could `require "file"` and it would work (unless I was in another dir). `require_relative` isn't universally implemented, and doesn't seem to play well with others. It's just generally been unavailable / not worked right for me to the point that I prefer to use `File.dirname(__FILE__) + "/file"` What if, instead of having CWD in the load path, we had `File.dirname(__FILE__)`? Essentially, CWD of the file that the require statement is originated through. In the same way that every file has its own `__FILE__` variable, what if the `$LOAD_PATH` included the current file's dir, for any given file? Then the old interface would work again, it would be simpler to think about, security risks of CWD in the load path would be addressed, and most importantly, I could write beautiful code again (I die a little bit inside each time I write __FILE__). Of course, I have no idea if it's even possible, and it's not immediately clear to me how it would affect gems. Still, thought I'd put it out there. --0016e644c7305d7fd204a580dd59--