public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
add vendor/ back to load paths; catch errors in constant loading

Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
al2o3cr (author)
Mon Nov 17 11:03:46 -0800 2008
dhh (committer)
Tue Nov 18 05:32:46 -0800 2008
commit  45ba4ec626b79dda8534f13b3eb01524e0734781
tree    84bccc98fa97cb7bfb5244bbd1c0890315b99d32
parent  12118963acacc9c869bdd41ef8480a1a4e06d358
...
485
486
487
488
489
490
491
492
493
494
495
496
 
 
 
 
 
 
 
 
 
 
 
 
 
497
498
 
499
500
501
 
 
 
 
502
503
504
505
 
506
507
508
...
485
486
487
 
 
 
 
 
 
 
 
 
488
489
490
491
492
493
494
495
496
497
498
499
500
501
 
502
503
 
 
504
505
506
507
508
 
 
 
509
510
511
512
0
@@ -485,24 +485,28 @@ module ActiveSupport #:nodoc:
0
       # Build the watch frames. Each frame is a tuple of
0
       #   [module_name_as_string, constants_defined_elsewhere]
0
       watch_frames = descs.collect do |desc|
0
-        if desc.is_a? Module
0
-          mod_name = desc.name
0
-          initial_constants = desc.local_constant_names
0
-        elsif desc.is_a?(String) || desc.is_a?(Symbol)
0
-          mod_name = desc.to_s
0
-
0
-          # Handle the case where the module has yet to be defined.
0
-          initial_constants = if qualified_const_defined?(mod_name)
0
-            mod_name.constantize.local_constant_names
0
+        begin
0
+          if desc.is_a? Module
0
+            mod_name = desc.name
0
+            initial_constants = desc.local_constant_names
0
+          elsif desc.is_a?(String) || desc.is_a?(Symbol)
0
+            mod_name = desc.to_s
0
+
0
+            # Handle the case where the module has yet to be defined.
0
+            initial_constants = if qualified_const_defined?(mod_name)
0
+              mod_name.constantize.local_constant_names
0
+            else
0
+              []
0
+            end
0
           else
0
-           []
0
+            raise Argument, "#{desc.inspect} does not describe a module!"
0
           end
0
-        else
0
-          raise Argument, "#{desc.inspect} does not describe a module!"
0
+          [mod_name, initial_constants]
0
+        rescue NameError
0
+          # mod_name isn't a valid constant name
0
+          nil
0
         end
0
-
0
-        [mod_name, initial_constants]
0
-      end
0
+      end.compact
0
 
0
       constant_watch_stack.concat watch_frames
0
 
...
901
902
903
 
904
905
906
...
901
902
903
904
905
906
907
0
@@ -901,6 +901,7 @@ Run `rake gems:install` to install the missing gems.
0
           components
0
           config
0
           lib
0
+          vendor
0
         ).map { |dir| "#{root_path}/#{dir}" }.select { |dir| File.directory?(dir) }
0
 
0
         paths.concat builtin_directories

Comments