From b075de92c2ec6842911baf773ce14dc0496737da Mon Sep 17 00:00:00 2001 From: geemus Date: Mon, 3 May 2010 14:11:11 -0700 Subject: [PATCH] display location of deprecated calls --- lib/fog/deprecation.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/fog/deprecation.rb b/lib/fog/deprecation.rb index e60956f2b..38ad3b9f9 100644 --- a/lib/fog/deprecation.rb +++ b/lib/fog/deprecation.rb @@ -4,7 +4,10 @@ module Fog def deprecate(older, newer) class_eval <<-EOS, __FILE__, __LINE__ def #{older}(*args) - Formatador.display_line("[yellow][WARN] #{self} => ##{older} is deprecated, use ##{newer} instead[/]") + location = caller.first + warning = "[yellow][WARN] #{self} => ##{older} is deprecated, use ##{newer} instead[/]" + warning << " [light_black](" << location << ")[/] " + Formatador.display_line(warning) #{newer}(*args) end EOS