factbase 0.19.15 → 0.19.16

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: 0f6fa1160712c0f180b90cc7e3d15f9228c0266f5e8bdb227506aa2c9289cbf8
4
- data.tar.gz: da6b63c4a95759dbc1ea4eb62cd204d4a0ec71dcc31b3bfc853fc197bb7ce183
3
+ metadata.gz: c6b433b19e9886274a31ef1489db8fc911aeacb6de108fa2c6766dcce338f095
4
+ data.tar.gz: '08c3de0e9a7aeac3592ab713c7f683e0388d4c158367c3c28b36c851c0a43386'
5
5
  SHA512:
6
- metadata.gz: 32bab5bb943f397e259d2efd5c8f7ca90ee12da9e8595b416025f06b6ad72890221f20e72cd4e7b787d02102c6faf82b3e2b3bbc8bcd59b7e014fcab80782ee1
7
- data.tar.gz: 25fa777f6fe8aeaf1bf55f92fc326512cc2228b3ec8b7d284d496abcde65c161bf3ad0006fbce73bc284c7d52b72cba49a2e613bb489f0fe25bf14a4a7f9a1cf
6
+ metadata.gz: e7ebb39e5fe6079498a66df157d2fd78852bb709c144f948e4aa5f547a295c883a4b922b3f0d9e6c2d7a05c9c84625b4a08e17e4fd0f0a59f1ed4adc357d6a03
7
+ data.tar.gz: ad5d4d0954cb561b60312e379975a9ce6f61ab5f0945601f09f8e25e3897085318c78b13b9db38a081b72ad58137ed9e98e60375a243812a780b14f765b802c4
data/Gemfile.lock CHANGED
@@ -78,7 +78,7 @@ GEM
78
78
  tsort
79
79
  regexp_parser (2.12.0)
80
80
  rexml (3.4.4)
81
- rubocop (1.88.1)
81
+ rubocop (1.88.2)
82
82
  json (~> 2.3)
83
83
  language_server-protocol (~> 3.17.0.2)
84
84
  lint_roller (~> 1.1.0)
@@ -92,7 +92,7 @@ GEM
92
92
  rubocop-ast (1.50.0)
93
93
  parser (>= 3.3.7.2)
94
94
  prism (~> 1.7)
95
- rubocop-elegant (0.7.0)
95
+ rubocop-elegant (0.7.1)
96
96
  lint_roller (~> 1.1)
97
97
  rubocop (~> 1.75)
98
98
  rubocop-minitest (0.39.1)
@@ -57,12 +57,14 @@ class Factbase::Impatient
57
57
 
58
58
  def each(fb = @fb, params = {}, &)
59
59
  return to_enum(__method__, fb, params) unless block_given?
60
- n = 0
61
- impatient('each') do
62
- @fb.query(@term, @maps).each(fb, params) do |f|
63
- yield(f)
64
- n += 1
60
+ facts =
61
+ impatient('each') do
62
+ @fb.query(@term, @maps).each(fb, params).to_a
65
63
  end
64
+ n = 0
65
+ facts.each do |f|
66
+ yield(f)
67
+ n += 1
66
68
  end
67
69
  n
68
70
  end
data/lib/factbase/inv.rb CHANGED
@@ -7,14 +7,6 @@ require 'decoor'
7
7
  require 'others'
8
8
  require_relative '../factbase'
9
9
 
10
- # @todo #644:30min Add a test that validates YARD docstring examples
11
- # match the actual API signatures. The docstring in this class was
12
- # recently fixed because the block signature was documented as
13
- # |f, fbt| but the actual implementation passes |property, value|.
14
- # A general test that parses docstrings and checks their examples
15
- # against the real method signatures would prevent this class of
16
- # bugs from recurring across the codebase.
17
- #
18
10
  # A decorator of a Factbase, that checks invariants on every set.
19
11
  #
20
12
  # For example, you can use this decorator if you want to make sure that
@@ -25,6 +25,6 @@ class Factbase::Unique < Factbase::TermBase
25
25
  vv = (0..(@operands.size - 1)).map { |i| _values(i, fact, maps, fb) }
26
26
  return false if vv.any?(nil)
27
27
  tuples = Enumerator.product(*vv).to_a
28
- tuples.none? { |t| @seen.include?(t) }.tap { tuples.each { |t| @seen << t } }
28
+ !@seen.intersect?(tuples).tap { tuples.each { |t| @seen << t } }
29
29
  end
30
30
  end
@@ -8,5 +8,5 @@
8
8
  # Copyright:: Copyright (c) 2024-2026 Yegor Bugayenko
9
9
  # License:: MIT
10
10
  class Factbase
11
- VERSION = '0.19.15' unless const_defined?(:VERSION)
11
+ VERSION = '0.19.16' unless const_defined?(:VERSION)
12
12
  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.19.15
4
+ version: 0.19.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko