sonic-pi

https://github.com/sonic-pi-net/sonic-pi

C++

Code. Music. Live.

ActiveSupport::Deprecation::Behavior#behavior=

Sets the behavior to the specified value. Can be a single value, array,
or an object that responds to +call+.

Available behaviors:

[+raise+]   Raise <tt>ActiveSupport::DeprecationException</tt>.
[+stderr+]  Log all deprecation warnings to +$stderr+.
[+log+]     Log all deprecation warnings to +Rails.logger+.
[+notify+]  Use +ActiveSupport::Notifications+ to notify +deprecation.rails+.
[+silence+] Do nothing.

Setting behaviors only affects deprecations that happen after boot time.
Deprecation warnings raised by gems are not affected by this setting
because they happen before Rails boots up.

  ActiveSupport::Deprecation.behavior = :stderr
  ActiveSupport::Deprecation.behavior = [:stderr, :log]
  ActiveSupport::Deprecation.behavior = MyCustomHandler
  ActiveSupport::Deprecation.behavior = ->(message, callstack) {
    # custom stuff
  }

Source | Google | Stack overflow

Edit

git clone [email protected]:sonic-pi-net/sonic-pi.git

cd sonic-pi

open app/server/ruby/vendor/activesupport-7.0.6/lib/active_support/deprecation/behaviors.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-ActiveSupport--Deprecation--Behavior-behavior--for-pr


# Commit to git

git add app/server/ruby/vendor/activesupport-7.0.6/lib/active_support/deprecation/behaviors.rbgit commit -m "better docs for ActiveSupport::Deprecation::Behavior#behavior="


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-ActiveSupport--Deprecation--Behavior-behavior--for-pr

hub pull-request


# Celebrate!