double_entry 2.0.1 → 2.0.2

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
  SHA256:
3
- metadata.gz: 94cf9e4e7931a05b37250722ced311b4cf272bd96a716f36ebec81eaccf1d8fb
4
- data.tar.gz: d55cd976db1dd8c2ccc93658664701a9d6743ff83606c6ece1eaaf3c08d3a9b8
3
+ metadata.gz: 4ad1dc8c5b4f20bfd02e9d7b99fe7054f78bc64fb6f5f654359fba5b77fffb01
4
+ data.tar.gz: 8e76cac38eadd04346fa565084521aa407f172d8a47aaf2f1b6c3e8e62b3c9ff
5
5
  SHA512:
6
- metadata.gz: 5383c40fc2354d1699c63770b2a4b74a664daa9f84645b4497a2c66aa9410de7405dddd51a7c30ccdc8052a035cee346efa63dae9d72ad8269f3126f56a3a81f
7
- data.tar.gz: 22d01c13479911a6c6d57e3ba65952ef0b5693508136e7e6147eda6b1a90332f5d3a32f7247e6d3b53043427b7c47b94e71bc8f1b963f465bf0566c022af7a69
6
+ metadata.gz: 4e874c2bb7a8b0c648dee94a972cbd1586ae8f61363496a720d14fe57065c9fb150f09075914a2bf4c93d4a3472a8315886ad158eb9369a2c9ef6d0176224280
7
+ data.tar.gz: e2bb413346897ea8c0056eabcd98a2553c45c353d90385f1919691bc9a48379b4fe673012c109778e23c402b611df369e9d4f7465c1ec20f888ca4dbf7c041cd
data/CHANGELOG.md CHANGED
@@ -7,7 +7,23 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- [Unreleased]: https://github.com/envato/double_entry/compare/v2.0.1...HEAD
10
+ [Unreleased]: https://github.com/envato/double_entry/compare/v2.0.2...HEAD
11
+
12
+ ## [2.0.2] - 2026-01-05
13
+
14
+ ### Fixed
15
+
16
+ - Fix critical thread-safety issues in locking mechanism by replacing object_id-based
17
+ lock storage with proper thread-local storage. This resolves object ID reuse
18
+ vulnerabilities, race conditions, and memory leaks ([#226]).
19
+
20
+ ### Changed
21
+
22
+ - Run the test suite against Rails 8.1, 8.0, 7.2, and Ruby 4.0, 3.4, 3.3, 3.2 ([#225]).
23
+
24
+ [2.0.2]: https://github.com/envato/double_entry/compare/v2.0.1...v2.0.2
25
+ [#225]: https://github.com/envato/double_entry/pull/225
26
+ [#226]: https://github.com/envato/double_entry/pull/226
11
27
 
12
28
  ## [2.0.1] - 2023-11-01
13
29
 
data/README.md CHANGED
@@ -22,15 +22,15 @@ DoubleEntry uses the [Money gem](https://github.com/RubyMoney/money) to encapsul
22
22
  DoubleEntry is tested against:
23
23
 
24
24
  Ruby
25
- * 2.7.x
26
- * 3.0.x
27
- * 3.1.x
25
+ * 4.0.x
26
+ * 3.4.x
27
+ * 3.3.x
28
28
  * 3.2.x
29
29
 
30
30
  Rails
31
- * 6.0.x
32
- * 6.1.x
33
- * 7.0.x
31
+ * 8.1.x
32
+ * 8.0.x
33
+ * 7.2.x
34
34
 
35
35
  Databases
36
36
  * MySQL
data/double_entry.gemspec CHANGED
@@ -10,14 +10,15 @@ Gem::Specification.new do |gem|
10
10
  gem.authors = ['Envato']
11
11
  gem.email = ['rubygems@envato.com']
12
12
  gem.summary = 'Tools to build your double entry financial ledger'
13
- gem.homepage = 'https://github.com/envato/double_entry'
13
+ gem.homepage = "https://github.com/envato/#{gem.name}"
14
14
  gem.license = 'MIT'
15
15
 
16
16
  gem.metadata = {
17
- 'bug_tracker_uri' => 'https://github.com/envato/double_entry/issues',
18
- 'changelog_uri' => "https://github.com/envato/double_entry/blob/v#{gem.version}/CHANGELOG.md",
19
- 'documentation_uri' => "https://www.rubydoc.info/gems/double_entry/#{gem.version}",
20
- 'source_code_uri' => "https://github.com/envato/double_entry/tree/v#{gem.version}",
17
+ 'allowed_push_host' => 'https://rubygems.org',
18
+ 'bug_tracker_uri' => "#{gem.homepage}/issues",
19
+ 'changelog_uri' => "#{gem.homepage}/blob/v#{gem.version}/CHANGELOG.md",
20
+ 'documentation_uri' => "https://www.rubydoc.info/gems/#{gem.name}/#{gem.version}",
21
+ 'source_code_uri' => "#{gem.homepage}/tree/v#{gem.version}",
21
22
  }
22
23
 
23
24
  gem.files = `git ls-files -z`.split("\x0").select do |f|
@@ -57,8 +57,6 @@ module DoubleEntry
57
57
  end
58
58
 
59
59
  class Lock
60
- @@locks = {}
61
-
62
60
  def initialize(accounts)
63
61
  # Make sure we always lock in the same order, to avoid deadlocks.
64
62
  @accounts = accounts.flatten.sort
@@ -97,15 +95,15 @@ module DoubleEntry
97
95
  private
98
96
 
99
97
  def locks
100
- @@locks[Thread.current.object_id]
98
+ Thread.current[:double_entry_locks]
101
99
  end
102
100
 
103
101
  def locks=(locks)
104
- @@locks[Thread.current.object_id] = locks
102
+ Thread.current[:double_entry_locks] = locks
105
103
  end
106
104
 
107
105
  def remove_locks
108
- @@locks.delete(Thread.current.object_id)
106
+ Thread.current[:double_entry_locks] = nil
109
107
  end
110
108
 
111
109
  # Return true if there's a lock on the given account.
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module DoubleEntry
4
- VERSION = '2.0.1'
4
+ VERSION = '2.0.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: double_entry
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Envato
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2023-11-01 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activerecord
@@ -220,7 +219,6 @@ dependencies:
220
219
  - - ">="
221
220
  - !ruby/object:Gem::Version
222
221
  version: '0'
223
- description:
224
222
  email:
225
223
  - rubygems@envato.com
226
224
  executables: []
@@ -255,11 +253,11 @@ homepage: https://github.com/envato/double_entry
255
253
  licenses:
256
254
  - MIT
257
255
  metadata:
256
+ allowed_push_host: https://rubygems.org
258
257
  bug_tracker_uri: https://github.com/envato/double_entry/issues
259
- changelog_uri: https://github.com/envato/double_entry/blob/v2.0.1/CHANGELOG.md
260
- documentation_uri: https://www.rubydoc.info/gems/double_entry/2.0.1
261
- source_code_uri: https://github.com/envato/double_entry/tree/v2.0.1
262
- post_install_message:
258
+ changelog_uri: https://github.com/envato/double_entry/blob/v2.0.2/CHANGELOG.md
259
+ documentation_uri: https://www.rubydoc.info/gems/double_entry/2.0.2
260
+ source_code_uri: https://github.com/envato/double_entry/tree/v2.0.2
263
261
  rdoc_options: []
264
262
  require_paths:
265
263
  - lib
@@ -274,8 +272,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
274
272
  - !ruby/object:Gem::Version
275
273
  version: '0'
276
274
  requirements: []
277
- rubygems_version: 3.4.21
278
- signing_key:
275
+ rubygems_version: 4.0.3
279
276
  specification_version: 4
280
277
  summary: Tools to build your double entry financial ledger
281
278
  test_files: []