Sha256: b74c9babbac3e0b74c301e0f8eb9ee5e85224fcf06aa49518cdec8339ec3e760

Contents?: true

Size: 495 Bytes

Versions: 5

Compression:

Stored size: 495 Bytes

Contents

module Koala
  module Utils

    # @private
    DEPRECATION_PREFIX = "KOALA: Deprecation warning: "

    # Prints a deprecation message.  
    # Each individual message will only be printed once to avoid spamming.
    def self.deprecate(message)
      @posted_deprecations ||= []
      unless @posted_deprecations.include?(message)
        # only include each message once
        Kernel.warn("#{DEPRECATION_PREFIX}#{message}")
        @posted_deprecations << message
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
koala-1.4.1 lib/koala/utils.rb
koala-1.4.0 lib/koala/utils.rb
koala-1.4.0.rc1 lib/koala/utils.rb
koala-1.3.0 lib/koala/utils.rb
koala-1.3.0rc2 lib/koala/utils.rb