Module: Ardm::Deprecation
- Defined in:
- lib/ardm/deprecation.rb
Class Method Summary collapse
Class Method Details
.deprecations ⇒ Object
3 4 5 6 7 8 |
# File 'lib/ardm/deprecation.rb', line 3 def self.deprecations @deprecations ||= begin at_exit { print_deprecations } {} end end |
.print_deprecations ⇒ Object
10 11 12 13 |
# File 'lib/ardm/deprecation.rb', line 10 def self.print_deprecations $stderr.puts 'Deprecations by count:' $stderr.puts deprecations.sort_by { |_,v| -v }.map { |, count| "[%5d] %s" % [count, ] } end |
.warn(message) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/ardm/deprecation.rb', line 15 def self.warn() = "DEPRECATED: #{} at #{caller[2].sub(Rails.root.to_s,'')}" deprecations[] ||= 0 deprecations[] += 1 if deprecations[] == 1 $stderr.puts end end |