load_application_classes requires files relative to the load path and without .rb extension, including .rb files in subdirectories

This commit is contained in:
Jeremy Kemper
2008-07-31 16:35:17 -07:00
parent 2617d0dc5c
commit a540725f0d

View File

@@ -349,8 +349,9 @@ Run `rake gems:install` to install the missing gems.
def load_application_classes
if configuration.cache_classes
configuration.eager_load_paths.each do |load_path|
Dir.glob("#{load_path}/*.rb").each do |file|
require_dependency file
matcher = /\A#{Regexp.escape(load_path)}(.*)\.rb\Z/
Dir.glob("#{load_path}/**/*.rb").each do |file|
require_dependency file.sub(matcher, '\1')
end
end
end