factbase 0.11.1 → 0.11.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 +4 -4
- data/.rultor.yml +3 -2
- data/Gemfile.lock +1 -1
- data/README.md +24 -24
- data/factbase.gemspec +1 -1
- data/lib/factbase/term.rb +2 -2
- data/lib/factbase/version.rb +13 -0
- data/lib/factbase.rb +1 -2
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be29589dd79cd9d1737bc03dc28e3e4dc6c3115fc09c3369e8d4b617f8a57829
|
4
|
+
data.tar.gz: 57283b8114c03feaf19bbbae3a2b117ab1399026c0b5b9af2059af3356978717
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afad81287f3b28820595f309a6f538a4415541fb212c2df31b034b0fa512698703db6c8be4c3c4389ec6cf355a944b6dc069ebf68b53fe085648d55a0cf1c10c
|
7
|
+
data.tar.gz: a566f40422aeb136517330c70c88348dbd3ea21786ab999de532a709ccdd09394f22cb64da490c0ccba0ef483ba46d2e2416865b4b66856e626904ac05b0809c
|
data/.rultor.yml
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
|
1
2
|
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
2
3
|
# SPDX-License-Identifier: MIT
|
3
4
|
---
|
@@ -16,8 +17,8 @@ release:
|
|
16
17
|
[[ "${tag}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || exit -1
|
17
18
|
bundle exec rake
|
18
19
|
rm -rf *.gem
|
19
|
-
sed -i "s/0\.0\.0/${tag}/g" lib/factbase.rb
|
20
|
-
git add lib/factbase.rb
|
20
|
+
sed -i "s/0\.0\.0/${tag}/g" lib/factbase/version.rb
|
21
|
+
git add lib/factbase/version.rb
|
21
22
|
git commit -m "version set to ${tag}"
|
22
23
|
gem build factbase.gemspec
|
23
24
|
chmod 0600 ../rubygems.yml
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -210,33 +210,33 @@ This is the result of the benchmark:
|
|
210
210
|
<!-- benchmark_begin -->
|
211
211
|
```text
|
212
212
|
user
|
213
|
-
insert 20000 facts 0.
|
214
|
-
export 20000 facts 0.
|
215
|
-
import
|
216
|
-
insert 10 facts 0.
|
217
|
-
query 10 times w/txn 1.
|
218
|
-
query 10 times w/o txn 0.
|
219
|
-
modify 10 attrs w/txn 1.
|
220
|
-
delete 10 facts w/txn 1.
|
221
|
-
(and (eq what 'issue-was-closed') (exists... -> 200 2.
|
222
|
-
(and (eq what 'issue-was-closed') (exists... -> 200/txn 1.
|
223
|
-
(and (eq what 'issue-was-closed') (exists... -> zero 2.
|
224
|
-
(and (eq what 'issue-was-closed') (exists... -> zero/txn 1.
|
225
|
-
(gt time '2024-03-23T03:21:43Z') 0.
|
226
|
-
(gt cost 50) 0.
|
227
|
-
(eq title 'Object Thinking 5000') 0.
|
228
|
-
(and (eq foo 42.998) (or (gt bar 200) (absent zzz))) 0.
|
229
|
-
(eq id (agg (always) (max id))) 0.
|
230
|
-
(join "c<=cost,b<=bar" (eq id (agg (always) (max id)))) 0.
|
231
|
-
delete! 0.
|
232
|
-
Taped.append() x50000 0.
|
233
|
-
Taped.each() x125 1.
|
234
|
-
Taped.delete_if() x375 0.
|
213
|
+
insert 20000 facts 0.618307
|
214
|
+
export 20000 facts 0.021391
|
215
|
+
import 410726 bytes (20000 facts) 0.030150
|
216
|
+
insert 10 facts 0.045651
|
217
|
+
query 10 times w/txn 1.970434
|
218
|
+
query 10 times w/o txn 0.039459
|
219
|
+
modify 10 attrs w/txn 1.819769
|
220
|
+
delete 10 facts w/txn 1.056563
|
221
|
+
(and (eq what 'issue-was-closed') (exists... -> 200 2.125753
|
222
|
+
(and (eq what 'issue-was-closed') (exists... -> 200/txn 1.135618
|
223
|
+
(and (eq what 'issue-was-closed') (exists... -> zero 2.422668
|
224
|
+
(and (eq what 'issue-was-closed') (exists... -> zero/txn 1.288236
|
225
|
+
(gt time '2024-03-23T03:21:43Z') 0.108849
|
226
|
+
(gt cost 50) 0.090092
|
227
|
+
(eq title 'Object Thinking 5000') 0.002640
|
228
|
+
(and (eq foo 42.998) (or (gt bar 200) (absent zzz))) 0.023785
|
229
|
+
(eq id (agg (always) (max id))) 0.252980
|
230
|
+
(join "c<=cost,b<=bar" (eq id (agg (always) (max id)))) 0.655997
|
231
|
+
delete! 0.075510
|
232
|
+
Taped.append() x50000 0.042923
|
233
|
+
Taped.each() x125 1.343819
|
234
|
+
Taped.delete_if() x375 0.830124
|
235
235
|
```
|
236
236
|
|
237
237
|
The results were calculated in [this GHA job][benchmark-gha]
|
238
|
-
on 2025-06-
|
238
|
+
on 2025-06-21 at 08:24,
|
239
239
|
on Linux with 4 CPUs.
|
240
240
|
<!-- benchmark_end -->
|
241
241
|
|
242
|
-
[benchmark-gha]: https://github.com/yegor256/factbase/actions/runs/
|
242
|
+
[benchmark-gha]: https://github.com/yegor256/factbase/actions/runs/15793882855
|
data/factbase.gemspec
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# SPDX-License-Identifier: MIT
|
5
5
|
|
6
6
|
require 'English'
|
7
|
-
require_relative 'lib/factbase'
|
7
|
+
require_relative 'lib/factbase/version'
|
8
8
|
|
9
9
|
Gem::Specification.new do |s|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
|
data/lib/factbase/term.rb
CHANGED
@@ -118,9 +118,9 @@ class Factbase::Term
|
|
118
118
|
def evaluate(fact, maps, fb)
|
119
119
|
send(@op, fact, maps, fb)
|
120
120
|
rescue NoMethodError => e
|
121
|
-
raise "Probably the term '#{@op}' is not defined at #{self}
|
121
|
+
raise "Probably the term '#{@op}' is not defined at #{self}: #{e.message}"
|
122
122
|
rescue StandardError => e
|
123
|
-
raise "#{e.message} at #{self}
|
123
|
+
raise "#{e.message} at #{self}"
|
124
124
|
end
|
125
125
|
|
126
126
|
# Simplify it if possible.
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
4
|
+
# SPDX-License-Identifier: MIT
|
5
|
+
|
6
|
+
# Just version.
|
7
|
+
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
8
|
+
# Copyright:: Copyright (c) 2024-2025 Yegor Bugayenko
|
9
|
+
# License:: MIT
|
10
|
+
class Factbase
|
11
|
+
# Current version of the gem (changed by .rultor.yml on every release)
|
12
|
+
VERSION = '0.11.2' unless const_defined?(:VERSION)
|
13
|
+
end
|
data/lib/factbase.rb
CHANGED
@@ -81,8 +81,7 @@ require 'yaml'
|
|
81
81
|
# Copyright:: Copyright (c) 2024-2025 Yegor Bugayenko
|
82
82
|
# License:: MIT
|
83
83
|
class Factbase
|
84
|
-
|
85
|
-
VERSION = '0.11.1' unless const_defined?(:VERSION)
|
84
|
+
require_relative 'factbase/version'
|
86
85
|
|
87
86
|
# An exception that may be thrown in a transaction, to roll it back.
|
88
87
|
class Rollback < StandardError; end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: factbase
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
@@ -249,6 +249,7 @@ files:
|
|
249
249
|
- lib/factbase/to_json.rb
|
250
250
|
- lib/factbase/to_xml.rb
|
251
251
|
- lib/factbase/to_yaml.rb
|
252
|
+
- lib/factbase/version.rb
|
252
253
|
- renovate.json
|
253
254
|
- test/factbase/cached/test_cached_factbase.rb
|
254
255
|
- test/factbase/cached/test_cached_query.rb
|