Sha256: 4e54a075615e2a2b903b5a3ca0b42c3daa9e8dce60bf74c47f695866158b6cbf

Contents?: true

Size: 439 Bytes

Versions: 6

Compression:

Stored size: 439 Bytes

Contents

# frozen_string_literal: true

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

6 entries across 6 versions & 1 rubygems

Version Path
alba-3.5.0 lib/alba/deprecation.rb
alba-3.4.0 lib/alba/deprecation.rb
alba-3.3.3 lib/alba/deprecation.rb
alba-3.3.2 lib/alba/deprecation.rb
alba-3.3.1 lib/alba/deprecation.rb
alba-3.3.0 lib/alba/deprecation.rb