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/core/deprecation.rb

17 lines
448 B
Ruby

module Fog
module Deprecation
def deprecate(older, newer)
class_eval <<-EOS, __FILE__, __LINE__
def #{older}(*args)
location = caller.first
warning = "[yellow][WARN] #{self} => ##{older} is deprecated, use ##{newer} instead[/]"
warning << " [light_black](" << location << ")[/] "
Formatador.display_line(warning)
send(:#{newer}, *args)
end
EOS
end
end
end