lib/deprecation/reporting.rb in deprecation-0.0.2 vs lib/deprecation/reporting.rb in deprecation-0.0.3
- old
+ new
@@ -10,14 +10,14 @@
context.deprecation_behavior.each { |b| b.call(m, callstack) }
end
end
# Silence deprecation warnings within the block.
- def silence
- old_silenced, @silenced = @silenced, true
+ def silence context
+ old_silenced, context.silenced = context.silenced, true
yield
ensure
- @silenced = old_silenced
+ context.silenced = old_silenced
end
def collect(context)
old_behavior = context.deprecation_behavior
deprecations = []