Posted By

jccovey on 06/20/08


Tagged

files directory require scan


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

webstic


Scan and Require Ruby Files in Directory


 / Published in: Ruby
 

Requires all Ruby source files in a given directory.

  1. class Dir
  2. def self.require_all(directory)
  3. self.entries(directory).each do |file|
  4. if file =~ /\.rb/
  5. require directory + file
  6. end
  7. end
  8. end
  9. end

Report this snippet  

You need to login to post a comment.