lib/rpush/deprecation.rb in rpush-1.0.0-java vs lib/rpush/deprecation.rb in rpush-2.0.0.beta1

- old
+ new

@@ -1,23 +1,20 @@ module Rpush class Deprecation def self.muted - begin - orig_val = Thread.current[:rpush_mute_deprecations] - Thread.current[:rpush_mute_deprecations] = true - yield - ensure - Thread.current[:rpush_mute_deprecations] = orig_val - end + orig_val = Thread.current[:rpush_mute_deprecations] + Thread.current[:rpush_mute_deprecations] = true + yield + ensure + Thread.current[:rpush_mute_deprecations] = orig_val end def self.muted? Thread.current[:rpush_mute_deprecations] == true end def self.warn(msg) - unless Rpush::Deprecation.muted? - STDERR.puts "DEPRECATION WARNING: #{msg}" - end + return if Rpush::Deprecation.muted? + STDERR.puts "DEPRECATION WARNING: #{msg}" end end end