Changeset 4769
- Timestamp:
- 08/16/06 09:18:17 (2 years ago)
- Files:
-
- trunk/activesupport/CHANGELOG (modified) (1 diff)
- trunk/activesupport/lib/active_support/dependencies.rb (modified) (1 diff)
- trunk/activesupport/test/autoloading_fixtures/class_folder (added)
- trunk/activesupport/test/autoloading_fixtures/class_folder.rb (added)
- trunk/activesupport/test/autoloading_fixtures/class_folder/inline_class.rb (added)
- trunk/activesupport/test/autoloading_fixtures/class_folder/nested_class.rb (added)
- trunk/activesupport/test/autoloading_fixtures/module_folder/inline_class.rb (added)
- trunk/activesupport/test/autoloading_fixtures/module_folder/nested_class.rb (modified) (1 diff)
- trunk/activesupport/test/dependencies_test.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activesupport/CHANGELOG
r4760 r4769 1 1 *SVN* 2 3 * Dependencies can autoload directories of nested classes. [Jeremy Kemper] 4 Example: 5 invoice.rb class Invoice 6 invoice/lineitem.rb class Invoice::Lineitem 2 7 3 8 * Add Deprecation.silence so that Reloadable does not scold itself. [Nicholas Seckar] trunk/activesupport/lib/active_support/dependencies.rb
r4754 r4769 283 283 else 284 284 begin 285 parent.send :const_missing, class_id 285 begin 286 Dependencies.load_missing_constant self, class_id 287 rescue NameError 288 parent.send :const_missing, class_id 289 end 286 290 rescue NameError => e 287 291 # Make sure that the name we are missing is the one that caused the error trunk/activesupport/test/autoloading_fixtures/module_folder/nested_class.rb
r4060 r4769 1 class ModuleFolder::NestedClass 1 module ModuleFolder 2 class NestedClass 3 end 2 4 end trunk/activesupport/test/dependencies_test.rb
r4730 r4769 126 126 end 127 127 128 def test_directories_ should_manifest_as_modules128 def test_directories_manifest_as_modules_unless_const_defined 129 129 with_loading 'autoloading_fixtures' do 130 130 assert_kind_of Module, ModuleFolder … … 133 133 end 134 134 135 def test_ nested_class_access135 def test_module_with_nested_class 136 136 with_loading 'autoloading_fixtures' do 137 137 assert_kind_of Class, ModuleFolder::NestedClass 138 138 Object.send :remove_const, :ModuleFolder 139 end 140 end 141 142 def test_module_with_nested_inline_class 143 with_loading 'autoloading_fixtures' do 144 assert_kind_of Class, ModuleFolder::InlineClass 145 Object.send :remove_const, :ModuleFolder 146 end 147 end 148 149 def test_directories_may_manifest_as_nested_classes 150 with_loading 'autoloading_fixtures' do 151 assert_kind_of Class, ClassFolder 152 Object.send :remove_const, :ClassFolder 153 end 154 end 155 156 def test_class_with_nested_class 157 with_loading 'autoloading_fixtures' do 158 assert_kind_of Class, ClassFolder::NestedClass 159 Object.send :remove_const, :ClassFolder 160 end 161 end 162 163 def test_class_with_nested_inline_class 164 with_loading 'autoloading_fixtures' do 165 assert_kind_of Class, ClassFolder::InlineClass 166 Object.send :remove_const, :ClassFolder 139 167 end 140 168 end