diff --git a/NEWS.md b/NEWS.md index dfd2e59c..d1c9c446 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,11 @@ ## [unreleased] +## Release v2.3.1/v1.5.1 (20-12-2024) + +- Fallback to Ruby's Warning module if ActiveSupport doesn't exist. Relevant for old Rails versions. +- Added documentation on how to _"properly"_ configure the deprecator in a Rails application. + ## Release v2.3.0/v1.5.0 (19-12-2024) - Use ActiveSupport's deprecation machinery instead of Ruby's Warning module. diff --git a/lib/arel_extensions/version.rb b/lib/arel_extensions/version.rb index 9ddaeb1a..2fa4a351 100644 --- a/lib/arel_extensions/version.rb +++ b/lib/arel_extensions/version.rb @@ -1,3 +1,3 @@ module ArelExtensions - VERSION = '2.3.0'.freeze + VERSION = '2.3.1'.freeze end diff --git a/lib/arel_extensions/warning.rb b/lib/arel_extensions/warning.rb index f59a9b75..375c4b67 100644 --- a/lib/arel_extensions/warning.rb +++ b/lib/arel_extensions/warning.rb @@ -1,18 +1,25 @@ module ArelExtensions - if RUBY_VERSION.split('.')[0].to_i < 3 - class RubyDeprecator + class RubyDeprecator + if RUBY_VERSION.split('.')[0].to_i < 3 def warn msg Kernel.warn(msg) end - end - else - class RubyDeprecator + else def warn msg Kernel.warn(msg, category: :deprecated) end end end + # To configure deprecations in a Rails application, you can do something + # like this: + # + # ```ruby + # ArelExtensions.deprecator.behavior = + # (Rails.application.config.active_support.deprecation || :stderr) + # ``` + # + # See ActiveSupport's deprecation documentation for more details. def self.deprecator @deprecator ||= if defined?(ActiveSupport::Deprecation) diff --git a/version_v1.rb b/version_v1.rb index e1fb7b4c..94fec7a4 100644 --- a/version_v1.rb +++ b/version_v1.rb @@ -1,3 +1,3 @@ module ArelExtensions - VERSION = '1.5.0'.freeze + VERSION = '1.5.1'.freeze end diff --git a/version_v2.rb b/version_v2.rb index 9ddaeb1a..2fa4a351 100644 --- a/version_v2.rb +++ b/version_v2.rb @@ -1,3 +1,3 @@ module ArelExtensions - VERSION = '2.3.0'.freeze + VERSION = '2.3.1'.freeze end