2009-10-16 15:49:39 -04:00
|
|
|
require "active_support/string_inquirer"
|
|
|
|
require "active_support/deprecation"
|
|
|
|
|
|
|
|
RAILS_ROOT = (Class.new(ActiveSupport::Deprecation::DeprecationProxy) do
|
2010-02-04 12:00:50 -05:00
|
|
|
cattr_accessor :warned
|
|
|
|
self.warned = false
|
|
|
|
|
2009-10-16 15:49:39 -04:00
|
|
|
def target
|
|
|
|
Rails.root
|
|
|
|
end
|
|
|
|
|
2010-01-12 08:11:47 -05:00
|
|
|
def replace(*args)
|
|
|
|
warn(caller, :replace, *args)
|
2009-10-16 15:49:39 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def warn(callstack, called, args)
|
2010-02-04 12:00:50 -05:00
|
|
|
unless warned
|
|
|
|
ActiveSupport::Deprecation.warn("RAILS_ROOT is deprecated! Use Rails.root instead", callstack)
|
|
|
|
self.warned = true
|
|
|
|
end
|
2009-10-16 15:49:39 -04:00
|
|
|
end
|
2009-10-17 17:38:21 -04:00
|
|
|
end).new
|
2010-01-12 08:11:47 -05:00
|
|
|
|
|
|
|
RAILS_ENV = (Class.new(ActiveSupport::Deprecation::DeprecationProxy) do
|
2010-02-04 12:00:50 -05:00
|
|
|
cattr_accessor :warned
|
|
|
|
self.warned = false
|
|
|
|
|
2010-01-12 08:11:47 -05:00
|
|
|
def target
|
|
|
|
Rails.env
|
|
|
|
end
|
|
|
|
|
|
|
|
def replace(*args)
|
|
|
|
warn(caller, :replace, *args)
|
|
|
|
end
|
|
|
|
|
|
|
|
def warn(callstack, called, args)
|
2010-02-04 12:00:50 -05:00
|
|
|
unless warned
|
|
|
|
ActiveSupport::Deprecation.warn("RAILS_ENV is deprecated! Use Rails.env instead", callstack)
|
|
|
|
self.warned = true
|
|
|
|
end
|
2010-01-12 08:11:47 -05:00
|
|
|
end
|
|
|
|
end).new
|
|
|
|
|
|
|
|
RAILS_DEFAULT_LOGGER = (Class.new(ActiveSupport::Deprecation::DeprecationProxy) do
|
2010-02-04 12:00:50 -05:00
|
|
|
cattr_accessor :warned
|
|
|
|
self.warned = false
|
|
|
|
|
2010-01-12 08:11:47 -05:00
|
|
|
def target
|
|
|
|
Rails.logger
|
|
|
|
end
|
|
|
|
|
|
|
|
def replace(*args)
|
|
|
|
warn(caller, :replace, *args)
|
|
|
|
end
|
|
|
|
|
|
|
|
def warn(callstack, called, args)
|
2010-02-04 12:00:50 -05:00
|
|
|
unless warned
|
|
|
|
ActiveSupport::Deprecation.warn("RAILS_DEFAULT_LOGGER is deprecated! Use Rails.logger instead", callstack)
|
|
|
|
self.warned = true
|
|
|
|
end
|
2010-01-12 08:11:47 -05:00
|
|
|
end
|
|
|
|
end).new
|