Permalink
Browse files

Remove constants deprecation.

  • Loading branch information...
1 parent f0ee4a6 commit 800695ad4cef33347bcfef6df7634ff533582449 @josevalim josevalim committed Aug 29, 2010
Showing with 0 additions and 34 deletions.
  1. +0 −1 railties/lib/rails.rb
  2. +0 −33 railties/lib/rails/deprecation.rb
@@ -8,7 +8,6 @@
require 'rails/application'
require 'rails/version'
-require 'rails/deprecation'
require 'active_support/railtie'
require 'action_dispatch/railtie'
@@ -1,33 +0,0 @@
-require "active_support/string_inquirer"
-require "active_support/basic_object"
-
-module Rails
- class DeprecatedConstant < ActiveSupport::BasicObject
- def self.deprecate(old, new)
- constant = self.new(old, new)
- eval "::#{old} = constant"
- end
-
- def initialize(old, new)
- @old, @new = old, new
- @target = ::Kernel.eval "proc { #{@new} }"
- @warned = false
- end
-
- def method_missing(meth, *args, &block)
- ::ActiveSupport::Deprecation.warn("#{@old} is deprecated. Please use #{@new}") unless @warned
- @warned = true
-
- target = @target.call
- if target.respond_to?(meth)
- target.send(meth, *args, &block)
- else
- super
- end
- end
- end
-
- DeprecatedConstant.deprecate("RAILS_ROOT", "::Rails.root.to_s")
- DeprecatedConstant.deprecate("RAILS_ENV", "::Rails.env")
- DeprecatedConstant.deprecate("RAILS_DEFAULT_LOGGER", "::Rails.logger")
-end

0 comments on commit 800695a

Please sign in to comment.