Module: Brute::Deprecate
- Defined in:
- lib/brute/deprecate.rb
Overview
Deprecated. This is GemKit::Deprecate
now — the same code, extracted so that other gems could use it, and so that
gem kit deprecations could read one registry rather than two.
extend Brute::Deprecate -> extend GemKit::Deprecate
brute_deprecate -> deprecate
brute_deprecate_constant -> superseded_by
Extending this module still works and still registers: it warns, then extends GemKit::Deprecate for you and aliases the old method names onto the new ones. It will stop working in 5.0.
Constant Summary collapse
- REPLACEMENT =
"GemKit::Deprecate"- REMOVED_IN =
"5.0"- ALIASES =
The names Brute used before the extraction.
deprecatecollides with Gem::Deprecate's own, which is why Brute's carried a prefix; GemKit's namespace does that job instead. { brute_deprecate: :deprecate, brute_deprecate_constant: :superseded_by }.freeze
Class Method Summary collapse
- .extended(base) ⇒ Object
- .pending(version) ⇒ Object
- .register ⇒ Object
- .registry ⇒ Object
- .upcoming(version) ⇒ Object
- .warn(message) ⇒ Object
Class Method Details
.extended(base) ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/brute/deprecate.rb', line 26 def self.extended(base) origin = Gem.location_of_caller.join(":") GemKit::Deprecate.warn( GemKit::Deprecate.("Brute::Deprecate", REPLACEMENT, REMOVED_IN, origin), ) base.extend(GemKit::Deprecate) ALIASES.each { |old, new| base.singleton_class.alias_method(old, new) } end |
.pending(version) ⇒ Object
40 |
# File 'lib/brute/deprecate.rb', line 40 def pending(version) = GemKit::Deprecate.pending(version) |
.register ⇒ Object
42 |
# File 'lib/brute/deprecate.rb', line 42 def register(...) = GemKit::Deprecate.register(...) |
.registry ⇒ Object
39 |
# File 'lib/brute/deprecate.rb', line 39 def registry = GemKit::Deprecate.registry |
.upcoming(version) ⇒ Object
41 |
# File 'lib/brute/deprecate.rb', line 41 def upcoming(version) = GemKit::Deprecate.upcoming(version) |
.warn(message) ⇒ Object
43 |
# File 'lib/brute/deprecate.rb', line 43 def warn() = GemKit::Deprecate.warn() |