Sha256: e268792620a4dd7f23dbcf4d41ddb58942947e232223d81d953c4dd7ecd89437

Contents?: true

Size: 545 Bytes

Versions: 7

Compression:

Stored size: 545 Bytes

Contents

module Ramaze
  DEPRECATED_CONSTANTS = {
    :BASEDIR        => :ROOT,
    :Template       => :View,
    :Optional       => :Optioned,
  }

  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 # Ramaze

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ramaze-2023.01.06 lib/ramaze/snippets/ramaze/deprecated.rb
ramaze-2012.12.08 lib/ramaze/snippets/ramaze/deprecated.rb
ramaze-2012.12.08b lib/ramaze/snippets/ramaze/deprecated.rb
ramaze-2012.04.14 lib/ramaze/snippets/ramaze/deprecated.rb
ramaze-2012.03.07 lib/ramaze/snippets/ramaze/deprecated.rb
ramaze-2011.12.28 lib/ramaze/snippets/ramaze/deprecated.rb
ramaze-2011.10.23 lib/ramaze/snippets/ramaze/deprecated.rb