mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
4d739e6054
add ability to use Fog.credentials_path to use non '~/.fog' try to use available credentials automagically even outside bin
23 lines
685 B
Ruby
23 lines
685 B
Ruby
module Fog
|
|
module Deprecation
|
|
|
|
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
|
|
|
|
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
|
|
|
|
end
|
|
end
|