From a4f74da225a9385a02a399fa1156adeaf261c234 Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Mon, 3 Apr 2006 03:06:23 +0000 Subject: 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 --- activesupport/lib/active_support/dependencies.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'activesupport/lib') 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) -- cgit v1.2.3