提交 a4f74da2 编写于 作者: M Michael Koziarski

Fix for depot and other applications with .13 style environment.rb files. ...

Fix for depot and other applications with .13 style environment.rb files.   prints deprecation warnings to the log file


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4136 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 f966c279
* SVN *
* provide an empty Dependencies::LoadingModule.load which prints deprecation warnings. Lets 1.0 applications function with .13-style environment.rb.
*1.3.0* (March 27th, 2005)
* When possible, avoid incorrectly obtaining constants from parent modules. Fixes #4221. [Nicholas Seckar]
......
......@@ -68,6 +68,17 @@ def require_or_load(file_name)
# Record history *after* loading so first load gets warnings.
history << file_name
end
class LoadingModule
# Old style environment.rb referenced this method directly. Please note, it doesn't
# actualy *do* anything any more.
def self.root(*args)
if defined?(RAILS_DEFAULT_LOGGER)
RAILS_DEFAULT_LOGGER.warn "Your environment.rb uses the old syntax, it may not continue to work in future releases."
RAILS_DEFAULT_LOGGER.warn "For upgrade instructions please see: http://manuals.rubyonrails.com/read/book/19"
end
end
end
end
Object.send(:define_method, :require_or_load) { |file_name| Dependencies.require_or_load(file_name) } unless Object.respond_to?(:require_or_load)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册