Ruby – Best way to require all files from a directory in ruby

directoryfilerequireruby

What's the best way to require all files from a directory in ruby ?

Best Answer

How about:

Dir["/path/to/directory/*.rb"].each {|file| require file }