aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2006-04-03 03:06:23 +0000
committerMichael Koziarski <michael@koziarski.com>2006-04-03 03:06:23 +0000
commita4f74da225a9385a02a399fa1156adeaf261c234 (patch)
treed3036a39eeb17a3fba5b875fe26fb04ab171cdc3
parentf966c279cfed64adefae7d220389b206e3abf3ca (diff)
downloadrails-a4f74da225a9385a02a399fa1156adeaf261c234.tar.gz
rails-a4f74da225a9385a02a399fa1156adeaf261c234.tar.bz2
rails-a4f74da225a9385a02a399fa1156adeaf261c234.zip
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
-rw-r--r--activesupport/CHANGELOG4
-rw-r--r--activesupport/lib/active_support/dependencies.rb11
2 files changed, 15 insertions, 0 deletions
diff --git a/activesupport/CHANGELOG b/activesupport/CHANGELOG
index 388cdb3b8f..4886912b31 100644
--- a/activesupport/CHANGELOG
+++ b/activesupport/CHANGELOG
@@ -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]
diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb
index ffddda6f03..c1da53c878 100644
--- a/activesupport/lib/active_support/dependencies.rb
+++ b/activesupport/lib/active_support/dependencies.rb
@@ -68,6 +68,17 @@ module Dependencies #:nodoc:
# 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)