lib/active_support/deprecation.rb in activesupport-2.0.5 vs lib/active_support/deprecation.rb in activesupport-2.1.0

- old
+ new

@@ -1,7 +1,6 @@ require 'yaml' -require 'delegate' module ActiveSupport module Deprecation #:nodoc: mattr_accessor :debug self.debug = false @@ -143,12 +142,12 @@ ensure ActiveSupport::Deprecation.behavior = old_behavior end end - # Stand-in for @request, @attributes, @params, etc which emits deprecation - # warnings on any method call (except #inspect). + # Stand-in for <tt>@request</tt>, <tt>@attributes</tt>, <tt>@params</tt>, etc. + # which emits deprecation warnings on any method call (except +inspect+). class DeprecatedInstanceVariableProxy #:nodoc: silence_warnings do instance_methods.each { |m| undef_method m unless m =~ /^__/ } end @@ -174,23 +173,10 @@ def warn(callstack, called, args) ActiveSupport::Deprecation.warn("#{@var} is deprecated! Call #{@method}.#{called} instead of #{@var}.#{called}. Args: #{args.inspect}", callstack) end end - - class DeprecatedInstanceVariable < Delegator - def initialize(value, method) - super(value) - @method = method - @value = value - end - def __getobj__ - ActiveSupport::Deprecation.warn("Instance variable @#{@method} is deprecated! Call instance method #{@method} instead.") - @value - end - end - end end class Module include ActiveSupport::Deprecation::ClassMethods