cacheflow 0.5.0 → 0.6.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: 9e6ffed7d088f3de6a86a75e4ee7e5faf48d51c27fe490b935379f019af402a5
4
- data.tar.gz: 5e9401eab9c1946eff3a97939e35143635a0c5ab919e3df37e2e4eea3e6991fa
3
+ metadata.gz: 83e311f4b1bb6c8bd7a57b7163409bee62be374072bf51ec1177751d1d6e1469
4
+ data.tar.gz: 4df0794c70e520f454d6fa7a0f1369fce78abed94e664dc86513005e60c2a159
5
5
  SHA512:
6
- metadata.gz: 13452dc5badcff289a394f6eeee400a5b560475d1504c89ddaeaa60459eca2c78823bf5cfdf425395d74602c824e3901b707a0e4dfbc8745ea8d17a776777371
7
- data.tar.gz: 5ac6596190d7e9d41e0db4af9931d7a16439cac9b274ffa7747bde6f9687f6add0b36d9c35dd26a5dc8e20ab7949fdd899d37cb060d3fe16d3e2b60e42b926b3
6
+ metadata.gz: 06cb724109dcf6061f6a3635564e8438bfe0100545232d19e99a8980a9325ffe1ee8d1d9d541a70414131c376989c984802fcd80736cf43063e13da943c1ef64
7
+ data.tar.gz: 9da38e3824cccee4a0cb45534d7f2ef94609e8ed4bc4ce59eb81518101688286c11d355d489f4891334d5a582d84e121415f3400476b6d4ae0809b0cda6d9278
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 0.6.0 (2026-04-01)
2
+
3
+ - Added support for Dalli 5
4
+ - Fixed `silence_sidekiq!` method for Sidekiq 7+
5
+ - Dropped support for `redis` < 5
6
+ - Dropped support for Ruby < 3.3 and Active Support < 7.2
7
+
1
8
  ## 0.5.0 (2025-05-05)
2
9
 
3
10
  - Dropped support for Ruby < 3.2 and Active Support < 7.1
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2017-2025 Andrew Kane
1
+ Copyright (c) 2017-2026 Andrew Kane
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Colorized logging for Memcached, Redis, and Valkey
4
4
 
