Sha256: 75e3442c5228c1a4e8c5d5a5aeabb59dabe8dbed317f65adb924e323433a603b

Contents?: true

Size: 506 Bytes

Versions: 5

Compression:

Stored size: 506 Bytes

Contents

module WarningSigns
  module RubyDeprecationCatcher
    include CallerHelper

    def warn(message, category: nil)
      Deprecation.new(
        augmented_message(message, category),
        source: "ruby",
        category: category,
        backtrace: caller
      ).invoke
    end

    def augmented_message(message, category)
      category_part = category.present? ? " #{category.upcase}: " : ": "
      "RUBY WARNING#{category_part}#{message} called from #{caller_filtered.first}"
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
warning_signs-0.7.2 lib/warning_signs/ruby_deprecation_catcher.rb
warning_signs-0.7.1 lib/warning_signs/ruby_deprecation_catcher.rb
warning_signs-0.7.0 lib/warning_signs/ruby_deprecation_catcher.rb
warning_signs-0.6.1 lib/warning_signs/ruby_deprecation_catcher.rb
warning_signs-0.6.0 lib/warning_signs/ruby_deprecation_catcher.rb