Class: Aker::Deprecation::StderrMode
- Inherits:
-
Object
- Object
- Aker::Deprecation::StderrMode
- Defined in:
- lib/aker/deprecation.rb
Overview
The default deprecation handler for Aker. When a deprecated method is invoked, it does one of two things:
-
If the method is only deprecated (i.e., slated for removal in a future release), it prints a warning to standard error.
-
If a method’s deprecation version is passed, it throws an ObsoleteError.
The motivation of the latter behavior is to force users to remove obsolete code before the hints about what to replace it with are removed.
Instance Method Summary collapse
Instance Method Details
#report(level, message, version) ⇒ void
This method returns an undefined value.
92 93 94 95 96 97 |
# File 'lib/aker/deprecation.rb', line 92 def report(level, , version) case level when :deprecated; $stderr.puts ; when :obsolete; raise ObsoleteError.new() end end |