mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
add deprecation abilities
This commit is contained in:
parent
fc1a13e208
commit
763e6e652a
2 changed files with 15 additions and 0 deletions
|
@ -20,6 +20,7 @@ $LOAD_PATH.unshift __DIR__ unless
|
|||
|
||||
require 'fog/collection'
|
||||
require 'fog/connection'
|
||||
require 'fog/deprecation'
|
||||
require 'fog/model'
|
||||
require 'fog/parser'
|
||||
require 'fog/ssh'
|
||||
|
|
14
lib/fog/deprecation.rb
Normal file
14
lib/fog/deprecation.rb
Normal file
|
@ -0,0 +1,14 @@
|
|||
module Fog
|
||||
module Deprecation
|
||||
|
||||
def deprecate(older, newer)
|
||||
class_eval <<-EOS, __FILE__, __LINE__
|
||||
def #{older}
|
||||
Formatador.display_line("[yellow][WARN] fog: #{older} is deprecated, use #{newer} instead[/]")
|
||||
#{newer}
|
||||
end
|
||||
EOS
|
||||
end
|
||||
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue