loadable_constants_for_path(path, bases = autoload_paths)
public
Given path, a filesystem path to a ruby file, return an array of
constant paths which would cause Dependencies to attempt to load this file.
# File activesupport/lib/active_support/dependencies.rb, line 350
def loadable_constants_for_path(path, bases = autoload_paths)
path = $` if path =~ /\.rb\z/
expanded_path = File.expand_path(path)
paths = []
bases.each do |root|
expanded_root = File.expand_path(root)
next unless %{\A#{Regexp.escape(expanded_root)}(/|\\)} =~ expanded_path
nesting = expanded_path[(expanded_root.size)..-1]
nesting = nesting[1..-1] if nesting && nesting[0] == //
next if nesting.blank?
paths << nesting.camelize
end
paths.uniq!
paths
end