Created
July 7, 2010 07:52
-
-
Save skorks/466442 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#recursively require all files in directory (and subdirectories) | |
Dir["#{File.dirname(__FILE__)}/squat/**/*.rb"].each {|file| require file } | |
#recursively require all files in directory but skip paths that match a pattern | |
Dir["#{File.dirname(__FILE__)}/squat/**/*.rb"].each do |file| | |
require file unless file =~ /\/model\// | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://sharshunblog.wordpress.com/2016/11/28/programming-ruby-how-to-recursively-require-all-ruby-files/