1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

display location of deprecated calls

This commit is contained in:
geemus 2010-05-03 14:11:11 -07:00
parent 4046e9e30d
commit b075de92c2

View file

@ -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