ruby - Is require File.expand_path(..., __FILE__) the best practice? -


is require file.expand_path(..., __file__) best way require other files within project?

in ruby 1.9.2 + require_relative more correct way it.

require changed not include '.' directory security reasons. require_relative added provide local-file solution modules relative calling script's path.

you can search here on stackoverflow, particularly in "what require_relative in ruby?", , internets , find usage tricks , why-for messages explaining how came about.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -