1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
This commit is contained in:
Matt Jones 2008-11-17 14:03:46 -05:00 committed by David Heinemeier Hansson
parent 12118963ac
commit 45ba4ec626
2 changed files with 19 additions and 14 deletions

View file

@ -485,24 +485,28 @@ module ActiveSupport #:nodoc:
# Build the watch frames. Each frame is a tuple of
# [module_name_as_string, constants_defined_elsewhere]
watch_frames = descs.collect do |desc|
if desc.is_a? Module
mod_name = desc.name
initial_constants = desc.local_constant_names
elsif desc.is_a?(String) || desc.is_a?(Symbol)
mod_name = desc.to_s
begin
if desc.is_a? Module
mod_name = desc.name
initial_constants = desc.local_constant_names
elsif desc.is_a?(String) || desc.is_a?(Symbol)
mod_name = desc.to_s
# Handle the case where the module has yet to be defined.
initial_constants = if qualified_const_defined?(mod_name)
mod_name.constantize.local_constant_names
# Handle the case where the module has yet to be defined.
initial_constants = if qualified_const_defined?(mod_name)
mod_name.constantize.local_constant_names
else
[]
end
else
[]
raise Argument, "#{desc.inspect} does not describe a module!"
end
else
raise Argument, "#{desc.inspect} does not describe a module!"
[mod_name, initial_constants]
rescue NameError
# mod_name isn't a valid constant name
nil
end
[mod_name, initial_constants]
end
end.compact
constant_watch_stack.concat watch_frames

View file

@ -901,6 +901,7 @@ Run `rake gems:install` to install the missing gems.
components
config
lib
vendor
).map { |dir| "#{root_path}/#{dir}" }.select { |dir| File.directory?(dir) }
paths.concat builtin_directories