Is it possible to recursively require all files in a directory in Ruby? -
I am working on an API for which all .rb files must be loaded in their current directory and all subdirectories. Currently, I am entering a new requirement for every file I add, but I want to create it where I only have to put one of the sub-directories and it will be automatically added. .
Is there a standard order to do this?
In this case, all the files are being loaded under the lib directory:
< Pre> Dir ["# {File.dirname (__ file __)} / lib / ** / *. Rb"]. Each {| F | Load (F)}
Comments
Post a Comment