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

18 lines
448 B
Ruby
Raw Normal View History

2010-04-23 18:20:37 -04:00
module Fog
module Deprecation
def deprecate(older, newer)
class_eval <<-EOS, __FILE__, __LINE__
2010-04-25 14:26:48 -04:00
def #{older}(*args)
2010-05-03 17:11:11 -04:00
location = caller.first
warning = "[yellow][WARN] #{self} => ##{older} is deprecated, use ##{newer} instead[/]"
warning << " [light_black](" << location << ")[/] "
Formatador.display_line(warning)
send(:#{newer}, *args)
2010-04-23 18:20:37 -04:00
end
EOS
end
end
end