/usr/lib/ruby/vendor_ruby/rails/deprecation.rb is in ruby-railties 2:4.2.10-0ubuntu4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | require 'active_support/deprecation/proxy_wrappers'
module Rails
class DeprecatedConstant < ActiveSupport::Deprecation::DeprecatedConstantProxy
def self.deprecate(old, current)
# double assignment is used to avoid "assigned but unused variable" warning
constant = constant = new(old, current)
eval "::#{old} = constant"
end
private
def target
::Kernel.eval @new_const.to_s
end
end
DeprecatedConstant.deprecate('RAILS_CACHE', '::Rails.cache')
end
|