Module: DeprecationTracker::KernelWarnTracker
- Included in:
- DeprecationTracker
- Defined in:
- lib/deprecation_tracker.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.callbacks ⇒ Object
17 18 19 |
# File 'lib/deprecation_tracker.rb', line 17 def self.callbacks @callbacks ||= [] end |
Instance Method Details
#warn(*messages, uplevel: nil, category: nil) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/deprecation_tracker.rb', line 21 def warn(*, uplevel: nil, category: nil) KernelWarnTracker.callbacks.each do |callback| .each { || callback.() } end if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.5.0") super(*) elsif Gem::Version.new(RUBY_VERSION) < Gem::Version.new("3.0") super(*, uplevel: nil) else super end end |