Module: Bard::Deprecation
- Defined in:
- lib/bard/deprecation.rb
Class Method Summary collapse
Class Method Details
.reset! ⇒ Object
15 16 17 |
# File 'lib/bard/deprecation.rb', line 15 def self.reset! @warned = {} end |
.warn(message, callsite: nil) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/bard/deprecation.rb', line 5 def self.warn(, callsite: nil) callsite ||= caller_locations(2, 1).first key = "#{callsite.path}:#{callsite.lineno}:#{}" return if @warned[key] @warned[key] = true location = "#{callsite.path}:#{callsite.lineno}" Kernel.warn "[DEPRECATION] #{} (called from #{location})" end |