Class: Cape::Deprecation::Base Abstract Private
- Inherits:
-
Object
- Object
- Cape::Deprecation::Base
- Defined in:
- lib/cape/deprecation/base.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Prints to a stream a message related to deprecated API usage.
Direct Known Subclasses
CapistranoDeprecatedDefineRakeWrapper, DSLDeprecatedMirrorRakeTasks
Instance Attribute Summary collapse
-
#stream ⇒ IO
private
The stream to which deprecation messages are printed.
Instance Method Summary collapse
-
#formatted_message ⇒ String
private
Formats #message_content for display.
-
#message_content ⇒ Object
abstract
private
Prepares a message based on deprecated API usage.
-
#write_formatted_message_to_stream ⇒ Base
private
Writes #formatted_message to #stream.
Instance Attribute Details
#stream ⇒ 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 stream to which deprecation messages are printed. Defaults to $stderr.
43 44 45 |
# File 'lib/cape/deprecation/base.rb', line 43 def stream @stream ||= $stderr end |
Instance Method Details
#formatted_message ⇒ String
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.
Formats #message_content for display.
22 23 24 25 26 27 28 |
# File 'lib/cape/deprecation/base.rb', line 22 def [].tap do |fragments| fragments << XTerm.bold_and_foreground_red('*** DEPRECATED:') fragments << ' ' fragments << XTerm.bold() end.join end |
#message_content ⇒ Object
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.
Prepares a message based on deprecated API usage.
35 36 37 |
# File 'lib/cape/deprecation/base.rb', line 35 def raise ::NotImplementedError end |
#write_formatted_message_to_stream ⇒ Base
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.
Writes #formatted_message to #stream.
50 51 52 53 |
# File 'lib/cape/deprecation/base.rb', line 50 def stream.puts self end |