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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4eb3d525314f165efd021dd4ed43174ee7530a18e8415addab1cea4a26bd241
4
- data.tar.gz: 5878f06386b076b8f2d3fae0999d724ff9696ad9366d35b587a6fa591735a86a
3
+ metadata.gz: 1d0c9076a03bc4094bd5ec7541ce8a5c916a2711a7901c5230340d6d69da81a6
4
+ data.tar.gz: 8c9965f05f6cacefe03fbc2119f7c4d8d1c818b3f49171b00225210b427568a5
5
5
  SHA512:
6
- metadata.gz: 0d4c4c07a2e7c5cd1d8c3a5dbe66e94d0ce328a4d9c4af722e50a906db56530dafa0f808c36d97c7800e7415fdfbdd07c794ae3104eb4fbfb0e8d90efbb1261d
7
- data.tar.gz: a17ef955f23a75e28221cf7f2429554d7b983dd03968b5a0df07cb3864ca6716dbe71b28affddd6ff19a3bedcf3d80001570fd3750638c93e1f333728eed5391
6
+ metadata.gz: 756b6170017c03287422e5999c70f2b416ea9859895aace4f7ff3316bdb50cb66df17d72fc1a9a8d41596aff4866e929fdbdbc5bcb582f280da0150432b4b9a9
7
+ data.tar.gz: 1ee36fdc3162f32947811db380bbbcb06edd27d328facf58801bbd6cfa8e4da2d1ebbee74c0aa5ce990b924fb11cccb68e5698f53fe3d6e555d36c32ab4bc6bb
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.1
1
+ 0.7.2
data/betterlog.gemspec CHANGED
@@ -1,14 +1,14 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: betterlog 0.7.1 ruby lib
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.1"
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-01"
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]
@@ -71,7 +71,7 @@ module Betterlog
71
71
  end
72
72
 
73
73
  def as_hash(*a)
74
- @data
74
+ @data.dup
75
75
  end
76
76
 
77
77
  def to_json(*a)
@@ -1,6 +1,6 @@
1
1
  module Betterlog
2
2
  # Betterlog version
3
- VERSION = '0.7.1'
3
+ VERSION = '0.7.2'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
@@ -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 = Betterlog::Log::Event.new(array: circular_array)
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 = Betterlog::Log::Event.new(hash: circular_hash)
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 = Betterlog::Log::Event.new(ary: ary << ary.dup)
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.1
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-01 00:00:00.000000000 Z
11
+ date: 2019-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_hadar