This (tentatively) adds support for registering deprecation message normalizers, and provides built in normalization of paths by looking for the following strings:
appearances of Dir.pwd, which are replaced with #{Dir.pwd}
appearances of any of Gem.path's paths, which are replaced with #{Gem.path[index]}, where index is the index of the path in the Gem.path array
Replacements are made to look like interpolation, so it is clear what they represent.
This should resolve #48.
⚠️ Before Merging
[ ] Validate approach
Should normalizers be expected to mutate the message (to avoid duplicate string allocations), or is it clearer if they return the normalized message (at the cost of creating duplicate objects)?
[x] Write tests
[ ] Consider other safe built in replacements that may have been missed.
What happens if a gem is sourced from somewhere non standard? e.g. GitHub? Path?
Summary
This (tentatively) adds support for registering deprecation message normalizers, and provides built in normalization of paths by looking for the following strings:
Dir.pwd
, which are replaced with#{Dir.pwd}
Gem.path
's paths, which are replaced with#{Gem.path[index]}
, whereindex
is the index of the path in theGem.path
arrayReplacements are made to look like interpolation, so it is clear what they represent.
This should resolve #48.
⚠️ Before Merging
README.md
CHANGELOG.md