2010-04-23 18:20:37 -04:00
|
|
|
module Fog
|
|
|
|
module Deprecation
|
|
|
|
|
|
|
|
def deprecate(older, newer)
|
2010-12-15 18:32:33 -05:00
|
|
|
module_eval <<-EOS, __FILE__, __LINE__
|
2010-04-25 14:26:48 -04:00
|
|
|
def #{older}(*args)
|
2010-12-15 18:32:33 -05:00
|
|
|
Formatador.display_line("[yellow][WARN] #{self} => ##{older} is deprecated, use ##{newer} instead[/] [light_black](#{caller.first})[/]")
|
|
|
|
send(:#{newer}, *args)
|
|
|
|
end
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
def self_deprecate(older, newer)
|
|
|
|
module_eval <<-EOS, __FILE__, __LINE__
|
|
|
|
def self.#{older}(*args)
|
|
|
|
Formatador.display_line("[yellow][WARN] #{self} => ##{older} is deprecated, use ##{newer} instead[/] [light_black](#{caller.first})[/]")
|
2010-05-04 17:31:42 -04:00
|
|
|
send(:#{newer}, *args)
|
2010-04-23 18:20:37 -04:00
|
|
|
end
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|