Changeset 4778
- Timestamp:
- 08/16/06 20:33:31 (2 years ago)
- Files:
-
- trunk/activesupport/lib/active_support/dependencies.rb (modified) (4 diffs)
- trunk/activesupport/test/dependencies_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activesupport/lib/active_support/dependencies.rb
r4774 r4778 76 76 77 77 if !warnings_on_first_load or history.include?(expanded) 78 load_file(*load_args)78 result = load_file(*load_args) 79 79 else 80 enable_warnings { load_file(*load_args) }80 enable_warnings { result = load_file(*load_args) } 81 81 end 82 82 rescue … … 86 86 else 87 87 log "requiring #{file_name}" 88 re quire file_name88 result = require file_name 89 89 end 90 90 91 91 # Record history *after* loading so first load gets warnings. 92 92 history << expanded 93 return result 93 94 end 94 95 … … 158 159 undefined_before = const_paths.reject(&method(:qualified_const_defined?)) 159 160 160 load path161 result = load path 161 162 162 163 newly_defined_paths = const_paths.select(&method(:qualified_const_defined?)) … … 164 165 autoloaded_constants.uniq! 165 166 log "loading #{path} defined #{newly_defined_paths * ', '}" unless newly_defined_paths.empty? 167 return result 166 168 end 167 169 trunk/activesupport/test/dependencies_test.rb
r4774 r4778 62 62 63 63 def test_warnings_should_be_enabled_on_first_load 64 with_loading do64 with_loading 'dependencies' do 65 65 old_warnings, Dependencies.warnings_on_first_load = Dependencies.warnings_on_first_load, true 66 66 67 filename = " #{File.dirname(__FILE__)}/dependencies/check_warnings"68 expanded = File.expand_path( filename)67 filename = "check_warnings" 68 expanded = File.expand_path("test/dependencies/#{filename}") 69 69 $check_warnings_load_count = 0 70 70