Module: Fog::Deprecation

Instance Method Summary collapse

Instance Method Details

#deprecate(older, newer) ⇒ Object



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

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