Module: Fog::Deprecation

Instance Method Summary collapse

Instance Method Details

#deprecate(older, newer) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/fog/core/deprecation.rb', line 4

def deprecate(older, newer)
  module_eval <<-EOS, __FILE__, __LINE__
    def #{older}(*args)
      Fog::Logger.warning("#{self} => ##{older} is deprecated, use ##{newer} instead [light_black](#{caller.first})[/]")
      send(:#{newer}, *args)
    end
  EOS
end

#self_deprecate(older, newer) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/fog/core/deprecation.rb', line 13

def self_deprecate(older, newer)
  module_eval <<-EOS, __FILE__, __LINE__
    def self.#{older}(*args)
      Fog::Logger.warning("#{self} => ##{older} is deprecated, use ##{newer} instead [light_black](#{caller.first})[/]")
      send(:#{newer}, *args)
    end
  EOS
end