5
- Works with the Rails cache, as well as [Dalli](https://github.com/petergoldstein/dalli) and [Redis](https://github.com/redis/redis-rb) clients directly
5
+ Works with the Rails cache, as well as [Dalli](https://github.com/petergoldstein/dalli), [Redis](https://github.com/redis/redis-rb), and [RedisClient](https://github.com/redis-rb/redis-client) clients directly
6
6
 
7
7
  [![Build Status](https://github.com/ankane/cacheflow/actions/workflows/build.yml/badge.svg)](https://github.com/ankane/cacheflow/actions)
8
8
 
@@ -26,7 +26,7 @@ Cacheflow.silence do
26
26
  end
27
27
  ```
28
28
 
29
- To silence logging for [Sidekiq](https://github.com/mperham/sidekiq) commands, create an initializer with:
29
+ To silence logging for [Sidekiq](https://github.com/sidekiq/sidekiq) commands, create an initializer with:
30
30
 
31
31
  ```ruby
32
32
  Cacheflow.silence_sidekiq!
@@ -34,7 +34,7 @@ Cacheflow.silence_sidekiq!
34
34
 
35
35
  ## Data Protection
36
36
 
37
- If you use Cacheflow in an environment with [personal data](https://en.wikipedia.org/wiki/Personally_identifiable_information) and store that data in Memcached, Redis, or Valkey, it can end up in your app logs. To avoid this, silence logging for those calls.
37
+ If you use Cacheflow in an environment with [personal data](https://en.wikipedia.org/wiki/Personal_data) and store that data in Memcached, Redis, or Valkey, it can end up in your app logs. To avoid this, silence logging for those calls.
38
38
 
39
39
  ## History
40
40
 
@@ -23,9 +23,12 @@ module Cacheflow
23
23
  end
24
24
  end
25
25
 
26
+ if defined?(Dalli::Protocol::Meta)
27
+ Dalli::Protocol::Meta.prepend(Cacheflow::Memcached::Notifications)
28
+ end
29
+
26
30
  if defined?(Dalli::Protocol::Binary)
27
31
  Dalli::Protocol::Binary.prepend(Cacheflow::Memcached::Notifications)
28
- else
29
- Dalli::Server.prepend(Cacheflow::Memcached::Notifications)
30
32
  end
33
+
31
34
  Cacheflow::Memcached::Instrumenter.attach_to(:memcached)
@@ -1,6 +1,5 @@
1
1
  module Cacheflow
2
2
  module Redis
3
- # redis 5 / redis-client
4
3
  module ClientNotifications
5
4
  def call(command, redis_config)
6
5
  payload = {
@@ -21,18 +20,6 @@ module Cacheflow
21
20
  end
22
21
  end
23
22
 
24
- # redis 4
25
- module Notifications
26
- def logging(commands)
27
- payload = {
28
- commands: commands
29
- }
30
- ActiveSupport::Notifications.instrument("query.redis", payload) do
31
- super
32
- end
33
- end
34
- end
35
-
36
23
  class Instrumenter < ActiveSupport::LogSubscriber
37
24
  def query(event)
38
25
  return if !logger.debug? || Cacheflow.silenced?
@@ -50,11 +37,5 @@ module Cacheflow
50
37
  end
51
38
  end
52
39
 
53
- if defined?(RedisClient)
54
- RedisClient.register(Cacheflow::Redis::ClientNotifications)
55
- elsif defined?(Redis)
56
- # redis < 5
57
- Redis::Client.prepend(Cacheflow::Redis::Notifications)
58
- end
59
-
40
+ RedisClient.register(Cacheflow::Redis::ClientNotifications)
60
41
  Cacheflow::Redis::Instrumenter.attach_to(:redis)
@@ -1,7 +1,7 @@
1
1
  module Cacheflow
2
2
  module Sidekiq
3
- module ClassMethods
4
- def redis(*_)
3
+ module InstanceMethods
4
+ def redis(...)
5
5
  Cacheflow.silence do
6
6
  super
7
7
  end
@@ -10,7 +10,7 @@ module Cacheflow
10
10
 
11
11
  module Client
12
12
  module InstanceMethods
13
- def push(*_)
13
+ def push(...)
14
14
  Cacheflow.silence do
15
15
  super
16
16
  end
@@ -20,5 +20,9 @@ module Cacheflow
20
20
  end
21
21
  end
22
22
 
23
- ::Sidekiq.singleton_class.prepend(Cacheflow::Sidekiq::ClassMethods)
23
+ if defined?(::Sidekiq::Capsule)
24
+ ::Sidekiq::Capsule.prepend(Cacheflow::Sidekiq::InstanceMethods)
25
+ end
26
+
27
+ ::Sidekiq::Config.prepend(Cacheflow::Sidekiq::InstanceMethods)
24
28
  ::Sidekiq::Client.prepend(Cacheflow::Sidekiq::Client::InstanceMethods)
@@ -1,3 +1,3 @@
1
1
  module Cacheflow
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
data/lib/cacheflow.rb CHANGED
@@ -7,7 +7,7 @@ require_relative "cacheflow/version"
7
7
  module Cacheflow
8
8
  def self.activate
9
9
  require_relative "cacheflow/memcached" if defined?(Dalli)
10
- require_relative "cacheflow/redis" if defined?(Redis) || defined?(RedisClient)
10
+ require_relative "cacheflow/redis" if defined?(RedisClient)
11
11
  end
12
12
 
13
13
  def self.silenced?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cacheflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: '7.1'
18
+ version: '7.2'
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
- version: '7.1'
25
+ version: '7.2'
26
26
  email: andrew@ankane.org
27
27
  executables: []
28
28
  extensions: []
@@ -48,14 +48,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
48
48
  requirements:
49
49
  - - ">="
50
50
  - !ruby/object:Gem::Version
51
- version: '3.2'
51
+ version: '3.3'
52
52
  required_rubygems_version: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - ">="
55
55
  - !ruby/object:Gem::Version
56
56
  version: '0'
57
57
  requirements: []
58
- rubygems_version: 3.6.7
58
+ rubygems_version: 4.0.6
59
59
  specification_version: 4
60
60
  summary: Colorized logging for Memcached, Redis, and Valkey
61
61
  test_files: []