factbase 0.10.0 → 0.10.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
  SHA256:
3
- metadata.gz: b91c02657bba3cc0c5d801a273b49c9fd18f0faeb94bf366f5e5f7f224dd703b
4
- data.tar.gz: c6a77ef66e2a6b06d6e072c229b1b90f602adc8769f3434239d08b02f119b9c4
3
+ metadata.gz: cddb3957ecbb2cce6a0957e00759aa8c54edc2b6ce1dae45509968cf22894c7a
4
+ data.tar.gz: 880d4fdde6788b80ee1db1a94fdfeed15d98b8fe7a0d8c3c4c0b6611a5cfdf79
5
5
  SHA512:
6
- metadata.gz: 50d3c7680612b0a02bec34b560581b3e1575e95d30511ec61bc7fa1504a42566116960532e2c9f9b0bb1ee6441d0c4eeed3a1b7e9076a7436af7a0a2c3e077ab
7
- data.tar.gz: 69d6fb049f6631fbc9d17ee24d414cfa7c3acd6d3789f73f4613cb10230c0a697c2427eaf8a028db6f61ea1c2e08fb61cf51c34e79cd722c235c0a6127f3c06a
6
+ metadata.gz: ddd8fce247c59e80ab719451fca226e0598459557cdd33cbcaf21fd8e12b6ae23b82e3cf3173d638414ad2654a6e3a40d6cc586a1d8804df9111a68474e87489
7
+ data.tar.gz: 3ef80c4d7e05cc7daa9f8a4e9c38a47c7555693416ab521b2ef589b9abab6ba592e7484171b92df96e77333eae8f36bb85a19e4c9fb63cc2ae06cd3e7d4e2b72
data/Gemfile.lock CHANGED
@@ -26,7 +26,7 @@ GEM
26
26
  elapsed (0.0.1)
27
27
  loog (> 0)
28
28
  tago (> 0)
29
- json (2.10.2)
29
+ json (2.11.3)
30
30
  language_server-protocol (3.17.0.4)
31
31
  lint_roller (1.1.0)
32
32
  logger (1.7.0)
@@ -37,18 +37,18 @@ GEM
37
37
  builder
38
38
  minitest (>= 5.0)
39
39
  ruby-progressbar
40
- nokogiri (1.18.6-arm64-darwin)
40
+ nokogiri (1.18.8-arm64-darwin)
41
41
  racc (~> 1.4)
42
- nokogiri (1.18.6-x64-mingw-ucrt)
42
+ nokogiri (1.18.8-x64-mingw-ucrt)
43
43
  racc (~> 1.4)
44
- nokogiri (1.18.6-x86_64-darwin)
44
+ nokogiri (1.18.8-x86_64-darwin)
45
45
  racc (~> 1.4)
46
- nokogiri (1.18.6-x86_64-linux-gnu)
46
+ nokogiri (1.18.8-x86_64-linux-gnu)
47
47
  racc (~> 1.4)
48
48
  os (1.1.4)
49
49
  others (0.0.3)
50
- parallel (1.26.3)
51
- parser (3.3.7.4)
50
+ parallel (1.27.0)
51
+ parser (3.3.8.0)
52
52
  ast (~> 2.4.1)
53
53
  racc
54
54
  prism (1.4.0)
@@ -67,7 +67,7 @@ GEM
67
67
  psych (>= 4.0.0)
68
68
  regexp_parser (2.10.0)
69
69
  rexml (3.4.1)
70
- rubocop (1.75.2)
70
+ rubocop (1.75.4)
71
71
  json (~> 2.3)
72
72
  language_server-protocol (~> 3.17.0.2)
73
73
  lint_roller (~> 1.1.0)
@@ -78,7 +78,7 @@ GEM
78
78
  rubocop-ast (>= 1.44.0, < 2.0)
79
79
  ruby-progressbar (~> 1.7)
80
80
  unicode-display_width (>= 2.4.0, < 4.0)
81
- rubocop-ast (1.44.0)
81
+ rubocop-ast (1.44.1)
82
82
  parser (>= 3.3.7.2)
