Skip to content

Instantly share code, notes, and snippets.

@mmyoji
Created May 31, 2018 07:31
Show Gist options
  • Save mmyoji/fc2a1cd1b64881dcba9a0fc3dcd4f8ee to your computer and use it in GitHub Desktop.
Save mmyoji/fc2a1cd1b64881dcba9a0fc3dcd4f8ee to your computer and use it in GitHub Desktop.
Usage of Gem::Deprecate.deprecate
class Test
extend Gem::Deprecate
# DEPRECATED
def foo
puts "foo"
end
def bar
puts "bar"
end
deprecate :foo, :bar, 2018, 10
end
t = Test.new
t.foo
#=> NOTE: Test#foo is deprecated; use bar instead. It will be removed on or after 2018-10-01.
# Test#foo called gem_deprecate.rb:16.
# foo
t.bar
#=> bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment