Module: Kernel
- Defined in:
- lib/core_ext/kernel.rb
Instance Method Summary collapse
-
#require_all(path, relative_to: nil) ⇒ Object
Requires any ruby files in a given path.
Instance Method Details
#require_all(path, relative_to: nil) ⇒ Object
Requires any ruby files in a given path.
8 9 10 11 12 13 14 15 |
# File 'lib/core_ext/kernel.rb', line 8 def require_all(path, relative_to: nil) if rt = relative_to path = "#{File.dirname(rt)}/#{path}" end Dir.glob("#{path}/*.rb").each do |f| require f end end |