Tips – Require all file in a folder

Posted by AllenWei | Posted in RubyOnRails, Tips | Posted on 15-02-2010-05-2008

View Comments




<br. No recursion
  $LOAD_PATH << File.join(File.dirname(__FILE__), '../app/drops')

Recursively

  Dir.glob(File.join(File.dirname(__FILE__), '../app/drops/*.rb')).each {|f| require f }


Ads Plugin created by Jake Ruston's Wordpress Plugins - Powered by and football database.