redis-rails-instrumentation 1.0.0 → 1.0.1
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d418b58a6ea59c34e95c91b1d87d46b25a9f866
|
4
|
+
data.tar.gz: e48976db5221830f7662151ec552b5e78d0b9a16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf2f31155b84b0ddf1c1a73c004e516fe592be8b4fe4eaf18a8f862ed2126bbf0260fc2f91059514f760f14d2f0ca8858cf281af34b32d55c8d766f5d88cc224
|
7
|
+
data.tar.gz: 32aec6f8232e929462dd043a0d0da301a2a2d7103787f19ea33b2453c60cb73f2dd7af5f991256305ebf6c8125eb400c937e24e5231a55fcb6f412e120855769
|
data/.travis.yml
CHANGED
@@ -17,7 +17,7 @@ class Redis
|
|
17
17
|
|
18
18
|
output = cmds.map do |name, *args|
|
19
19
|
if !args.empty?
|
20
|
-
"[ #{name.to_s.upcase} #{args
|
20
|
+
"[ #{name.to_s.upcase} #{format_arguments(args)} ]"
|
21
21
|
else
|
22
22
|
"[ #{name.to_s.upcase} ]"
|
23
23
|
end
|
@@ -25,6 +25,18 @@ class Redis
|
|
25
25
|
|
26
26
|
debug message(event, 'Redis', output)
|
27
27
|
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def format_arguments(args)
|
32
|
+
args.map do |arg|
|
33
|
+
if arg.respond_to?(:encoding) && arg.encoding == Encoding::ASCII_8BIT
|
34
|
+
'<BINARY DATA>'
|
35
|
+
else
|
36
|
+
arg
|
37
|
+
end
|
38
|
+
end.join(' ')
|
39
|
+
end
|
28
40
|
end
|
29
41
|
end
|
30
42
|
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
require 'redis'
|
3
|
+
require 'base64'
|
3
4
|
|
4
5
|
class Redis
|
5
6
|
module Rails
|
@@ -42,6 +43,14 @@ class Redis
|
|
42
43
|
.to match(/Redis \(\d+\.\d+ms\) \[ GET test \]/)
|
43
44
|
end
|
44
45
|
|
46
|
+
it 'truncates binary data' do
|
47
|
+
@logger.level = Logger::DEBUG
|
48
|
+
Instrumentation::Railtie.run_initializers
|
49
|
+
redis.set('test', Base64.decode64("R0lGODlhAQABAPAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="))
|
50
|
+
expect(@logger.logged(:debug)[0])
|
51
|
+
.to match(/Redis \(\d+\.\d+ms\) \[ SET test <BINARY DATA> \]/)
|
52
|
+
end
|
53
|
+
|
45
54
|
it 'omits debug logging in production' do
|
46
55
|
@logger.level = Logger::ERROR
|
47
56
|
Instrumentation::Railtie.run_initializers
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redis-rails-instrumentation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ville Lautanala
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|