Sha256: ee06fac6eedb9d01c6e8d3102afdd9f8a64d494bf0c90c450aecdd19aa130007

Contents?: true

Size: 566 Bytes

Versions: 1

Compression:

Stored size: 566 Bytes

Contents

module WarningSigns
  module RubyDeprecationCatcher
    include CallerLocationHelper
    def warn(message, category: nil)
      Deprecation.new(
        augmented_message(message, category),
        source: "ruby",
        category: category,
        backtrace: caller_locations[caller_location_start..]
      ).invoke
    end

    def augmented_message(message, category)
      category_part = category.present? ? " #{category.upcase}: " : ": "
      "RUBY WARNING#{category_part}#{message} called from #{caller_locations[caller_location_start]}"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
warning_signs-0.5.0 lib/warning_signs/ruby_deprecation_catcher.rb