Best way to require all files from a directory in ruby?

Gaetan Dubar picture Gaetan Dubar · Apr 9, 2009 · Viewed 176.2k times · Source

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

Answer

Sam Stokes picture Sam Stokes · Apr 9, 2009

How about:

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