Deprecate and provide replacements for inconsistent methods #676
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Goal
For consistency with Bugsnag notifiers for other languages, a number of methods have been deprecated in this PR. The old options will be removed in the next major version
notify_release_stages
configuration option has been deprecated in favour ofenabled_release_stages
auto_capture_sessions
andtrack_sessions
configuration options have been deprecated in favour ofauto_track_sessions
Report
class has been deprecated in favour of theEvent
classReport#meta_data
attribute has been deprecated in favour ofReport#metadata
Breadcrumb#meta_data
attribute has been deprecated in favour ofBreadcrumb#metadata
Breadcrumb#name
attribute has been deprecated in favour ofBreadcrumb#message
Bugsnag::Breadcrumbs
module has been deprecated in favour of the constants available in theBugsnag::BreadcrumbType
moduleFor example,
Bugsnag::Breadcrumbs::ERROR_BREADCRUMB_TYPE
is now available asBugsnag::BreadcrumbType::ERROR
Design
I've avoided using the
alias
keyword as YARD will merge the alias into the original attribute, e.g the "also" here:This makes it impossible to mark the original name as deprecated without also marking the new name as deprecated1:
Therefore I've implemented the aliases manually to give them their own section in the generated API docs:
The new methods use the
@!attribute
directive so YARD generates the docs as if they were attributes and not methods1 I believe you can do it as it's a behaviour of the templates YARD uses, but usually aliases being merged is correct so it doesn't seem worth writing new templates just for this PR