Module: Fog::Deprecation

Included in:
AWS::Compute::Server, GoGrid::Compute::Server
Defined in:
lib/fog/core/deprecation.rb

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)
      Formatador.display_line("[yellow][WARN] #{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)
      Formatador.display_line("[yellow][WARN] #{self} => ##{older} is deprecated, use ##{newer} instead[/] [light_black](#{caller.first})[/]")
      send(:#{newer}, *args)
    end
  EOS
end