lib/xml/kit.rb in xml-kit-0.3.1 vs lib/xml/kit.rb in xml-kit-0.4.0
- old
+ new
@@ -33,19 +33,25 @@
require 'xml/kit/template'
require 'xml/kit/version'
module Xml
module Kit
+ class Error < StandardError; end
+
class << self
def logger
@logger ||= Logger.new(STDOUT)
end
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
end