def loadable_constants_for_path(path, bases = load_paths)
      path = $1 if path =~ /\A(.*)\.rb\Z/
      expanded_path = File.expand_path(path)

      bases.collect do |root|
        expanded_root = File.expand_path(root)
        next unless %r{\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?
        nesting_camel = nesting.camelize
        begin
          qualified_const_defined?(nesting_camel)
        rescue NameError
          next
        end
        [ nesting_camel ]
      end.flatten.compact.uniq
    end
def loadable_constants_for_path(path, bases = load_paths)
      path = $1 if path =~ /\A(.*)\.rb\Z/
      expanded_path = File.expand_path(path)

      bases.collect do |root|
        expanded_root = File.expand_path(root)
        next unless %r{\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?
        nesting_camel = nesting.camelize
        begin
          qualified_const_defined?(nesting_camel)
        rescue NameError
          next
        end
        [ nesting_camel ]
      end.flatten.compact.uniq
    end
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.