class Rpush::Deprecation

Public Class Methods

muted() { || ... } click to toggle source
# File lib/rpush/deprecation.rb, line 3
def self.muted
  orig_val = Thread.current[:rpush_mute_deprecations]
  Thread.current[:rpush_mute_deprecations] = true
  yield
ensure
  Thread.current[:rpush_mute_deprecations] = orig_val
end
muted?() click to toggle source
# File lib/rpush/deprecation.rb, line 11
def self.muted?
  Thread.current[:rpush_mute_deprecations] == true
end
warn(msg) click to toggle source
# File lib/rpush/deprecation.rb, line 15
def self.warn(msg)
  return if Rpush::Deprecation.muted?
  STDERR.puts "DEPRECATION WARNING: #{msg}"
end
warn_with_backtrace(msg) click to toggle source
# File lib/rpush/deprecation.rb, line 20
def self.warn_with_backtrace(msg)
  return if Rpush::Deprecation.muted?
  trace = "\n\nCALLED FROM:\n" + caller.join("\n")
  warn(msg + trace)
end