Skip to content

Instantly share code, notes, and snippets.

@choonkeat
Created January 28, 2009 22:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save choonkeat/54233 to your computer and use it in GitHub Desktop.
Save choonkeat/54233 to your computer and use it in GitHub Desktop.
# Modified from http://errtheblog.com/posts/50-vendor-everything
Dir["#{File.join(File.dirname(__FILE__), '..')}/vendor/gems/**"].map do |dir|
require_paths_file = File.join(dir, ".require_paths")
paths = File.exists?(require_paths_file) ?
IO.read(require_paths_file).split(/[\r\n]+/).collect {|subdir| File.join(dir, subdir) } :
[(File.directory?(lib = "#{dir}/lib") ? lib : dir)]
$LOAD_PATH.unshift(*paths)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment