Permalink
Browse files

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

…les. prints deprecation warnings to the log file

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4136 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent f966c27 commit a4f74da225a9385a02a399fa1156adeaf261c234 @NZKoz NZKoz committed Apr 3, 2006
Showing with 15 additions and 0 deletions.
  1. +4 −0 activesupport/CHANGELOG
  2. +11 −0 activesupport/lib/active_support/dependencies.rb
View
@@ -1,3 +1,7 @@
+* 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)

0 comments on commit a4f74da

Please sign in to comment.