Skip to content

Add deprecation mechanism (introduces runtime dependency on ActiveSupport) #645

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 6, 2023

Conversation

jcouball
Copy link
Member

@jcouball jcouball commented Mar 6, 2023

Your checklist for this pull request

🚨Please review the guidelines for contributing to this repository.

  • Ensure all commits include DCO sign-off.
  • Ensure that your contributions pass unit testing.
  • Ensure that your contributions contain documentation if applicable.

Description

Deprecation warnings are managed with the Git.deprecation attribute.

Use this object to define deprecations in the source code:

Git.deprecation.deprecate_methods(Git::Branch, stashes: 'use Git::Base#stash_list instead')

The default action when using deprecated items (methods, classes, etc.) is to output
a DEPRECATION WARNING to $stderr like the following:

DEPRECATION WARNING: stashes is deprecated and will be removed from git 2.0.0 (use Git::Base.stash_list instead)

The action taken when a deprecated item is used is defined by setting the behavior
on the deprecation object:

# Log all deprecation warnings to $stderr (the default)
Git.deprecation = :stderr

# Raise an ActiveSupport::DeprecationException
Git.deprecation = :raise

# Do nothing
Git.deprecation = :silence

See ActiveSupport::Deprecation for more details on how to use deprecations.

…port)

Signed-off-by: James Couball <jcouball@yahoo.com>
@jcouball
Copy link
Member Author

jcouball commented Mar 6, 2023

The TruffleRuby build failed on the YARD document generation which should not matter. I am going to disable YARD doc generation for the TruffleRuby build.

Signed-off-by: James Couball <jcouball@yahoo.com>
@jcouball jcouball merged commit 1311414 into master Mar 6, 2023
@jcouball jcouball deleted the deprecation_mechanism branch March 6, 2023 00:51
@jcouball jcouball mentioned this pull request Mar 6, 2023
jcouball added a commit that referenced this pull request Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant