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 +4 -4
- data/.github/workflows/ci.yml +1 -0
- data/CHANGELOG.md +5 -0
- data/README.md +10 -0
- data/lib/as_deprecation_tracker/railtie.rb +10 -1
- data/lib/as_deprecation_tracker/version.rb +1 -1
- data/test/railtie_test.rb +6 -1
- data/test/test_helper.rb +4 -0
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 94c74b7722e33f69b5743cbfc62be2865ca4c21cca306debf8074a77a7bffdac
|
|
4
|
+
data.tar.gz: 865ab2109f6932f7d6a3b273c96beca663d30f3620f31b0f24c53da51111f6a6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 41e1b084ad9861d787f81595f80051785bba2cecd63510a755d60d0c310159d5185afd1a60f05037d71cbe510f26bb7084b687c21e99cb7daec663c7a83aff9d
|
|
7
|
+
data.tar.gz: 5a4e354638d0097fd9089e09e7a52ebb19b0af04d930717a13641ac091c581befc20bab1133e1e289f8bcde75b13dee425e7457f4d4bff730ad94f7621af888e
|
data/.github/workflows/ci.yml
CHANGED
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
|
-
|
|
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|
|
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
|
-
|
|
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.
|
|
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:
|
|
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.
|
|
94
|
+
rubygems_version: 3.5.9
|
|
95
95
|
signing_key:
|
|
96
96
|
specification_version: 4
|
|
97
97
|
summary: Track known ActiveSupport deprecation warnings
|