Skip to content

Commit

Permalink
Include the caller info when seeing if the message should be printed
Browse files Browse the repository at this point in the history
  • Loading branch information
arsduo committed Apr 16, 2012
1 parent e21d6eb commit 86198e3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/multi_json.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -112,11 +112,12 @@ def dump(object, options={})
end end


# Sends of a deprecation warning # Sends of a deprecation warning
def deprecate(message) def deprecate(raw_message)
@messages ||= {} @messages ||= {}
message = "#{Kernel.caller.first}: [DEPRECATION] #{raw_message}"
unless @messages[message] unless @messages[message]
@messages[message] = true @messages[message] = true
Kernel.warn "#{Kernel.caller.first}: [DEPRECATION] #{message}" Kernel.warn message
end end
end end
end end

0 comments on commit 86198e3

Please sign in to comment.