Changeset 3190
- Timestamp:
- 11/24/05 20:26:01 (4 years ago)
- Files:
-
- trunk/activesupport/CHANGELOG (modified) (1 diff)
- trunk/activesupport/lib/active_support/dependencies.rb (modified) (2 diffs)
- trunk/activesupport/test/dependencies_test.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activesupport/CHANGELOG
r3169 r3190 1 1 *SVN* 2 3 * Introduce Dependencies.warnings_on_first_load setting. If true, enables warnings on first load of a require_dependency. Otherwise, loads without warnings. Disabled (set to false) by default. [Jeremy Kemper] 2 4 3 5 * Active Support is warnings-safe. #1792 [Eric Hodel] trunk/activesupport/lib/active_support/dependencies.rb
r3181 r3190 6 6 module Dependencies #:nodoc: 7 7 extend self 8 9 # Should we turn on Ruby warnings on the first load of dependent files? 10 mattr_accessor :warnings_on_first_load 11 self.warnings_on_first_load = false 8 12 9 13 # All files ever loaded. … … 51 55 52 56 begin 53 # Enable warnings iff this file has not been loaded before. 54 if history.include?(file_name) 57 # Enable warnings iff this file has not been loaded before and 58 # warnings_on_first_load is set. 59 if !warnings_on_first_load or history.include?(file_name) 55 60 load load_file_name 56 61 else trunk/activesupport/test/dependencies_test.rb
r3181 r3190 47 47 def test_warnings_should_be_enabled_on_first_load 48 48 old_mechanism, Dependencies.mechanism = Dependencies.mechanism, :load 49 old_warnings, Dependencies.warnings_on_first_load = Dependencies.warnings_on_first_load, true 49 50 50 51 filename = "#{File.dirname(__FILE__)}/dependencies/check_warnings" … … 79 80 ensure 80 81 Dependencies.mechanism = old_mechanism 82 Dependencies.warnings_on_first_load = old_warnings 81 83 end 82 84