diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-12 14:11:47 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-13 01:19:22 +0100 |
commit | 1a275730b290c1f06d4e8df680d22ae1b41ab585 (patch) | |
tree | 46298bdbf71d7a3afeaa2de6bbc37008a12b37fd /railties/lib/rails/deprecation.rb | |
parent | 9dd4c79d6148890f49949686e709cfb035755068 (diff) | |
download | rails-1a275730b290c1f06d4e8df680d22ae1b41ab585.tar.gz rails-1a275730b290c1f06d4e8df680d22ae1b41ab585.tar.bz2 rails-1a275730b290c1f06d4e8df680d22ae1b41ab585.zip |
Set deprecation warnings for RAILS_ENV and RAILS_DEFAULT_LOGGER.
Diffstat (limited to 'railties/lib/rails/deprecation.rb')
-rw-r--r-- | railties/lib/rails/deprecation.rb | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/railties/lib/rails/deprecation.rb b/railties/lib/rails/deprecation.rb index 155166a113..43f08d13df 100644 --- a/railties/lib/rails/deprecation.rb +++ b/railties/lib/rails/deprecation.rb @@ -6,8 +6,8 @@ RAILS_ROOT = (Class.new(ActiveSupport::Deprecation::DeprecationProxy) do Rails.root end - def replace(val) - puts OMG + def replace(*args) + warn(caller, :replace, *args) end def warn(callstack, called, args) @@ -15,3 +15,33 @@ RAILS_ROOT = (Class.new(ActiveSupport::Deprecation::DeprecationProxy) do ActiveSupport::Deprecation.warn(msg, callstack) end end).new + +RAILS_ENV = (Class.new(ActiveSupport::Deprecation::DeprecationProxy) do + def target + Rails.env + end + + def replace(*args) + warn(caller, :replace, *args) + end + + def warn(callstack, called, args) + msg = "RAILS_ENV is deprecated! Use Rails.env instead." + ActiveSupport::Deprecation.warn(msg, callstack) + end +end).new + +RAILS_DEFAULT_LOGGER = (Class.new(ActiveSupport::Deprecation::DeprecationProxy) do + def target + Rails.logger + end + + def replace(*args) + warn(caller, :replace, *args) + end + + def warn(callstack, called, args) + msg = "RAILS_DEFAULT_LOGGER is deprecated! Use Rails.logger instead." + ActiveSupport::Deprecation.warn(msg, callstack) + end +end).new |