Turn warnings on when loading a file if Dependencies.mechanism == :load. Common mistakes such as redefined methods will print warnings to stderr. References #752. References #1792.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3124 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jeremy Kemper 2005-11-21 07:06:33 +00:00
parent 2b6e2bfed7
commit edc7c521b8
2 changed files with 14 additions and 3 deletions

@ -1,5 +1,7 @@
*SVN*
* Turn warnings on when loading a file if Dependencies.mechanism == :load. Common mistakes such as redefined methods will print warnings to stderr. [Jeremy Kemper]
* Add Symbol#to_proc, which allows for, e.g. [:foo, :bar].map(&:to_s). [Marcel Molina Jr.]
* Added the following methods [Marcel Molina Jr., Sam Stephenson]:

@ -33,12 +33,21 @@ def associate_with(file_name)
def clear
self.loaded = [ ]
end
def require_or_load(file_name)
file_name = "#{file_name}.rb" unless ! load? || file_name[-3..-1] == '.rb'
load? ? load(file_name) : require(file_name)
if load?
begin
original_verbosity, $VERBOSE = $VERBOSE, true
load file_name
ensure
$VERBOSE = original_verbosity
end
else
require file_name
end
end
def remove_subclasses_for(*classes)
Object.remove_subclasses_of(*classes)
end