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)
|
2011-10-19 15:49:34 -04:00
|
|
|
Fog::Logger.deprecation("#{self} => ##{older} is deprecated, use ##{newer} instead [light_black](#{caller.first})[/]")
|
2010-12-15 18:32:33 -05:00
|
|
|
send(:#{newer}, *args)
|
|
|
|
end
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
def self_deprecate(older, newer)
|
|
|
|
module_eval <<-EOS, __FILE__, __LINE__
|
|
|
|
def self.#{older}(*args)
|
2011-10-19 15:49:34 -04:00
|
|
|
Fog::Logger.deprecation("#{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
|