Deprecate `ActiveSupport::Multibyte::Unicode.default_normalization_form`

This commit is contained in:
Rafael Mendonça França 2020-10-29 16:07:24 +00:00
parent 2c6f5c0b8a
commit 6cbc7842f0
No known key found for this signature in database
GPG Key ID: FC23B6D0F1EEE948
3 changed files with 17 additions and 11 deletions

View File

@ -1,3 +1,7 @@
* Deprecate `ActiveSupport::Multibyte::Unicode.default_normalization_form`.
*Rafael Mendonça França*
* Remove deprecated `ActiveSupport::Multibyte::Unicode.pack_graphemes`,
`ActiveSupport::Multibyte::Unicode.unpack_graphemes`,
`ActiveSupport::Multibyte::Unicode.normalize`,

View File

@ -5,20 +5,20 @@ module ActiveSupport
module Unicode
extend self
# A list of all available normalization forms.
# See https://www.unicode.org/reports/tr15/tr15-29.html for more
# information about normalization.
NORMALIZATION_FORMS = [:c, :kc, :d, :kd]
# The Unicode version that is supported by the implementation
UNICODE_VERSION = RbConfig::CONFIG["UNICODE_VERSION"]
# The default normalization used for operations that require
# normalization. It can be set to any of the normalizations
# in NORMALIZATION_FORMS.
#
# ActiveSupport::Multibyte::Unicode.default_normalization_form = :c
attr_accessor :default_normalization_form # TODO: Deprecate
def default_normalization_form
ActiveSupport::Deprecation.warn(
"ActiveSupport::Multibyte::Unicode.default_normalization_form is deprecated and will be removed in Rails 6.1"
)
end
def default_normalization_form=(_)
ActiveSupport::Deprecation.warn(
"ActiveSupport::Multibyte::Unicode.default_normalization_form= is deprecated and will be removed in Rails 6.1"
)
end
# Decompose composed characters to the decomposed form.
def decompose(type, codepoints)

View File

@ -314,6 +314,8 @@ Please refer to the [Changelog][active-support] for detailed changes.
### Deprecations
* Deprecate `ActiveSupport::Multibyte::Unicode.default_normalization_form`.
### Notable changes
Active Job