Sha256: cca232b7c68dc1edfcf0180718a1e3f981a7648dc7833e420bc321f8b175fa99

Contents?: true

Size: 480 Bytes

Versions: 11

Compression:

Stored size: 480 Bytes

Contents

module Ramaze
  DEPRECATED_CONSTANTS = {
    :ThreadAccessor => :StateAccessor
  }

  def self.deprecated(from, to = nil)
    message = "%s is deprecated"
    message << ", use %s instead" unless to.nil?
    message << " - from: %p"
    Log.warn(message % [from, to, caller[1]])
  end

  def self.const_missing(name)
    if to = DEPRECATED_CONSTANTS[name]
      Log.warn "Ramaze::#{name} is deprecated, use #{to} instead"
      constant(to)
    else
      super
    end
  end
end

Version data entries

11 entries across 11 versions & 4 rubygems

Version Path
Pistos-ramaze-2008.12 lib/ramaze/snippets/ramaze/deprecated.rb
Pistos-ramaze-2009.01 lib/ramaze/snippets/ramaze/deprecated.rb
Pistos-ramaze-2009.02 lib/ramaze/snippets/ramaze/deprecated.rb
manveru-ramaze-2008.10 lib/ramaze/snippets/ramaze/deprecated.rb
manveru-ramaze-2008.12 lib/ramaze/snippets/ramaze/deprecated.rb
manveru-ramaze-2009.01 lib/ramaze/snippets/ramaze/deprecated.rb
ptomato-ramaze-2009.02.1 lib/ramaze/snippets/ramaze/deprecated.rb
ptomato-ramaze-2009.02 lib/ramaze/snippets/ramaze/deprecated.rb
ramaze-2009.01 lib/ramaze/snippets/ramaze/deprecated.rb
ramaze-2009.02 lib/ramaze/snippets/ramaze/deprecated.rb
ramaze-2009.03 lib/ramaze/snippets/ramaze/deprecated.rb