Permalink
Browse files

Include the caller info when seeing if the message should be printed

  • Loading branch information...
1 parent e21d6eb commit 86198e39b93a7367db5d8b5707f64470d76a2d31 @arsduo committed Apr 16, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/multi_json.rb
View
@@ -112,11 +112,12 @@ def dump(object, options={})
end
# Sends of a deprecation warning
- def deprecate(message)
+ def deprecate(raw_message)
@messages ||= {}
+ message = "#{Kernel.caller.first}: [DEPRECATION] #{raw_message}"
unless @messages[message]
@messages[message] = true
- Kernel.warn "#{Kernel.caller.first}: [DEPRECATION] #{message}"
+ Kernel.warn message
end
end
end

0 comments on commit 86198e3

Please sign in to comment.