lumberjack 1.2.2 → 1.2.3

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: 12dffa9034387deb6cfc49976ce1bf2c90b35e9a255ac2f4c1a4730cd3de2a24
4
- data.tar.gz: 1c7d4f246228a9b1d0f35e1618afc245e202d496617590d3d876e1b99b67e6c2
3
+ metadata.gz: 55a35b3e0ea957e0a08049bd7a6b7b6e7373d79983e96a6459f1448b1d3d3dbe
4
+ data.tar.gz: 4cd9386b842c1686af145ef3f369219d78846aa4f5fd1223b3234b4ae91f63ef
5
5
  SHA512:
6
- metadata.gz: 24d8eb348cfea7edeba9469e8d7d4c77717aa0b1045050dbce5ecc52f4e53e4c510bb1f8ecf23ea1e3886a7b8bbf0f21870fa1d2f0e964ec4e3dbb0d8af2f8f5
7
- data.tar.gz: cbae4aede2f52a4abf45d3a92729aedbba25a1ef9c58020ab1d120f83bea610e1b83ee10cdc0b35a3ad698685cad6b92925cdaf9009ae1b47cc80f3985e9c4e8
6
+ metadata.gz: 81108d71edd9c6ebd0653d5d8e13587bf0a88796f5682d2b9c602c8977c2ade0f343b9fc3086658c3764cd8d8dd3b8f8ccc8b5cf5bf460225f1719a1116e8742
7
+ data.tar.gz: b7c8f80a651358bb763811d9068c113b72a6948a9e513394a4f456192076e0b654ea101c1c0ce723d14f94f9b574b749ce5f9f9580b3051a8f2cd84d8c1c7a7a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.2.3
2
+
3
+ * Fix structured formatter so no-recursive, duplicate references are allowed.
4
+
1
5
  ## 1.2.2
2
6
 
3
7
  * Prevent infinite loops in the structured formatter where objects have backreferences to each other.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.2
1
+ 1.2.3
@@ -17,22 +17,25 @@ module Lumberjack
17
17
  private
18
18
 
19
19
  def call_with_references(obj, references)
20
- references << obj
21
20
  if obj.is_a?(Hash)
22
21
  hash = {}
22
+ references << obj.object_id
23
23
  obj.each do |name, value|
24
- next if references.include?(value)
24
+ next if references.include?(value.object_id)
25
25
  references << value
26
26
  hash[name.to_s] = call_with_references(value, references)
27
27
  end
28
+ references.delete(obj.object_id)
28
29
  hash
29
30
  elsif obj.is_a?(Enumerable) && obj.respond_to?(:size) && obj.size != Float::INFINITY
30
31
  array = []
32
+ references << obj.object_id
31
33
  obj.each do |value|
32
- next if references.include?(value)
34
+ next if references.include?(value.object_id)
33
35
  references << value
34
36
  array << call_with_references(value, references)
35
37
  end
38
+ references.delete(obj.object_id)
36
39
  array
37
40
  elsif @formatter
38
41
  @formatter.format(obj)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lumberjack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Durand