<p>I'd like to mark a method as deprecated, so the people using it can easily check their code and catch up. In Java you set @Deprecated and everybody knows what this means.</p>

<p>So is there a preferred way (or even tools) to mark and check for deprecations in Ruby?</p>

You do have
```
libdeprecated-ruby
```
(2010-2012, not available anymore on rubygem in 2015)
A small library intended to aid developers working with deprecated code.
The idea comes from the '
```
D
```
' programming language, where developers can mark certain code as deprecated, and then allow/disallow the ability to execute deprecated code.
```
```
require 'lib/deprecated.rb'
require 'test/unit'

# this class is used to test the deprecate functionality
class DummyClass
  def monkey
    return true
  end

  deprecate :monkey
end

# we want exceptions for testing here.
Deprecate.set_action(:throw)

class DeprecateTest < Test::Unit::TestCase
  def test_set_action

    assert_raise(DeprecatedError) { raise StandardError.new unless DummyClass.new.monkey }

    Deprecate.set_action(proc { |msg| raise DeprecatedError.new("#{msg} is deprecated.") })

    assert_raise(DeprecatedError) { raise StandardError.new unless DummyClass.new.monkey }

    # set to warn and make sure our return values are getting through.
    Deprecate.set_action(:warn)

    assert_nothing_raised(DeprecatedError) { raise StandardError.new unless DummyClass.new.monkey } 
  end
end
```
```