as_deprecation_tracker 1.6.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: afbd5cdcd05ef8e999ba0e809a3f9dd9f47f2379c2d2d1f753a5b308652e6ebb
4
- data.tar.gz: cd5f7e4d5934d6f7e8aa67bfbc3487ecc3f21a5498a11ffed3f8bb77223a24dd
3
+ metadata.gz: 94c74b7722e33f69b5743cbfc62be2865ca4c21cca306debf8074a77a7bffdac
4
+ data.tar.gz: 865ab2109f6932f7d6a3b273c96beca663d30f3620f31b0f24c53da51111f6a6
5
5
  SHA512:
6
- metadata.gz: 9ea16660167a5744c86895f2722cc85af01acda3b93f3ec8eef5bd4b470c6f4168037d8105b798b64c809b08353282d872f9707925c5b8ec76d48c59cedb5dab
7
- data.tar.gz: b22dabfa1a44820bd2c30a98b5c6ee9c1c674bd88e4f1c96f4dcc5c7f384b370a29d0a79a0ed016f2ace836fdcdf69933a0951192a16a66910e6040ed9206b6d
6
+ metadata.gz: 41e1b084ad9861d787f81595f80051785bba2cecd63510a755d60d0c310159d5185afd1a60f05037d71cbe510f26bb7084b687c21e99cb7daec663c7a83aff9d
7
+ data.tar.gz: 5a4e354638d0097fd9089e09e7a52ebb19b0af04d930717a13641ac091c581befc20bab1133e1e289f8bcde75b13dee425e7457f4d4bff730ad94f7621af888e
@@ -24,6 +24,7 @@ jobs:
24
24
  - '6.0.5.1'
25
25
  - '6.1.6.1'
26
26
  - '7.0.3.1'
27
+ - '7.1.6'
27
28
  steps:
28
29
  - uses: actions/checkout@v2
29
30
  - name: Setup Ruby
data/CHANGELOG.md CHANGED
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
6
6
  and this project adheres to [Semantic Versioning](http://semver.org/).
7
7
 
8
+ ## 1.7.0
9
+
10
+ ### Fixed
11
+ - Fix compatibility with Rails 7.1 (PR thanks to @lhellebr)
12
+
8
13
  ## 1.6.0
9
14
 
10
15
  ### Fixed
data/README.md CHANGED
@@ -1,3 +1,13 @@
1
+ # This gem is deprecated
2
+
3
+ This gem is no longer maintained and users should consider migrating to
4
+ `deprecation_toolkit` instead, which is more likely to work with newer Ruby and
5
+ Rails versions.
6
+
7
+ * [Shopify: Introducing the deprecation toolkit](https://engineering.shopify.com/blogs/engineering/introducing-the-deprecation-toolkit)
8
+ * [deprecation_toolkit (GitHub)](https://github.com/shopify/deprecation_toolkit)
9
+ * [deprecation_toolkit (RubyGems)](https://rubygems.org/gems/deprecation_toolkit)
10
+
1
11
  # as_deprecation_tracker
2
12
 
3
13
  Tracks known ActiveSupport (Rails) deprecation warnings and catches new issues
@@ -7,7 +7,16 @@ module ASDeprecationTracker
7
7
  class Railtie < ::Rails::Railtie
8
8
  initializer 'as_deprecation_tracker.deprecation_notifications', after: :load_environment_config, if: -> { ASDeprecationTracker.active? } do
9
9
  Receiver.attach_to :rails, ASDeprecationTracker.receiver
10
- ActiveSupport::Deprecation.behavior = :notify if ASDeprecationTracker.config.register_behavior?
10
+
11
+ if ASDeprecationTracker.config.register_behavior?
12
+ # Rails >= 7.1 deprecates ActiveSupport::Deprecation.behavior= in favor of the
13
+ # per-application deprecators registry; older Rails versions don't have it.
14
+ if Rails.application.respond_to?(:deprecators)
15
+ Rails.application.deprecators.behavior = :notify
16
+ else
17
+ ActiveSupport::Deprecation.behavior = :notify
18
+ end
19
+ end
11
20
 
12
21
  whitelist = ASDeprecationTracker.config.whitelist_file
13
22
  ([Rails.root] + engine_roots).each do |root|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ASDeprecationTracker
4
- VERSION = '1.6.0'
4
+ VERSION = '1.7.0'
5
5
  end
data/test/railtie_test.rb CHANGED
@@ -4,6 +4,11 @@ require 'test_helper'
4
4
 
5
5
  class RailtieTest < ASDeprecationTracker::TestCase
6
6
  def test_deprecation_behavior
7
- assert_equal [ActiveSupport::Deprecation::DEFAULT_BEHAVIORS[:notify]], ActiveSupport::Deprecation.behavior
7
+ behavior = if Rails.application.respond_to?(:deprecators)
8
+ ActiveSupport.deprecator.behavior
9
+ else
10
+ ActiveSupport::Deprecation.behavior
11
+ end
12
+ assert_equal [ActiveSupport::Deprecation::DEFAULT_BEHAVIORS[:notify]], behavior
8
13
  end
9
14
  end
data/test/test_helper.rb CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  require 'minitest/autorun'
4
4
  require 'mocha/minitest'
5
+ # Rails < 7.1's active_support/logger_thread_safe_level.rb uses Logger without
6
+ # requiring it, relying on something else to have loaded it first. combustion's
7
+ # minimal footprint doesn't happen to, unlike a typical full Rails app.
8
+ require 'logger'
5
9
  require 'combustion'
6
10
 
7
11
  require 'as_deprecation_tracker'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: as_deprecation_tracker
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominic Cleal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-24 00:00:00.000000000 Z
11
+ date: 2026-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  - !ruby/object:Gem::Version
92
92
  version: '0'
93
93
  requirements: []
94
- rubygems_version: 3.3.7
94
+ rubygems_version: 3.5.9
95
95
  signing_key:
96
96
  specification_version: 4
97
97
  summary: Track known ActiveSupport deprecation warnings