factbase 0.14.7 → 0.15.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 +4 -4
- data/Gemfile.lock +5 -5
- data/README.md +6 -12
- data/factbase.gemspec +4 -4
- data/lib/factbase/fact.rb +1 -1
- data/lib/factbase/fact_as_yaml.rb +10 -1
- data/lib/factbase/indexed/indexed_term.rb +6 -1
- data/lib/factbase/terms/ordering.rb +17 -8
- data/lib/factbase/version.rb +1 -1
- metadata +8 -88
- data/.0pdd.yml +0 -8
- data/.gitattributes +0 -7
- data/.github/publish-benchmark.sh +0 -24
- data/.github/workflows/actionlint.yml +0 -25
- data/.github/workflows/benchmark.yml +0 -36
- data/.github/workflows/codecov.yml +0 -27
- data/.github/workflows/copyrights.yml +0 -19
- data/.github/workflows/markdown-lint.yml +0 -23
- data/.github/workflows/pdd.yml +0 -19
- data/.github/workflows/rake.yml +0 -28
- data/.github/workflows/reuse.yml +0 -19
- data/.github/workflows/typos.yml +0 -19
- data/.github/workflows/xcop.yml +0 -19
- data/.github/workflows/yamllint.yml +0 -19
- data/.gitignore +0 -11
- data/.pdd +0 -7
- data/.rubocop.yml +0 -51
- data/.rultor.yml +0 -27
- data/benchmark/bench_factbase.rb +0 -61
- data/benchmark/bench_large_query.rb +0 -128
- data/benchmark/bench_query.rb +0 -57
- data/benchmark/bench_taped.rb +0 -33
- data/fixtures/stories/agg.yml +0 -17
- data/fixtures/stories/always.yml +0 -16
- data/fixtures/stories/and.yml +0 -19
- data/fixtures/stories/as.yml +0 -16
- data/fixtures/stories/count.yml +0 -18
- data/fixtures/stories/empty.yml +0 -23
- data/fixtures/stories/eq.yml +0 -30
- data/fixtures/stories/gt.yml +0 -18
- data/fixtures/stories/join.yml +0 -22
- data/fixtures/stories/max.yml +0 -14
- data/fixtures/stories/min.yml +0 -14
- data/fixtures/stories/nth.yml +0 -14
- data/fixtures/stories/one.yml +0 -14
- data/fixtures/stories/or.yml +0 -18
- data/fixtures/stories/sprintf.yml +0 -12
- data/fixtures/stories/sum.yml +0 -14
- data/fixtures/stories/unique.yml +0 -16
- data/renovate.json +0 -6
- data/test/factbase/cached/test_cached_factbase.rb +0 -44
- data/test/factbase/cached/test_cached_query.rb +0 -100
- data/test/factbase/indexed/test_indexed_fact.rb +0 -23
- data/test/factbase/indexed/test_indexed_factbase.rb +0 -96
- data/test/factbase/indexed/test_indexed_query.rb +0 -208
- data/test/factbase/indexed/test_indexed_term.rb +0 -140
- data/test/factbase/sync/test_sync_factbase.rb +0 -22
- data/test/factbase/sync/test_sync_query.rb +0 -30
- data/test/factbase/terms/test_aggregates.rb +0 -63
- data/test/factbase/terms/test_aliases.rb +0 -58
- data/test/factbase/terms/test_casting.rb +0 -33
- data/test/factbase/terms/test_debug.rb +0 -111
- data/test/factbase/terms/test_defn.rb +0 -48
- data/test/factbase/terms/test_logical.rb +0 -57
- data/test/factbase/terms/test_math.rb +0 -122
- data/test/factbase/terms/test_meta.rb +0 -70
- data/test/factbase/terms/test_ordering.rb +0 -28
- data/test/factbase/terms/test_strings.rb +0 -36
- data/test/factbase/terms/test_system.rb +0 -31
- data/test/factbase/test_accum.rb +0 -74
- data/test/factbase/test_churn.rb +0 -41
- data/test/factbase/test_fact.rb +0 -108
- data/test/factbase/test_fact_as_yaml.rb +0 -77
- data/test/factbase/test_flatten.rb +0 -28
- data/test/factbase/test_impatient.rb +0 -176
- data/test/factbase/test_inv.rb +0 -44
- data/test/factbase/test_logged.rb +0 -155
- data/test/factbase/test_pre.rb +0 -35
- data/test/factbase/test_query.rb +0 -445
- data/test/factbase/test_rules.rb +0 -113
- data/test/factbase/test_syntax.rb +0 -166
- data/test/factbase/test_tallied.rb +0 -81
- data/test/factbase/test_taped.rb +0 -72
- data/test/factbase/test_tee.rb +0 -85
- data/test/factbase/test_term.rb +0 -87
- data/test/factbase/test_to_json.rb +0 -35
- data/test/factbase/test_to_xml.rb +0 -89
- data/test/factbase/test_to_yaml.rb +0 -39
- data/test/test__helper.rb +0 -41
- data/test/test_factbase.rb +0 -509
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4aba41edebb257f304f7acc720e9197362b064c133002bc70961a82547b7e8d
|
4
|
+
data.tar.gz: 96ac1f52f408652849099830345ce2e00e4b167ebbc242150c1daa1f12f33b7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7812e78d6d5197deac99ca0ddb685db75657c06134153444c33f95842bcf80694056b8788ad9345daf7241123e3738ead1e01910078bf83c9efa757a0e1893ad
|
7
|
+
data.tar.gz: 8f0ddd2e96246985b18bb69cf4ab109ac4feb6460f2c1a0c1f9c0daee9b52b9aedd3af6af44f97a15e9c425222a8279876a682138f9dfee9574664f768f858a7
|
data/Gemfile.lock
CHANGED
@@ -3,14 +3,14 @@ PATH
|
|
3
3
|
specs:
|
4
4
|
factbase (0.0.0)
|
5
5
|
backtrace (~> 0.4)
|
6
|
-
decoor (~> 0.
|
6
|
+
decoor (~> 0.1)
|
7
7
|
ellipsized (~> 0.3)
|
8
8
|
json (~> 2.7)
|
9
9
|
logger (~> 1.0)
|
10
10
|
loog (~> 0.6)
|
11
11
|
nokogiri (~> 1.10)
|
12
|
-
others (~> 0.
|
13
|
-
tago (~> 0.
|
12
|
+
others (~> 0.1)
|
13
|
+
tago (~> 0.1)
|
14
14
|
yaml (~> 0.3)
|
15
15
|
|
16
16
|
GEM
|
@@ -70,7 +70,7 @@ GEM
|
|
70
70
|
rdoc (6.14.2)
|
71
71
|
erb
|
72
72
|
psych (>= 4.0.0)
|
73
|
-
regexp_parser (2.
|
73
|
+
regexp_parser (2.11.2)
|
74
74
|
rexml (3.4.1)
|
75
75
|
rubocop (1.79.2)
|
76
76
|
json (~> 2.3)
|
@@ -112,7 +112,7 @@ GEM
|
|
112
112
|
threads (0.4.1)
|
113
113
|
backtrace (~> 0)
|
114
114
|
concurrent-ruby (~> 1.0)
|
115
|
-
unicode-display_width (3.1.
|
115
|
+
unicode-display_width (3.1.5)
|
116
116
|
unicode-emoji (~> 4.0, >= 4.0.4)
|
117
117
|
unicode-emoji (4.0.4)
|
118
118
|
yaml (0.4.0)
|
data/README.md
CHANGED
@@ -13,19 +13,11 @@
|
|
13
13
|
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fyegor256%2Ffactbase?ref=badge_shield&issueType=license)
|
14
14
|
|
15
15
|
This Ruby gem manages an in-memory database of facts.
|
16
|
-
A fact is simply
|
16
|
+
A fact is simply an associative array of properties and their values.
|
17
17
|
The values are either atomic literals or non-empty sets of literals.
|
18
18
|
It is possible to delete a fact, but impossible to delete a property
|
19
19
|
from a fact.
|
20
20
|
|
21
|
-
**ATTENTION**: The current implementation is naive and,
|
22
|
-
because of that, **very slow**. I will be very happy
|
23
|
-
if you suggest a better implementation without the change of the interface.
|
24
|
-
The `Factbase::query()` method is what mostly needs performance optimization:
|
25
|
-
currently it simply iterates through all facts in the factbase in order
|
26
|
-
to find those that match the provided terms. Obviously,
|
27
|
-
even a simple indexing may significantly increase performance.
|
28
|
-
|
29
21
|
Here is how you use it (it's thread-safe, by the way):
|
30
22
|
|
31
23
|
```ruby
|
@@ -42,7 +34,7 @@ fb.query('(not (exists seen))').each do |f|
|
|
42
34
|
end
|
43
35
|
```
|
44
36
|
|
45
|
-
You can save the factbase to the
|
37
|
+
You can save the factbase to the disk and then load it back:
|
46
38
|
|
47
39
|
```ruby
|
48
40
|
file = '/tmp/simple.fb'
|
@@ -133,7 +125,7 @@ properties in the facts that match `(gt x 5)`
|
|
133
125
|
Also, some simple arithmetic:
|
134
126
|
|
135
127
|
* `(plus v1 v2)` is a sum of `∑v1` and `∑v2`
|
136
|
-
* `(minus v1 v2)` is a
|
128
|
+
* `(minus v1 v2)` is a deduction of `∑v2` from `∑v1`
|
137
129
|
* `(times v1 v2)` is a multiplication of `∏v1` and `∏v2`
|
138
130
|
* `(div v1 v2)` is a division of `∏v1` by `∏v2`
|
139
131
|
|
@@ -155,7 +147,9 @@ returns `true`
|
|
155
147
|
There are terms that are history of search aware:
|
156
148
|
|
157
149
|
* `(prev p)` returns the value of `p` property in the previously seen fact
|
158
|
-
* `(unique
|
150
|
+
* `(unique p1 p2 ...)` returns true if at least one property value
|
151
|
+
hasn't been seen yet; returns false when all specified properties
|
152
|
+
have duplicate values in this particular combination
|
159
153
|
|
160
154
|
The `agg` term enables sub-queries by evaluating the first argument (term)
|
161
155
|
over all available facts, passing the entire subset to the second argument,
|
data/factbase.gemspec
CHANGED
@@ -22,18 +22,18 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.authors = ['Yegor Bugayenko']
|
23
23
|
s.email = 'yegor256@gmail.com'
|
24
24
|
s.homepage = 'https://github.com/yegor256/factbase.rb'
|
25
|
-
s.files = `git ls-files`.split($RS)
|
25
|
+
s.files = `git ls-files | grep -v -E '^(test/|\\.|fixtures|benchmark|renovate)'`.split($RS)
|
26
26
|
s.rdoc_options = ['--charset=UTF-8']
|
27
27
|
s.extra_rdoc_files = ['README.md', 'LICENSE.txt']
|
28
28
|
s.add_dependency 'backtrace', '~>0.4'
|
29
|
-
s.add_dependency 'decoor', '~>0.
|
29
|
+
s.add_dependency 'decoor', '~>0.1'
|
30
30
|
s.add_dependency 'ellipsized', '~>0.3'
|
31
31
|
s.add_dependency 'json', '~>2.7'
|
32
32
|
s.add_dependency 'logger', '~>1.0'
|
33
33
|
s.add_dependency 'loog', '~>0.6'
|
34
34
|
s.add_dependency 'nokogiri', '~>1.10'
|
35
|
-
s.add_dependency 'others', '~>0.
|
36
|
-
s.add_dependency 'tago', '~>0.
|
35
|
+
s.add_dependency 'others', '~>0.1'
|
36
|
+
s.add_dependency 'tago', '~>0.1'
|
37
37
|
s.add_dependency 'yaml', '~>0.3'
|
38
38
|
s.metadata['rubygems_mfa_required'] = 'true'
|
39
39
|
end
|
data/lib/factbase/fact.rb
CHANGED
@@ -37,7 +37,7 @@ class Factbase::Fact
|
|
37
37
|
# Convert it to a string.
|
38
38
|
# @return [String] String representation of it (in JSON)
|
39
39
|
def to_s
|
40
|
-
"[ #{@map.map { |k, v| "#{k}: #{v}" }.join(', ')} ]"
|
40
|
+
"[ #{@map.map { |k, v| "#{k}: #{v}" }.sort.join(', ')} ]"
|
41
41
|
end
|
42
42
|
|
43
43
|
# Get a list of all props.
|
@@ -35,7 +35,16 @@ class Factbase::FactAsYaml
|
|
35
35
|
hash[p] = v.is_a?(Array) ? v : [v]
|
36
36
|
end
|
37
37
|
hash.sort.to_h.map do |k, vv|
|
38
|
-
|
38
|
+
[
|
39
|
+
k,
|
40
|
+
': [',
|
41
|
+
vv.map do |v|
|
42
|
+
v = v.ellipsized if v.is_a?(String)
|
43
|
+
v = v.utc.iso8601 if v.is_a?(Time)
|
44
|
+
v
|
45
|
+
end.map(&:inspect).join(', '),
|
46
|
+
']'
|
47
|
+
].join
|
39
48
|
end.join("\n")
|
40
49
|
end
|
41
50
|
end
|
@@ -22,6 +22,8 @@ module Factbase::IndexedTerm
|
|
22
22
|
def predict(maps, params)
|
23
23
|
key = [maps.object_id, @operands.first, @op]
|
24
24
|
case @op
|
25
|
+
when :unique
|
26
|
+
maps
|
25
27
|
when :one
|
26
28
|
if @idx[key].nil?
|
27
29
|
@idx[key] = []
|
@@ -145,7 +147,10 @@ module Factbase::IndexedTerm
|
|
145
147
|
else
|
146
148
|
@operands.each do |o|
|
147
149
|
n = o.predict(maps, params)
|
148
|
-
|
150
|
+
if n.nil?
|
151
|
+
r = maps
|
152
|
+
break
|
153
|
+
end
|
149
154
|
if r.nil?
|
150
155
|
r = n
|
151
156
|
else
|
@@ -20,15 +20,24 @@ module Factbase::Ordering
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def unique(fact, maps, fb)
|
23
|
-
@uniques =
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
return false if
|
30
|
-
|
23
|
+
@uniques = {} if @uniques.nil?
|
24
|
+
raise "Too few operands for 'unique' (at least 1 expected)" if @operands.empty?
|
25
|
+
results = []
|
26
|
+
@operands.each_with_index do |_, i|
|
27
|
+
@uniques[i] = [] if @uniques[i].nil?
|
28
|
+
vv = _values(i, fact, maps, fb)
|
29
|
+
return false if vv.nil?
|
30
|
+
vv = [vv] unless vv.respond_to?(:to_a)
|
31
|
+
vv.each do |v|
|
32
|
+
if @uniques[i].include?(v)
|
33
|
+
results << false
|
34
|
+
else
|
35
|
+
@uniques[i] << v
|
36
|
+
results << true
|
37
|
+
end
|
38
|
+
end
|
31
39
|
end
|
40
|
+
return false if results.all?(false)
|
32
41
|
true
|
33
42
|
end
|
34
43
|
end
|
data/lib/factbase/version.rb
CHANGED
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.
|
4
|
+
version: 0.15.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
@@ -29,14 +29,14 @@ dependencies:
|
|
29
29
|
requirements:
|
30
30
|
- - "~>"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '0.
|
32
|
+
version: '0.1'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '0.
|
39
|
+
version: '0.1'
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: ellipsized
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
@@ -113,28 +113,28 @@ dependencies:
|
|
113
113
|
requirements:
|
114
114
|
- - "~>"
|
115
115
|
- !ruby/object:Gem::Version
|
116
|
-
version: '0.
|
116
|
+
version: '0.1'
|
117
117
|
type: :runtime
|
118
118
|
prerelease: false
|
119
119
|
version_requirements: !ruby/object:Gem::Requirement
|
120
120
|
requirements:
|
121
121
|
- - "~>"
|
122
122
|
- !ruby/object:Gem::Version
|
123
|
-
version: '0.
|
123
|
+
version: '0.1'
|
124
124
|
- !ruby/object:Gem::Dependency
|
125
125
|
name: tago
|
126
126
|
requirement: !ruby/object:Gem::Requirement
|
127
127
|
requirements:
|
128
128
|
- - "~>"
|
129
129
|
- !ruby/object:Gem::Version
|
130
|
-
version: '0.
|
130
|
+
version: '0.1'
|
131
131
|
type: :runtime
|
132
132
|
prerelease: false
|
133
133
|
version_requirements: !ruby/object:Gem::Requirement
|
134
134
|
requirements:
|
135
135
|
- - "~>"
|
136
136
|
- !ruby/object:Gem::Version
|
137
|
-
version: '0.
|
137
|
+
version: '0.1'
|
138
138
|
- !ruby/object:Gem::Dependency
|
139
139
|
name: yaml
|
140
140
|
requirement: !ruby/object:Gem::Requirement
|
@@ -161,24 +161,6 @@ extra_rdoc_files:
|
|
161
161
|
- LICENSE.txt
|
162
162
|
- README.md
|
163
163
|
files:
|
164
|
-
- ".0pdd.yml"
|
165
|
-
- ".gitattributes"
|
166
|
-
- ".github/publish-benchmark.sh"
|
167
|
-
- ".github/workflows/actionlint.yml"
|
168
|
-
- ".github/workflows/benchmark.yml"
|
169
|
-
- ".github/workflows/codecov.yml"
|
170
|
-
- ".github/workflows/copyrights.yml"
|
171
|
-
- ".github/workflows/markdown-lint.yml"
|
172
|
-
- ".github/workflows/pdd.yml"
|
173
|
-
- ".github/workflows/rake.yml"
|
174
|
-
- ".github/workflows/reuse.yml"
|
175
|
-
- ".github/workflows/typos.yml"
|
176
|
-
- ".github/workflows/xcop.yml"
|
177
|
-
- ".github/workflows/yamllint.yml"
|
178
|
-
- ".gitignore"
|
179
|
-
- ".pdd"
|
180
|
-
- ".rubocop.yml"
|
181
|
-
- ".rultor.yml"
|
182
164
|
- Gemfile
|
183
165
|
- Gemfile.lock
|
184
166
|
- LICENSE.txt
|
@@ -186,28 +168,7 @@ files:
|
|
186
168
|
- README.md
|
187
169
|
- REUSE.toml
|
188
170
|
- Rakefile
|
189
|
-
- benchmark/bench_factbase.rb
|
190
|
-
- benchmark/bench_large_query.rb
|
191
|
-
- benchmark/bench_query.rb
|
192
|
-
- benchmark/bench_taped.rb
|
193
171
|
- factbase.gemspec
|
194
|
-
- fixtures/stories/agg.yml
|
195
|
-
- fixtures/stories/always.yml
|
196
|
-
- fixtures/stories/and.yml
|
197
|
-
- fixtures/stories/as.yml
|
198
|
-
- fixtures/stories/count.yml
|
199
|
-
- fixtures/stories/empty.yml
|
200
|
-
- fixtures/stories/eq.yml
|
201
|
-
- fixtures/stories/gt.yml
|
202
|
-
- fixtures/stories/join.yml
|
203
|
-
- fixtures/stories/max.yml
|
204
|
-
- fixtures/stories/min.yml
|
205
|
-
- fixtures/stories/nth.yml
|
206
|
-
- fixtures/stories/one.yml
|
207
|
-
- fixtures/stories/or.yml
|
208
|
-
- fixtures/stories/sprintf.yml
|
209
|
-
- fixtures/stories/sum.yml
|
210
|
-
- fixtures/stories/unique.yml
|
211
172
|
- lib/factbase.rb
|
212
173
|
- lib/factbase/accum.rb
|
213
174
|
- lib/factbase/cached/cached_fact.rb
|
@@ -251,47 +212,6 @@ files:
|
|
251
212
|
- lib/factbase/to_xml.rb
|
252
213
|
- lib/factbase/to_yaml.rb
|
253
214
|
- lib/factbase/version.rb
|
254
|
-
- renovate.json
|
255
|
-
- test/factbase/cached/test_cached_factbase.rb
|
256
|
-
- test/factbase/cached/test_cached_query.rb
|
257
|
-
- test/factbase/indexed/test_indexed_fact.rb
|
258
|
-
- test/factbase/indexed/test_indexed_factbase.rb
|
259
|
-
- test/factbase/indexed/test_indexed_query.rb
|
260
|
-
- test/factbase/indexed/test_indexed_term.rb
|
261
|
-
- test/factbase/sync/test_sync_factbase.rb
|
262
|
-
- test/factbase/sync/test_sync_query.rb
|
263
|
-
- test/factbase/terms/test_aggregates.rb
|
264
|
-
- test/factbase/terms/test_aliases.rb
|
265
|
-
- test/factbase/terms/test_casting.rb
|
266
|
-
- test/factbase/terms/test_debug.rb
|
267
|
-
- test/factbase/terms/test_defn.rb
|
268
|
-
- test/factbase/terms/test_logical.rb
|
269
|
-
- test/factbase/terms/test_math.rb
|
270
|
-
- test/factbase/terms/test_meta.rb
|
271
|
-
- test/factbase/terms/test_ordering.rb
|
272
|
-
- test/factbase/terms/test_strings.rb
|
273
|
-
- test/factbase/terms/test_system.rb
|
274
|
-
- test/factbase/test_accum.rb
|
275
|
-
- test/factbase/test_churn.rb
|
276
|
-
- test/factbase/test_fact.rb
|
277
|
-
- test/factbase/test_fact_as_yaml.rb
|
278
|
-
- test/factbase/test_flatten.rb
|
279
|
-
- test/factbase/test_impatient.rb
|
280
|
-
- test/factbase/test_inv.rb
|
281
|
-
- test/factbase/test_logged.rb
|
282
|
-
- test/factbase/test_pre.rb
|
283
|
-
- test/factbase/test_query.rb
|
284
|
-
- test/factbase/test_rules.rb
|
285
|
-
- test/factbase/test_syntax.rb
|
286
|
-
- test/factbase/test_tallied.rb
|
287
|
-
- test/factbase/test_taped.rb
|
288
|
-
- test/factbase/test_tee.rb
|
289
|
-
- test/factbase/test_term.rb
|
290
|
-
- test/factbase/test_to_json.rb
|
291
|
-
- test/factbase/test_to_xml.rb
|
292
|
-
- test/factbase/test_to_yaml.rb
|
293
|
-
- test/test__helper.rb
|
294
|
-
- test/test_factbase.rb
|
295
215
|
homepage: https://github.com/yegor256/factbase.rb
|
296
216
|
licenses:
|
297
217
|
- MIT
|
@@ -312,7 +232,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
312
232
|
- !ruby/object:Gem::Version
|
313
233
|
version: '0'
|
314
234
|
requirements: []
|
315
|
-
rubygems_version: 3.6.
|
235
|
+
rubygems_version: 3.6.9
|
316
236
|
specification_version: 4
|
317
237
|
summary: Factbase
|
318
238
|
test_files: []
|
data/.0pdd.yml
DELETED
data/.gitattributes
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
3
|
-
# SPDX-License-Identifier: MIT
|
4
|
-
|
5
|
-
set -x
|
6
|
-
|
7
|
-
sum=$(
|
8
|
-
echo '```text'
|
9
|
-
cut -c -71 < stdout.txt
|
10
|
-
echo '```'
|
11
|
-
echo
|
12
|
-
echo "The results were calculated in [this GHA job][benchmark-gha]"
|
13
|
-
echo "on $(date +'%Y-%m-%d') at $(date +'%H:%M'),"
|
14
|
-
echo "on $(uname) with $(nproc --all) CPUs."
|
15
|
-
)
|
16
|
-
|
17
|
-
export sum
|
18
|
-
|
19
|
-
perl -i -0777 -pe 's/(?<=<!-- benchmark_begin -->).*(?=<!-- benchmark_end -->)/\n$ENV{sum}\n/gs;' README.md
|
20
|
-
url=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}
|
21
|
-
|
22
|
-
export url
|
23
|
-
perl -i -0777 -pe 's/(?<=\[benchmark-gha\]: )[^\n]+(?=\n)/$ENV{url}/gs;' README.md
|
24
|
-
rm stdout.txt
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
2
|
-
# SPDX-License-Identifier: MIT
|
3
|
-
---
|
4
|
-
# yamllint disable rule:line-length
|
5
|
-
name: actionlint
|
6
|
-
'on':
|
7
|
-
push:
|
8
|
-
branches:
|
9
|
-
- master
|
10
|
-
pull_request:
|
11
|
-
branches:
|
12
|
-
- master
|
13
|
-
jobs:
|
14
|
-
actionlint:
|
15
|
-
timeout-minutes: 15
|
16
|
-
runs-on: ubuntu-24.04
|
17
|
-
steps:
|
18
|
-
- uses: actions/checkout@v4
|
19
|
-
- name: Download actionlint
|
20
|
-
id: get_actionlint
|
21
|
-
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
|
22
|
-
shell: bash
|
23
|
-
- name: Check workflow files
|
24
|
-
run: ${{ steps.get_actionlint.outputs.executable }} -color
|
25
|
-
shell: bash
|
@@ -1,36 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
4
|
-
# SPDX-License-Identifier: MIT
|
5
|
-
---
|
6
|
-
# yamllint disable rule:line-length
|
7
|
-
name: benchmark
|
8
|
-
'on':
|
9
|
-
push:
|
10
|
-
paths-ignore: ['README.md']
|
11
|
-
concurrency:
|
12
|
-
group: benchmark-${{ github.ref }}
|
13
|
-
cancel-in-progress: true
|
14
|
-
jobs:
|
15
|
-
benchmark:
|
16
|
-
timeout-minutes: 15
|
17
|
-
runs-on: ubuntu-24.04
|
18
|
-
steps:
|
19
|
-
- uses: actions/checkout@v4
|
20
|
-
- uses: ruby/setup-ruby@v1
|
21
|
-
with:
|
22
|
-
ruby-version: 3.3
|
23
|
-
bundler-cache: true
|
24
|
-
- run: bundle config set --global path "$(pwd)/vendor/bundle"
|
25
|
-
- run: bundle install --no-color
|
26
|
-
- run: bundle exec rake benchmark > stdout.txt
|
27
|
-
- run: .github/publish-benchmark.sh
|
28
|
-
- uses: peter-evans/create-pull-request@v7
|
29
|
-
with:
|
30
|
-
sign-commits: true
|
31
|
-
branch: benchmark-results
|
32
|
-
commit-message: 'new benchmarking results'
|
33
|
-
delete-branch: true
|
34
|
-
title: 'New Benchmarking Results'
|
35
|
-
reviewers: yegor256
|
36
|
-
base: master
|
@@ -1,27 +0,0 @@
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
2
|
-
# SPDX-License-Identifier: MIT
|
3
|
-
---
|
4
|
-
# yamllint disable rule:line-length
|
5
|
-
name: codecov
|
6
|
-
'on':
|
7
|
-
push:
|
8
|
-
branches:
|
9
|
-
- master
|
10
|
-
jobs:
|
11
|
-
codecov:
|
12
|
-
timeout-minutes: 15
|
13
|
-
runs-on: ubuntu-24.04
|
14
|
-
steps:
|
15
|
-
- uses: actions/checkout@v4
|
16
|
-
- uses: ruby/setup-ruby@v1
|
17
|
-
with:
|
18
|
-
ruby-version: 3.3
|
19
|
-
bundler-cache: true
|
20
|
-
- run: bundle config set --global path "$(pwd)/vendor/bundle"
|
21
|
-
- run: bundle install --no-color
|
22
|
-
- run: bundle exec rake
|
23
|
-
- uses: codecov/codecov-action@v5
|
24
|
-
with:
|
25
|
-
token: ${{ secrets.CODECOV_TOKEN }}
|
26
|
-
files: coverage/.resultset.json
|
27
|
-
fail_ci_if_error: true
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
2
|
-
# SPDX-License-Identifier: MIT
|
3
|
-
---
|
4
|
-
# yamllint disable rule:line-length
|
5
|
-
name: copyrights
|
6
|
-
'on':
|
7
|
-
push:
|
8
|
-
branches:
|
9
|
-
- master
|
10
|
-
pull_request:
|
11
|
-
branches:
|
12
|
-
- master
|
13
|
-
jobs:
|
14
|
-
copyrights:
|
15
|
-
timeout-minutes: 15
|
16
|
-
runs-on: ubuntu-24.04
|
17
|
-
steps:
|
18
|
-
- uses: actions/checkout@v4
|
19
|
-
- uses: yegor256/copyrights-action@0.0.12
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
2
|
-
# SPDX-License-Identifier: MIT
|
3
|
-
---
|
4
|
-
# yamllint disable rule:line-length
|
5
|
-
name: markdown-lint
|
6
|
-
'on':
|
7
|
-
push:
|
8
|
-
branches:
|
9
|
-
- master
|
10
|
-
pull_request:
|
11
|
-
branches:
|
12
|
-
- master
|
13
|
-
paths-ignore: ['paper/**', 'sandbox/**']
|
14
|
-
concurrency:
|
15
|
-
group: markdown-lint-${{ github.ref }}
|
16
|
-
cancel-in-progress: true
|
17
|
-
jobs:
|
18
|
-
markdown-lint:
|
19
|
-
timeout-minutes: 15
|
20
|
-
runs-on: ubuntu-24.04
|
21
|
-
steps:
|
22
|
-
- uses: actions/checkout@v4
|
23
|
-
- uses: DavidAnson/markdownlint-cli2-action@v20.0.0
|
data/.github/workflows/pdd.yml
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
2
|
-
# SPDX-License-Identifier: MIT
|
3
|
-
---
|
4
|
-
# yamllint disable rule:line-length
|
5
|
-
name: pdd
|
6
|
-
'on':
|
7
|
-
push:
|
8
|
-
branches:
|
9
|
-
- master
|
10
|
-
pull_request:
|
11
|
-
branches:
|
12
|
-
- master
|
13
|
-
jobs:
|
14
|
-
pdd:
|
15
|
-
timeout-minutes: 15
|
16
|
-
runs-on: ubuntu-24.04
|
17
|
-
steps:
|
18
|
-
- uses: actions/checkout@v4
|
19
|
-
- uses: volodya-lombrozo/pdd-action@master
|
data/.github/workflows/rake.yml
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
2
|
-
# SPDX-License-Identifier: MIT
|
3
|
-
---
|
4
|
-
# yamllint disable rule:line-length
|
5
|
-
name: rake
|
6
|
-
'on':
|
7
|
-
push:
|
8
|
-
branches:
|
9
|
-
- master
|
10
|
-
pull_request:
|
11
|
-
branches:
|
12
|
-
- master
|
13
|
-
jobs:
|
14
|
-
rake:
|
15
|
-
strategy:
|
16
|
-
matrix:
|
17
|
-
os: [ubuntu-24.04, macos-15, windows-2022]
|
18
|
-
ruby: [3.3]
|
19
|
-
runs-on: ${{ matrix.os }}
|
20
|
-
steps:
|
21
|
-
- uses: actions/checkout@v4
|
22
|
-
- uses: ruby/setup-ruby@v1
|
23
|
-
with:
|
24
|
-
ruby-version: ${{ matrix.ruby }}
|
25
|
-
bundler-cache: true
|
26
|
-
- run: bundle config set --global path "$(pwd)/vendor/bundle"
|
27
|
-
- run: bundle install --no-color
|
28
|
-
- run: bundle exec rake
|
data/.github/workflows/reuse.yml
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
2
|
-
# SPDX-License-Identifier: MIT
|
3
|
-
---
|
4
|
-
# yamllint disable rule:line-length
|
5
|
-
name: reuse
|
6
|
-
'on':
|
7
|
-
push:
|
8
|
-
branches:
|
9
|
-
- master
|
10
|
-
pull_request:
|
11
|
-
branches:
|
12
|
-
- master
|
13
|
-
jobs:
|
14
|
-
reuse:
|
15
|
-
timeout-minutes: 15
|
16
|
-
runs-on: ubuntu-24.04
|
17
|
-
steps:
|
18
|
-
- uses: actions/checkout@v4
|
19
|
-
- uses: fsfe/reuse-action@v5
|
data/.github/workflows/typos.yml
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
2
|
-
# SPDX-License-Identifier: MIT
|
3
|
-
---
|
4
|
-
# yamllint disable rule:line-length
|
5
|
-
name: typos
|
6
|
-
'on':
|
7
|
-
push:
|
8
|
-
branches:
|
9
|
-
- master
|
10
|
-
pull_request:
|
11
|
-
branches:
|
12
|
-
- master
|
13
|
-
jobs:
|
14
|
-
typos:
|
15
|
-
timeout-minutes: 15
|
16
|
-
runs-on: ubuntu-24.04
|
17
|
-
steps:
|
18
|
-
- uses: actions/checkout@v4
|
19
|
-
- uses: crate-ci/typos@v1.35.3
|
data/.github/workflows/xcop.yml
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
2
|
-
# SPDX-License-Identifier: MIT
|
3
|
-
---
|
4
|
-
# yamllint disable rule:line-length
|
5
|
-
name: xcop
|
6
|
-
'on':
|
7
|
-
push:
|
8
|
-
branches:
|
9
|
-
- master
|
10
|
-
pull_request:
|
11
|
-
branches:
|
12
|
-
- master
|
13
|
-
jobs:
|
14
|
-
xcop:
|
15
|
-
timeout-minutes: 15
|
16
|
-
runs-on: ubuntu-24.04
|
17
|
-
steps:
|
18
|
-
- uses: actions/checkout@v4
|
19
|
-
- uses: g4s8/xcop-action@master
|