mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
34e6a1105c
distinctly styles deprecations for clarity gives better flexibility for redirecting logs reduces possibility of missing deprecations because warnings are ignored
23 lines
649 B
Ruby
23 lines
649 B
Ruby
module Fog
|
|
module Deprecation
|
|
|
|
def deprecate(older, newer)
|
|
module_eval <<-EOS, __FILE__, __LINE__
|
|
def #{older}(*args)
|
|
Fog::Logger.deprecation("#{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)
|
|
Fog::Logger.deprecation("#{self} => ##{older} is deprecated, use ##{newer} instead [light_black](#{caller.first})[/]")
|
|
send(:#{newer}, *args)
|
|
end
|
|
EOS
|
|
end
|
|
|
|
end
|
|
end
|