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 +4 -4
- data/CHANGELOG.md +8 -0
- data/LICENSE.txt +1 -1
- data/lib/cacheflow/memcached.rb +1 -1
- data/lib/cacheflow/redis.rb +3 -4
- data/lib/cacheflow/sidekiq.rb +24 -0
- data/lib/cacheflow/version.rb +1 -1
- data/lib/cacheflow.rb +5 -26
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8932252701f8ea45a6145a7acd8b35363e39ae5bfcbe83f47b9f3bf0cd6ecb37
|
4
|
+
data.tar.gz: adc5342f322a1b3ce32438b1f538fd1b1ef15661c26da0f823d634fc1b0f1146
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c017572ae0499654f13d9fd319dfa01044c5a0714cdbcaad9202838bb21ce0bdf4da2d4771c32e432e2eaa6406e2549fe751742cdc34a71888982e9b2cd75dc1
|
7
|
+
data.tar.gz: 6dc952a1c204bda8c112872d29546b93a464622bb49faceadce4b840377847288d9023ced4edcb2ef71c09d51e75d015e25408899fc1c79c193ea50b629761f5
|
data/CHANGELOG.md
CHANGED
data/LICENSE.txt
CHANGED
data/lib/cacheflow/memcached.rb
CHANGED
@@ -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
|
data/lib/cacheflow/redis.rb
CHANGED
@@ -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
|
-
|
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)
|
data/lib/cacheflow/version.rb
CHANGED
data/lib/cacheflow.rb
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
require "active_support"
|
3
3
|
|
4
4
|
# modules
|
5
|
-
|
5
|
+
require_relative "cacheflow/version"
|
6
6
|
|
7
7
|
module Cacheflow
|
8
8
|
def self.activate
|
9
|
-
|
10
|
-
|
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
|
-
|
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
|
-
|
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.
|
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:
|
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.
|
61
|
+
rubygems_version: 3.4.10
|
61
62
|
signing_key:
|
62
63
|
specification_version: 4
|
63
64
|
summary: Colorized logging for Memcached and Redis
|