public Method

Dependencies.search_for_file(path_suffix)

Search for a file in load_paths matching the provided suffix.

Source Code

# File active_support/dependencies.rb, line 153
def search_for_file(path_suffix)
  path_suffix = path_suffix + '.rb' unless path_suffix.ends_with? '.rb'
  load_paths.each do |root|
    path = File.join(root, path_suffix)
    return path if File.file? path
  end
  nil # Gee, I sure wish we had first_match ;-)
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.