Commit 08484bf
Changed files (2)
lib
xml
kit
lib/xml/kit/encryption.rb
@@ -18,7 +18,7 @@ module Xml
)
@symmetric_algorithm = symmetric_algorithm
@asymmetric_algorithm = asymmetric_algorithm
- Xml::Kit.deprecate('Encryption is deprecated. Use EncryptedData.')
+ Xml::Kit.deprecate('Encryption', alternative: 'EncryptedData')
super(raw_xml,
symmetric_cipher: symmetric(symmetric_algorithm),
asymmetric_cipher: asymmetric(asymmetric_algorithm, public_key),
lib/xml/kit.rb
@@ -42,9 +42,13 @@ module Xml
attr_writer :logger
- def deprecate(message)
+ def deprecate(name, alternative: nil)
@deprecation ||= ActiveSupport::Deprecation.new('1.0.0', 'xml-kit')
- @deprecation.deprecation_warning(message)
+ if alternative
+ @deprecation.deprecation_warning(name, "Use `#{alternative}` instead")
+ else
+ @deprecation.deprecation_warning(name)
+ end
end
end
end