cacheflow 0.3.0 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dc96e1e878dacf8275f2113b546cfab2d64baa98df3187c6b828c6f5397e9d6a
4
- data.tar.gz: 181f8cd6e5c6c0f1abd5a349d5ebef1892c31e609148577c6a262b1c4ba2c9f7
3
+ metadata.gz: 8932252701f8ea45a6145a7acd8b35363e39ae5bfcbe83f47b9f3bf0cd6ecb37
4
+ data.tar.gz: adc5342f322a1b3ce32438b1f538fd1b1ef15661c26da0f823d634fc1b0f1146
5
5
  SHA512:
6
- metadata.gz: f174f62627d4c487ca492cf416cefa2369f713bfaefcac323ab6d0db8eae60aa29730af6d999db188f7a41c8413a4162fe6f4ed5a63aa773d72e9bfa1c1c17be
7
- data.tar.gz: 1a58a047b78cc91760e7336bd3b014d716d01c7ccc8312ef5c8a045fdeaf5ebb1647a7b97b7e8136475a624215c4ba5e5dca8e13fba13333517d878203ab25df
6
+ metadata.gz: c017572ae0499654f13d9fd319dfa01044c5a0714cdbcaad9202838bb21ce0bdf4da2d4771c32e432e2eaa6406e2549fe751742cdc34a71888982e9b2cd75dc1
7
+ data.tar.gz: 6dc952a1c204bda8c112872d29546b93a464622bb49faceadce4b840377847288d9023ced4edcb2ef71c09d51e75d015e25408899fc1c79c193ea50b629761f5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 0.3.2 (2023-12-07)
2
+
3
+ - Fixed deprecation warning with Active Support 7.1
4
+
5
+ ## 0.3.1 (2023-02-15)
6
+
7
+ - Fixed error with `redis-client`
8
+
1
9
  ## 0.3.0 (2022-09-05)
2
10
 
3
11
  - Added support for `redis` 5 and `redis-client` gems
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2017-2022 Andrew Kane
1
+ Copyright (c) 2017-2023 Andrew Kane
2
2
 
3
3
  MIT License
4
4
 
@@ -17,7 +17,7 @@ module Cacheflow
17
17
  return if !logger.debug? || Cacheflow.silenced?
18
18
 
19
19
  name = "%s (%.2fms)" % ["Memcached", event.duration]
20
- debug " #{color(name, BLUE, true)} #{event.payload[:op].to_s.upcase} #{event.payload[:args].join(" ")}"
20
+ debug " #{color(name, BLUE, bold: true)} #{event.payload[:op].to_s.upcase} #{event.payload[:args].join(" ")}"
21
21
  end
22
22
  end
23
23
  end
@@ -44,7 +44,7 @@ module Cacheflow
44
44
  commands << "#{op.to_s.upcase} #{args.join(" ")}".strip
45
45
  end
46
46
 
47
- debug " #{color(name, RED, true)} #{commands.join(" >> ")}"
47
+ debug " #{color(name, RED, bold: true)} #{commands.join(" >> ")}"
48
48
  end
49
49
  end
50
50
  end
@@ -52,9 +52,8 @@ end
52
52
 
53
53
  if defined?(RedisClient)
54
54
  RedisClient.register(Cacheflow::Redis::ClientNotifications)
55
- end
56
-
57
- if Redis::VERSION.to_i < 5
55
+ elsif defined?(Redis)
56
+ # redis < 5
58
57
  Redis::Client.prepend(Cacheflow::Redis::Notifications)
59
58
  end
60
59
 
@@ -0,0 +1,24 @@
1
+ module Cacheflow
2
+ module Sidekiq
3
+ module ClassMethods
4
+ def redis(*_)
5
+ Cacheflow.silence do
6
+ super
7
+ end
8
+ end
9
+ end
10
+
11
+ module Client
12
+ module InstanceMethods
13
+ def push(*_)
14
+ Cacheflow.silence do
15
+ super
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+
23
+ ::Sidekiq.singleton_class.prepend(Cacheflow::Sidekiq::ClassMethods)
24
+ ::Sidekiq::Client.prepend(Cacheflow::Sidekiq::Client::InstanceMethods)
@@ -1,3 +1,3 @@
1
1
  module Cacheflow
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.2"
3
3
  end
data/lib/cacheflow.rb CHANGED
@@ -2,12 +2,12 @@
2
2
  require "active_support"
3
3
 
4
4
  # modules
5
- require "cacheflow/version"
5
+ require_relative "cacheflow/version"
6
6
 
7
7
  module Cacheflow
8
8
  def self.activate
9
- require "cacheflow/memcached" if defined?(Dalli)
10
- require "cacheflow/redis" if defined?(Redis) || defined?(RedisClient)
9
+ require_relative "cacheflow/memcached" if defined?(Dalli)
10
+ require_relative "cacheflow/redis" if defined?(Redis) || defined?(RedisClient)
11
11
  end
12
12
 
13
13
  def self.silenced?
@@ -25,33 +25,12 @@ module Cacheflow
25
25
  end
26
26
 
27
27
  def self.silence_sidekiq!
28
- ::Sidekiq.singleton_class.prepend(Cacheflow::Sidekiq::ClassMethods)
29
- ::Sidekiq::Client.prepend(Cacheflow::Sidekiq::Client::InstanceMethods)
30
- end
31
-
32
- module Sidekiq
33
- module ClassMethods
34
- def redis(*_)
35
- Cacheflow.silence do
36
- super
37
- end
38
- end
39
- end
40
-
41
- module Client
42
- module InstanceMethods
43
- def push(*_)
44
- Cacheflow.silence do
45
- super
46
- end
47
- end
48
- end
49
- end
28
+ require_relative "cacheflow/sidekiq"
50
29
  end
51
30
  end
52
31
 
53
32
  if defined?(Rails)
54
- require "cacheflow/railtie"
33
+ require_relative "cacheflow/railtie"
55
34
  else
56
35
  Cacheflow.activate
57
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cacheflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-05 00:00:00.000000000 Z
11
+ date: 2023-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -37,6 +37,7 @@ files:
37
37
  - lib/cacheflow/memcached.rb
38
38
  - lib/cacheflow/railtie.rb
39
39
  - lib/cacheflow/redis.rb
40
+ - lib/cacheflow/sidekiq.rb
40
41
  - lib/cacheflow/version.rb
41
42
  homepage: https://github.com/ankane/cacheflow
42
43
  licenses:
@@ -57,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
57
58
  - !ruby/object:Gem::Version
58
59
  version: '0'
59
60
  requirements: []
60
- rubygems_version: 3.3.7
61
+ rubygems_version: 3.4.10
61
62
  signing_key:
62
63
  specification_version: 4
63
64
  summary: Colorized logging for Memcached and Redis