提交 45ba4ec6 编写于 作者: M Matt Jones 提交者: David Heinemeier Hansson

add vendor/ back to load paths; catch errors in constant loading

Signed-off-by: NDavid Heinemeier Hansson <david@loudthinking.com>
上级 12118963
......@@ -485,6 +485,7 @@ def new_constants_in(*descs)
# Build the watch frames. Each frame is a tuple of
# [module_name_as_string, constants_defined_elsewhere]
watch_frames = descs.collect do |desc|
begin
if desc.is_a? Module
mod_name = desc.name
initial_constants = desc.local_constant_names
......@@ -500,9 +501,12 @@ def new_constants_in(*descs)
else
raise Argument, "#{desc.inspect} does not describe a module!"
end
[mod_name, initial_constants]
rescue NameError
# mod_name isn't a valid constant name
nil
end
end.compact
constant_watch_stack.concat watch_frames
......
......@@ -901,6 +901,7 @@ def default_load_paths
components
config
lib
vendor
).map { |dir| "#{root_path}/#{dir}" }.select { |dir| File.directory?(dir) }
paths.concat builtin_directories
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册