You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
devdocs/lib/docs/core/autoload_helper.rb

11 lines
276 B

module Docs
module AutoloadHelper
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
end
end