Sha256: 7187bdb293aa31b7b3a98de79064a828be9c00794b7d47e46124a680980cd131

Contents?: true

Size: 408 Bytes

Versions: 10

Compression:

Stored size: 408 Bytes

Contents

module Alba
  # Module for printing deprecation warning
  # @api private
  module Deprecation
    # Similar to {#warn} but prints caller as well
    #
    # @param message [String] main message to print
    # @return void
    def warn(message)
      Kernel.warn(message)
      Kernel.warn(caller_locations(2..2).first) # For performance reason we use (2..2).first
    end
    module_function :warn
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
alba-2.4.3 lib/alba/deprecation.rb
alba-3.2.0 lib/alba/deprecation.rb
alba-3.1.0 lib/alba/deprecation.rb
alba-3.0.3 lib/alba/deprecation.rb
alba-3.0.2 lib/alba/deprecation.rb
alba-3.0.1 lib/alba/deprecation.rb
alba-2.4.2 lib/alba/deprecation.rb
alba-3.0.0 lib/alba/deprecation.rb
alba-2.4.1 lib/alba/deprecation.rb
alba-2.4.0 lib/alba/deprecation.rb