83
83
  prism (~> 1.4)
84
84
  rubocop-minitest (0.38.0)
@@ -92,7 +92,7 @@ GEM
92
92
  rubocop-rake (0.7.1)
93
93
  lint_roller (~> 1.1)
94
94
  rubocop (>= 1.72.1)
95
- rubocop-rspec (3.5.0)
95
+ rubocop-rspec (3.6.0)
96
96
  lint_roller (~> 1.1)
97
97
  rubocop (~> 1.72, >= 1.72.1)
98
98
  ruby-progressbar (1.13.0)
@@ -105,7 +105,7 @@ GEM
105
105
  simplecov (~> 0.19)
106
106
  simplecov-html (0.13.1)
107
107
  simplecov_json_formatter (0.1.4)
108
- stringio (3.1.6)
108
+ stringio (3.1.7)
109
109
  tago (0.1.0)
110
110
  threads (0.4.1)
111
111
  backtrace (~> 0)
@@ -3,6 +3,7 @@
3
3
  # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
4
4
  # SPDX-License-Identifier: MIT
5
5
 
6
+ require 'decoor'
6
7
  require_relative '../factbase'
7
8
 
8
9
  # A decorator of an Array with HashMaps, that records facts that have been touched,
@@ -44,7 +45,7 @@ class Factbase::Taped
44
45
  end
45
46
 
46
47
  def <<(map)
47
- @origin << (map)
48
+ @origin << map
48
49
  @inserted.append(map.object_id)
49
50
  end
50
51
 
@@ -82,6 +83,8 @@ class Factbase::Taped
82
83
 
83
84
  # Decorator of Hash.
84
85
  class TapedHash
86
+ decoor(:origin)
87
+
85
88
  def initialize(origin, added)
86
89
  @origin = origin
87
90
  @added = added
@@ -134,7 +137,7 @@ class Factbase::Taped
134
137
 
135
138
  def <<(item)
136
139
  @added.append(@oid)
137
- @origin << (item)
140
+ @origin << item
138
141
  end
139
142
 
140
143
  def uniq!
data/lib/factbase.rb CHANGED
@@ -82,7 +82,7 @@ require 'yaml'
82
82
  # License:: MIT
83
83
  class Factbase
84
84
  # Current version of the gem (changed by .rultor.yml on every release)
85
- VERSION = '0.10.0' unless const_defined?(:VERSION)
85
+ VERSION = '0.10.1' unless const_defined?(:VERSION)
86
86
 
87
87
  # An exception that may be thrown in a transaction, to roll it back.
88
88
  class Rollback < StandardError; end
@@ -485,4 +485,16 @@ class TestFactbase < Factbase::Test
485
485
  end
486
486
  assert_equal(1, fb.size)
487
487
  end
488
+
489
+ def test_get_raise_for_empty_fact
490
+ fb = Factbase.new
491
+ fb.txn do |fbt|
492
+ f = fbt.insert
493
+ f.foo = 123
494
+ f = fbt.query('(always)').each.to_a.first
495
+ assert_equal(123, f.foo)
496
+ ex = assert_raises(RuntimeError) { f.bar }
497
+ assert_equal("Can't find 'bar' attribute out of [foo]", ex.message)
498
+ end
499
+ end
488
500
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: factbase
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-04-15 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: backtrace
@@ -144,8 +144,8 @@ email: yegor256@gmail.com
144
144
  executables: []
145
145
  extensions: []
146
146
  extra_rdoc_files:
147
- - README.md
148
147
  - LICENSE.txt
148
+ - README.md
149
149
  files:
150
150
  - ".0pdd.yml"
151
151
  - ".gitattributes"
@@ -291,7 +291,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
291
291
  - !ruby/object:Gem::Version
292
292
  version: '0'
293
293
  requirements: []
294
- rubygems_version: 3.6.2
294
+ rubygems_version: 3.6.7
295
295
  specification_version: 4
296
296
  summary: Factbase
297
297
  test_files: []