def const_path_defined?(name) if name[0,2] == "::" then current = Object pieces = name[2,(name.length - 2)].split("::") else current = self pieces = name.split("::") end while current const = current found = pieces.all? do |piece| piece = normalize_const_name(piece) const = const.constants_table[piece] const end return true if found current = current.direct_superclass end return false end