Module: Autoloaded::Deprecation Private
- Defined in:
- lib/autoloaded/deprecation.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Prints deprecation messages to stderr.
Class Attribute Summary collapse
-
.io ⇒ IO
private
The deprecation stream.
Class Method Summary collapse
-
.deprecate(keywords) ⇒ Module
private
Prints a deprecation message to #io regarding the specified deprecated_usage.
Class Attribute Details
.io ⇒ IO
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The deprecation stream. Defaults to $stderr.
18 19 20 |
# File 'lib/autoloaded/deprecation.rb', line 18 def io @io || $stderr end |
Class Method Details
.deprecate(keywords) ⇒ Module
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Prints a deprecation message to #io regarding the specified deprecated_usage.
36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/autoloaded/deprecation.rb', line 36 def deprecate(keywords) deprecated_usage = fetch(keywords, :deprecated_usage) sanctioned_usage = fetch(keywords, :sanctioned_usage) source_filename = fetch(keywords, :source_filename) deprecation = "\e[33m*** \e[7m DEPRECATED \e[0m " + "\e[4m#{deprecated_usage}\e[0m -- use " + "\e[4m#{sanctioned_usage}\e[0m instead in #{source_filename}" io.puts deprecation self end |