deprecation_collector 0.7.0 → 0.7.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81d6dd372292acd1a8e2fcddc6ed4ca2f8f2d4ab73f9894318ba26067e96a8a0
|
4
|
+
data.tar.gz: c4884163cbc574b1ce86d4a799c51507b88e2dbaa2f1c720c1d7362e1e39e7c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d17b36f5eee269337f20ca2901db6fb12f59d4fedc6a440be878e05956b742c69da0169ada8f89cd86e9d003e8a58421b00b18a767f23ce43ab0f17071aa0c4
|
7
|
+
data.tar.gz: a9902de9301144e6ed222eb786d32f1a13c3f504598d0dcc9d7479876c8fe0df566df1d6dc22af5695027c09231e360b72fbf9230632aacc9bd83656e08918e3
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
== 0.7.2
|
2
|
+
- fix error `undefined method instance_of? for Redis::Future` for redis < 5
|
3
|
+
|
4
|
+
== 0.7.1
|
5
|
+
- fix ruby 2.7 on rails 7.1
|
6
|
+
|
1
7
|
== 0.7.0
|
2
8
|
- support for Rails 7.1
|
3
9
|
- make install critical section smaller to prevent installation deprecations preventing installation
|
@@ -40,7 +40,7 @@ class DeprecationCollector
|
|
40
40
|
def tap_activesupport
|
41
41
|
# TODO: a more polite hook
|
42
42
|
# not polite to turn off all other possible behaviors, but otherwise may get duplicate calls
|
43
|
-
if Rails.respond_to?(:gem_version) && Rails.gem_version >= "7.1"
|
43
|
+
if Rails.respond_to?(:gem_version) && Rails.gem_version >= Gem::Version.new("7.1")
|
44
44
|
Rails.application.deprecators.behavior = ACTIVE_SUPPORT_BEHAVIORS[:rails71] if Rails.application&.deprecators
|
45
45
|
# Rails.application.deprecators.behavior only captures new-style deprecations, but we need all:
|
46
46
|
if ActiveSupport::Deprecation.respond_to?(:_instance)
|
@@ -109,6 +109,8 @@ class DeprecationCollector
|
|
109
109
|
|
110
110
|
def flush(force: false)
|
111
111
|
return unless force || (current_time > @last_write_time + @write_interval)
|
112
|
+
# do not disturb existing redis connection if already in pipeline, hope that will be flushed some other time
|
113
|
+
return if in_redis_pipeline?
|
112
114
|
|
113
115
|
deprecations_to_flush = nil
|
114
116
|
@deprecations_mutex.synchronize do
|
@@ -182,6 +184,11 @@ class DeprecationCollector
|
|
182
184
|
end
|
183
185
|
|
184
186
|
protected
|
187
|
+
def in_redis_pipeline?
|
188
|
+
return false if Gem::Version.new(::Redis::VERSION) >= Gem::Version.new("5.0")
|
189
|
+
|
190
|
+
redis.instance_variable_get(:@client) != redis.instance_variable_get(:@original_client)
|
191
|
+
end
|
185
192
|
|
186
193
|
def enabled_flag_key
|
187
194
|
@enabled_flag_key ||= "#{@key_prefix}:enabled" # usually deprecations:enabled
|
@@ -51,7 +51,7 @@ class DeprecationCollector
|
|
51
51
|
return unless defined?(ActiveSupport::Deprecation)
|
52
52
|
|
53
53
|
deprecator = ActiveSupport::Deprecation
|
54
|
-
deprecator = ActiveSupport::Deprecation.new("0.0", "deprecation_collector") if Rails.gem_version >= "7.1"
|
54
|
+
deprecator = ActiveSupport::Deprecation.new("0.0", "deprecation_collector") if Rails.gem_version >= Gem::Version.new("7.1")
|
55
55
|
|
56
56
|
-> { deprecator.warn("Test deprecation") } []
|
57
57
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deprecation_collector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vasily Fedoseyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
78
|
- !ruby/object:Gem::Version
|
79
79
|
version: '0'
|
80
80
|
requirements: []
|
81
|
-
rubygems_version: 3.
|
81
|
+
rubygems_version: 3.1.6
|
82
82
|
signing_key:
|
83
83
|
specification_version: 4
|
84
84
|
summary: Collector for ruby/rails deprecations and warnings, suitable for production
|