Skip to content

Commit

Permalink
Improve Deprecation guide in CONTRIBUTING docs
Browse files Browse the repository at this point in the history
- Fix broken link
- Add an example of how to use the Deprecate Gem
  • Loading branch information
Stefanni Brasil authored Dec 20, 2022
1 parent 63e5639 commit b2eb378
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,23 @@ end

## Removing generators

To remove a generator or any other public method, deprecate them first. We use the `Gem::Deprecate`[https://ruby-doc.org/stdlib-3.1.0/libdoc/rubygems/rdoc/Gem/Deprecate.html].

To deprecate a method/argument, add `extend Gem::Deprecate` to the top of the class, and use the `deprecate` method.
To remove a generator or any other public method, deprecate them first. We use the [`Gem::Deprecate`](https://ruby-doc.org/stdlib-3.1.0/libdoc/rubygems/rdoc/Gem/Deprecate.html).

To deprecate a method/argument, add `extend Gem::Deprecate` to the top of the class, and use the `deprecate` method. For example:

```rb
module Faker
class LoremPixel < Base
class << self
extend Gem::Deprecate
def image
...
end
deprecate :image, 'Faker::LoremFlickr.image', 2022, 12
end
end
end
```

## YAML files

Expand Down

0 comments on commit b2eb378

Please sign in to comment.