Module: ActiveSupport::Dependencies
- Defined in:
- lib/erector/rails/autoload_monkeypatch.rb
Instance Method Summary collapse
Instance Method Details
#search_for_file(path_suffix) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/erector/rails/autoload_monkeypatch.rb', line 4 def search_for_file(path_suffix) path_suffix = path_suffix.sub(/(\.rb)?$/, ".rb") underscored_path_suffix = path_suffix.gsub(/\/([\w\.]*$)/, '/_\1') autoload_paths.each do |root| path = File.join(root, path_suffix) return path if File.file? path upath = File.join(root, underscored_path_suffix) return upath if File.file? upath end nil # Gee, I sure wish we had first_match ;-) end |