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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e27fe11aa944dcd02303229649c86810bd2585e18c86ec227b113d2a50633ec4
4
- data.tar.gz: a3fad9da51b5201a84f71177475a8b768bb037f6f7dc9fbc01f61b076e9a6559
3
+ metadata.gz: be29589dd79cd9d1737bc03dc28e3e4dc6c3115fc09c3369e8d4b617f8a57829
4
+ data.tar.gz: 57283b8114c03feaf19bbbae3a2b117ab1399026c0b5b9af2059af3356978717
5
5
  SHA512:
6
- metadata.gz: cef5dbc22c5692f7e3219cfc11802ba7b114cdd5d30ae65e20960186b919ff69b6a5015e7fc5985644713dd852b624e9575784496b62e8155c254871dac9b3d4
7
- data.tar.gz: ed05d5bf86469a9c30c7f66c03222b65ec4b3a02ac9a403bda966914538c83e27be9d4ffc6a0e7e8890dc00a57d2e21810cc3b6ac8b98bd66a28d9dcefcbe469
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
@@ -22,7 +22,7 @@ GEM
22
22
  builder (3.3.0)
23
23
  concurrent-ruby (1.3.5)
24
24
  date (3.4.1)
25
- decoor (0.0.1)
25
+ decoor (0.1.0)
26
26
  docile (1.4.1)
27
27
  elapsed (0.0.1)
28
28
  loog (> 0)
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.606861
214
- export 20000 facts 0.029288
215
- import 410768 bytes (20000 facts) 0.029856
216
- insert 10 facts 0.042954
217
- query 10 times w/txn 1.951537
218
- query 10 times w/o txn 0.038436
219
- modify 10 attrs w/txn 1.815854
220
- delete 10 facts w/txn 1.023006
221
- (and (eq what 'issue-was-closed') (exists... -> 200 2.130857
222
- (and (eq what 'issue-was-closed') (exists... -> 200/txn 1.146039
223
- (and (eq what 'issue-was-closed') (exists... -> zero 2.424541
224
- (and (eq what 'issue-was-closed') (exists... -> zero/txn 1.297135
225
- (gt time '2024-03-23T03:21:43Z') 0.109071
226
- (gt cost 50) 0.092356
227
- (eq title 'Object Thinking 5000') 0.002707
228
- (and (eq foo 42.998) (or (gt bar 200) (absent zzz))) 0.024449
229
- (eq id (agg (always) (max id))) 0.257526
230
- (join "c<=cost,b<=bar" (eq id (agg (always) (max id)))) 0.650843
231
- delete! 0.075867
232
- Taped.append() x50000 0.038991
233
- Taped.each() x125 1.321896
234
- Taped.delete_if() x375 0.830375
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-03 at 09:54,
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/15414210508
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}:\n#{Backtrace.new(e)}"
121
+ raise "Probably the term '#{@op}' is not defined at #{self}: #{e.message}"
122
122
  rescue StandardError => e
123
- raise "#{e.message} at #{self}:\n#{Backtrace.new(e)}"
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
- # Current version of the gem (changed by .rultor.yml on every release)
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.1
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