diff options
author | Mikel Lindsaar <raasdnil@gmail.com> | 2010-01-17 12:46:51 +1100 |
---|---|---|
committer | Mikel Lindsaar <raasdnil@gmail.com> | 2010-01-17 12:46:51 +1100 |
commit | 6f663addaa7ed40f1133687d7a2be0958bf0c059 (patch) | |
tree | 7beb7f092c1979d1fd5ea6e7aaaf4f59c2f4abf4 /railties/lib/rails/deprecation.rb | |
parent | 8834b2612b7ddda70ee6a685eb0063d3daa8e63d (diff) | |
parent | 3e94032227d450d479f511070c51f37f53d0ecc4 (diff) | |
download | rails-6f663addaa7ed40f1133687d7a2be0958bf0c059.tar.gz rails-6f663addaa7ed40f1133687d7a2be0958bf0c059.tar.bz2 rails-6f663addaa7ed40f1133687d7a2be0958bf0c059.zip |
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'railties/lib/rails/deprecation.rb')
-rw-r--r-- | railties/lib/rails/deprecation.rb | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/railties/lib/rails/deprecation.rb b/railties/lib/rails/deprecation.rb index 3c5b8bdec7..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) @@ -16,10 +16,32 @@ RAILS_ROOT = (Class.new(ActiveSupport::Deprecation::DeprecationProxy) do end end).new -module Rails - class Configuration - def gem(*args) - ActiveSupport::Deprecation.warn("config.gem has been deprecated in favor of the Gemfile.") - end +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 -end
\ No newline at end of file + + 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 |