betterlog 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/betterlog.gemspec +3 -3
- data/lib/betterlog/log/event.rb +1 -1
- data/lib/betterlog/version.rb +1 -1
- data/spec/betterlog/log/event_spec.rb +10 -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: 1d0c9076a03bc4094bd5ec7541ce8a5c916a2711a7901c5230340d6d69da81a6
|
4
|
+
data.tar.gz: 8c9965f05f6cacefe03fbc2119f7c4d8d1c818b3f49171b00225210b427568a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 756b6170017c03287422e5999c70f2b416ea9859895aace4f7ff3316bdb50cb66df17d72fc1a9a8d41596aff4866e929fdbdbc5bcb582f280da0150432b4b9a9
|
7
|
+
data.tar.gz: 1ee36fdc3162f32947811db380bbbcb06edd27d328facf58801bbd6cfa8e4da2d1ebbee74c0aa5ce990b924fb11cccb68e5698f53fe3d6e555d36c32ab4bc6bb
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
1
|
+
0.7.2
|
data/betterlog.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: betterlog 0.7.
|
2
|
+
# stub: betterlog 0.7.2 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "betterlog".freeze
|
6
|
-
s.version = "0.7.
|
6
|
+
s.version = "0.7.2"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib".freeze]
|
10
10
|
s.authors = ["betterplace Developers".freeze]
|
11
|
-
s.date = "2019-11-
|
11
|
+
s.date = "2019-11-06"
|
12
12
|
s.description = "This library provides structure json logging for our rails projects".freeze
|
13
13
|
s.email = "developers@betterplace.org".freeze
|
14
14
|
s.executables = ["betterlog".freeze, "betterlog_pusher".freeze, "betterlog_sink".freeze]
|
data/lib/betterlog/log/event.rb
CHANGED
data/lib/betterlog/version.rb
CHANGED
@@ -1,22 +1,29 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Betterlog::Log::Event do
|
4
|
+
describe '#as_hash' do
|
5
|
+
it 'dups hash before returning it' do
|
6
|
+
event = described_class.new
|
7
|
+
expect(event.as_hash).not_to equal event.instance_variable_get(:@data)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
4
11
|
describe '#to_json' do
|
5
12
|
it 'can deal with circular arrays' do
|
6
13
|
circular_array = [].tap { |arr| arr << arr }
|
7
|
-
event =
|
14
|
+
event = described_class.new(array: circular_array)
|
8
15
|
expect(event.to_json).to include('"array":["circular"]')
|
9
16
|
end
|
10
17
|
|
11
18
|
it 'can deal with circular hashes' do
|
12
19
|
circular_hash = {}.tap { |hash| hash['foo'] = hash }
|
13
|
-
event =
|
20
|
+
event = described_class.new(hash: circular_hash)
|
14
21
|
expect(event.to_json).to include('"hash":{"foo":"circular"}')
|
15
22
|
end
|
16
23
|
|
17
24
|
it 'does not replace repeated scalar objects with "circular"' do
|
18
25
|
ary = [true, false, nil, 23, 3.14]
|
19
|
-
event =
|
26
|
+
event = described_class.new(ary: ary << ary.dup)
|
20
27
|
expect(event.to_json).to include(<<~end.strip)
|
21
28
|
"ary":[true,false,null,23,3.14,[true,false,null,23,3.14]]
|
22
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: betterlog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- betterplace Developers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-11-
|
11
|
+
date: 2019-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gem_hadar
|