timber 2.6.0 → 2.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c0070dc6695f710539f3827bf7587eefaec03979
4
- data.tar.gz: 775ab9aec9ad834e629ccdddd0ff08e045d76378
3
+ metadata.gz: 695d1eb93a0e891ecc1a3eb47ee4888d0d30fdbc
4
+ data.tar.gz: d1075432948895089dec419679a8fb12194a7631
5
5
  SHA512:
6
- metadata.gz: c8dc7a46f2a2d30a778290a9238d64c0725b6be34f62ff98485fd1d2305e69c359e966d5ff3f111ad31168a364ebf9e9c15e5af9103aaa0c81b334fa0bd8e925
7
- data.tar.gz: 4fe9551096dde4ad67b8e9876e6c1d6bf4f51b9eb155f633ff178abe3dd1544ff867de64d40d065522106ec5e87f1c0d537956a43ed4daa53ac5c00756c03824
6
+ metadata.gz: 6318864253dec537d4e604161e5877873407744d57d738519fc24091a72126dbe3429cf4be85d106f09f28ab41d4513218407094d27aa296575429e22b30f8b9
7
+ data.tar.gz: 90cb2e402a913de26c656bb9b5bef4f49ebeff58e3b06c56b9c335888dd07f434d63f6da473cb993da1f9e537ccead50fabf36877bd7cd6652d98d105fa6a38d
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.6.1] - 2017-11-28
11
+
12
+ ### Fixed
13
+
14
+ - Fixes an issue where a reference to the current custom context map was being capture during log line creation and then later self-modifying to make the context invalid.
15
+
10
16
  ## [2.6.0] - 2017-11-28
11
17
 
12
18
  ### Fixed
@@ -112,7 +118,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
112
118
  instead of applying back pressure.
113
119
 
114
120
 
115
- [Unreleased]: https://github.com/timberio/timber-ruby/compare/v2.6.0...HEAD
121
+ [Unreleased]: https://github.com/timberio/timber-ruby/compare/v2.6.1...HEAD
122
+ [2.6.1]: https://github.com/timberio/timber-ruby/compare/v2.6.0...v2.6.1
116
123
  [2.6.0]: https://github.com/timberio/timber-ruby/compare/v2.5.1...v2.6.0
117
124
  [2.5.1]: https://github.com/timberio/timber-ruby/compare/v2.5.0...v2.5.1
118
125
  [2.5.0]: https://github.com/timberio/timber-ruby/compare/v2.4.0...v2.5.0
@@ -120,7 +120,13 @@ module Timber
120
120
  # since the context can change as execution proceeds. Note that individual contexts
121
121
  # should be immutable, and we implement snapshot caching as a result of this assumption.
122
122
  def snapshot
123
- @snapshot ||= hash.clone
123
+ @snapshot ||= begin
124
+ snapshot = hash.clone
125
+ if snapshot.key?(:custom)
126
+ snapshot[:custom] = hash[:custom].clone
127
+ end
128
+ snapshot
129
+ end
124
130
  end
125
131
 
126
132
  private
@@ -147,6 +147,7 @@ module Timber
147
147
  req['Authorization'] = authorization_payload
148
148
  req['Content-Type'] = CONTENT_TYPE
149
149
  req['User-Agent'] = USER_AGENT
150
+
150
151
  req.body = msgs.to_msgpack
151
152
  req
152
153
  end
@@ -1,3 +1,3 @@
1
1
  module Timber
2
- VERSION = "2.6.0"
2
+ VERSION = "2.6.1"
3
3
  end
@@ -98,6 +98,18 @@ describe Timber::CurrentContext, :rails_23 => true do
98
98
  end
99
99
  end
100
100
 
101
+ describe ".snapshot" do
102
+ it "shoud properly snapshot custom contexts" do
103
+ snapshot = nil
104
+
105
+ described_class.with({build: {version: "1.0.0"}}) do
106
+ snapshot = described_class.instance.snapshot
107
+ end
108
+
109
+ expect(snapshot[:custom]).to eq({:build=>{:version=>"1.0.0"}})
110
+ end
111
+ end
112
+
101
113
  describe ".with" do
102
114
  it "should merge the context and cleanup on block exit" do
103
115
  expect(described_class.instance.send(:hash)[:custom]).to be_nil
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timber
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timber Technologies, Inc.