Created
April 8, 2011 17:48
-
-
Save cowboycoded/910361 to your computer and use it in GitHub Desktop.
eager_load! method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/railties-3.0.5/lib/rails/engine.rb | |
def eager_load! | |
config.eager_load_paths.each do |load_path| | |
matcher = /\A#{Regexp.escape(load_path)}\/(.*)\.rb\Z/ | |
Dir.glob("#{load_path}/**/*.rb").sort.each do |file| | |
require_dependency file.sub(matcher, '\1') | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment