Module: Docs::AutoloadHelper

Included in:
Docs
Defined in:
lib/docs/core/autoload_helper.rb

Instance Method Summary collapse

Instance Method Details

#autoload_all(path, suffix = '') ⇒ Object


3
4
5
6
7
8
# File 'lib/docs/core/autoload_helper.rb', line 3

def autoload_all(path, suffix = '')
  Dir["#{Docs.root_path}/#{path}/**/*.rb"].each do |file|
    name = File.basename(file, '.rb') + (suffix ? "_#{suffix}" : '')
    autoload name.camelize, file
  end
end