lumberjack 1.2.1 → 1.2.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 +4 -0
- data/VERSION +1 -1
- data/lib/lumberjack/formatter/structured_formatter.rb +17 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12dffa9034387deb6cfc49976ce1bf2c90b35e9a255ac2f4c1a4730cd3de2a24
|
4
|
+
data.tar.gz: 1c7d4f246228a9b1d0f35e1618afc245e202d496617590d3d876e1b99b67e6c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24d8eb348cfea7edeba9469e8d7d4c77717aa0b1045050dbce5ecc52f4e53e4c510bb1f8ecf23ea1e3886a7b8bbf0f21870fa1d2f0e964ec4e3dbb0d8af2f8f5
|
7
|
+
data.tar.gz: cbae4aede2f52a4abf45d3a92729aedbba25a1ef9c58020ab1d120f83bea610e1b83ee10cdc0b35a3ad698685cad6b92925cdaf9009ae1b47cc80f3985e9c4e8
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.2
|
@@ -11,15 +11,29 @@ module Lumberjack
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def call(obj)
|
14
|
+
call_with_references(obj, Set.new)
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def call_with_references(obj, references)
|
20
|
+
references << obj
|
14
21
|
if obj.is_a?(Hash)
|
15
22
|
hash = {}
|
16
|
-
references ||= Set.new
|
17
23
|
obj.each do |name, value|
|
18
|
-
|
24
|
+
next if references.include?(value)
|
25
|
+
references << value
|
26
|
+
hash[name.to_s] = call_with_references(value, references)
|
19
27
|
end
|
20
28
|
hash
|
21
29
|
elsif obj.is_a?(Enumerable) && obj.respond_to?(:size) && obj.size != Float::INFINITY
|
22
|
-
|
30
|
+
array = []
|
31
|
+
obj.each do |value|
|
32
|
+
next if references.include?(value)
|
33
|
+
references << value
|
34
|
+
array << call_with_references(value, references)
|
35
|
+
end
|
36
|
+
array
|
23
37
|
elsif @formatter
|
24
38
|
@formatter.format(obj)
|
25
39
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lumberjack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Durand
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|