fbe 0.48.4 → 0.48.6
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/.github/workflows/actionlint.yml +1 -7
- data/.github/workflows/codecov.yml +2 -2
- data/.github/workflows/markdown-lint.yml +1 -1
- data/.github/workflows/rake.yml +1 -2
- data/.github/workflows/typos.yml +1 -1
- data/.gitignore +2 -0
- data/.rubocop.yml +18 -2
- data/.ruby-version +1 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +32 -32
- data/README.md +2 -2
- data/REUSE.toml +1 -0
- data/assets/bylaws/bad-branch-name-was-punished.fe.liquid +1 -1
- data/fbe.gemspec +1 -1
- data/lib/fbe/award.rb +1 -1
- data/lib/fbe/conclude.rb +16 -9
- data/lib/fbe/consider.rb +5 -1
- data/lib/fbe/delete.rb +7 -1
- data/lib/fbe/delete_one.rb +11 -2
- data/lib/fbe/fake_octokit.rb +1797 -0
- data/lib/fbe/fb.rb +31 -28
- data/lib/fbe/github_graph.rb +28 -19
- data/lib/fbe/if_absent.rb +1 -1
- data/lib/fbe/iterate.rb +42 -24
- data/lib/fbe/just_one.rb +5 -2
- data/lib/fbe/kill_if.rb +1 -0
- data/lib/fbe/middleware/formatter.rb +25 -11
- data/lib/fbe/middleware/rate_limit.rb +96 -48
- data/lib/fbe/middleware/sqlite_store.rb +12 -4
- data/lib/fbe/octo.rb +187 -1944
- data/lib/fbe/over.rb +7 -3
- data/lib/fbe/overwrite.rb +31 -2
- data/lib/fbe/pmp.rb +56 -34
- data/lib/fbe/regularly.rb +3 -3
- data/lib/fbe/repeatedly.rb +2 -2
- data/lib/fbe/sec.rb +4 -5
- data/lib/fbe/tombstone.rb +1 -1
- data/lib/fbe/unmask_repos.rb +1 -2
- data/lib/fbe.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cb9882f8daa663f05cdb5c37b6cf409cc8d6d2c8d5865008e3cccfffd7055f25
|
|
4
|
+
data.tar.gz: e3a2965c7a4075963eae7b2ff954cc6cc2392d44ab8ec63b3e49fc3b0dc8261b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f838c7e4eeaf7b8f8b8cecf6c826383063c88f505bd4fab9dd8b92ccc4c20780d37b837b2deffc8da825d2ed41e60fe1fa70cb8482f083fe52938cb583eac949
|
|
7
|
+
data.tar.gz: 77c3fc4a2a21f6c57bda5828d88ae1cfcb04754989e82ae6ff2903d0d11c04c958e9dbc99314fc54d718f75edb4fafc61b8cff2f00367f9d6653d59bb62929d3
|
|
@@ -16,10 +16,4 @@ jobs:
|
|
|
16
16
|
runs-on: ubuntu-24.04
|
|
17
17
|
steps:
|
|
18
18
|
- uses: actions/checkout@v6
|
|
19
|
-
-
|
|
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
|
|
19
|
+
- uses: reviewdog/action-actionlint@v1.72.0
|
|
@@ -15,11 +15,11 @@ jobs:
|
|
|
15
15
|
- uses: actions/checkout@v6
|
|
16
16
|
- uses: ruby/setup-ruby@v1
|
|
17
17
|
with:
|
|
18
|
-
ruby-version:
|
|
18
|
+
ruby-version: .ruby-version
|
|
19
19
|
bundler-cache: true
|
|
20
20
|
- run: bundle config set --global path "$(pwd)/vendor/bundle"
|
|
21
21
|
- run: bundle install --no-color
|
|
22
22
|
- run: bundle exec rake
|
|
23
|
-
- uses: codecov/codecov-action@
|
|
23
|
+
- uses: codecov/codecov-action@v7
|
|
24
24
|
with:
|
|
25
25
|
token: ${{ secrets.CODECOV_TOKEN }}
|
data/.github/workflows/rake.yml
CHANGED
|
@@ -15,13 +15,12 @@ jobs:
|
|
|
15
15
|
strategy:
|
|
16
16
|
matrix:
|
|
17
17
|
os: [ubuntu-24.04, macos-15]
|
|
18
|
-
ruby: [3.3]
|
|
19
18
|
runs-on: ${{ matrix.os }}
|
|
20
19
|
steps:
|
|
21
20
|
- uses: actions/checkout@v6
|
|
22
21
|
- uses: ruby/setup-ruby@v1
|
|
23
22
|
with:
|
|
24
|
-
ruby-version:
|
|
23
|
+
ruby-version: .ruby-version
|
|
25
24
|
bundler-cache: true
|
|
26
25
|
- run: bundle config set --global path "$(pwd)/vendor/bundle"
|
|
27
26
|
- run: bundle install --no-color
|
data/.github/workflows/typos.yml
CHANGED
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
|
@@ -7,7 +7,7 @@ AllCops:
|
|
|
7
7
|
- 'assets/**/*'
|
|
8
8
|
- 'vendor/**/**'
|
|
9
9
|
DisplayCopNames: true
|
|
10
|
-
TargetRubyVersion: 3.
|
|
10
|
+
TargetRubyVersion: 3.3
|
|
11
11
|
SuggestExtensions: false
|
|
12
12
|
NewCops: enable
|
|
13
13
|
plugins:
|
|
@@ -19,7 +19,22 @@ Style/GlobalVars:
|
|
|
19
19
|
Enabled: false
|
|
20
20
|
Style/TopLevelMethodDefinition:
|
|
21
21
|
Enabled: false
|
|
22
|
+
Elegant/NoRedundantVariable:
|
|
23
|
+
Enabled: false
|
|
24
|
+
Elegant/NoNilReturn:
|
|
25
|
+
Enabled: false
|
|
26
|
+
Elegant/IndentationLadder:
|
|
27
|
+
Enabled: false
|
|
28
|
+
Elegant/NoClassInModule:
|
|
29
|
+
Exclude:
|
|
30
|
+
- 'lib/fbe.rb'
|
|
31
|
+
Elegant/ClassInModule:
|
|
32
|
+
Exclude:
|
|
33
|
+
- 'lib/**/*'
|
|
34
|
+
- 'test/**/*'
|
|
22
35
|
Elegant/GoodMethodName:
|
|
36
|
+
Exclude:
|
|
37
|
+
- 'test/**/*'
|
|
23
38
|
AllowedNames:
|
|
24
39
|
- accept_repository_invitation
|
|
25
40
|
- add_comment
|
|
@@ -34,6 +49,7 @@ Elegant/GoodMethodName:
|
|
|
34
49
|
- delete_one
|
|
35
50
|
- dump_headers
|
|
36
51
|
- extract_remaining_count
|
|
52
|
+
- extract_search_remaining_count
|
|
37
53
|
- faraday_value
|
|
38
54
|
- github_graph
|
|
39
55
|
- handle_rate_limit_request
|
|
@@ -53,6 +69,7 @@ Elegant/GoodMethodName:
|
|
|
53
69
|
- off_quota?
|
|
54
70
|
- organization_memberships
|
|
55
71
|
- organization_repositories
|
|
72
|
+
- patched_body
|
|
56
73
|
- print_trace!
|
|
57
74
|
- publish_to
|
|
58
75
|
- pull_request
|
|
@@ -85,7 +102,6 @@ Elegant/GoodMethodName:
|
|
|
85
102
|
- track_request
|
|
86
103
|
- unmask_repos
|
|
87
104
|
- update_organization_membership
|
|
88
|
-
- update_remaining_count
|
|
89
105
|
- user_name_by_id
|
|
90
106
|
- user_repository_invitations
|
|
91
107
|
- with_disable_auto_paginate
|
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4.0.5
|
data/Gemfile
CHANGED
|
@@ -13,7 +13,7 @@ gem 'minitest-stub-const', '~>0.6', require: false
|
|
|
13
13
|
gem 'os', '~>1.1', require: false
|
|
14
14
|
gem 'qbash', '~>0.4', require: false
|
|
15
15
|
gem 'rake', '13.4.2', require: false
|
|
16
|
-
gem 'rdoc', '~>
|
|
16
|
+
gem 'rdoc', '~>8.0', require: false
|
|
17
17
|
gem 'rubocop', '~>1.75', require: false
|
|
18
18
|
gem 'rubocop-elegant', '~>0.0', require: false
|
|
19
19
|
gem 'rubocop-minitest', '~>0.38', require: false
|
data/Gemfile.lock
CHANGED
|
@@ -48,7 +48,7 @@ GEM
|
|
|
48
48
|
ast (2.4.3)
|
|
49
49
|
backtrace (0.4.1)
|
|
50
50
|
base64 (0.3.0)
|
|
51
|
-
baza.rb (0.14.
|
|
51
|
+
baza.rb (0.14.4)
|
|
52
52
|
backtrace (~> 0.4)
|
|
53
53
|
elapsed (~> 0.2)
|
|
54
54
|
faraday (~> 2.13)
|
|
@@ -60,14 +60,13 @@ GEM
|
|
|
60
60
|
retries (~> 0.0)
|
|
61
61
|
tago (~> 0.2)
|
|
62
62
|
typhoeus (~> 1.4)
|
|
63
|
-
bigdecimal (4.1.
|
|
63
|
+
bigdecimal (4.1.2)
|
|
64
64
|
builder (3.3.0)
|
|
65
65
|
concurrent-ruby (1.3.6)
|
|
66
66
|
connection_pool (3.0.2)
|
|
67
67
|
crack (1.0.1)
|
|
68
68
|
bigdecimal
|
|
69
69
|
rexml
|
|
70
|
-
date (3.5.1)
|
|
71
70
|
decoor (0.1.0)
|
|
72
71
|
docile (1.4.1)
|
|
73
72
|
drb (2.2.3)
|
|
@@ -75,11 +74,11 @@ GEM
|
|
|
75
74
|
loog (~> 0.6)
|
|
76
75
|
tago (~> 0.1)
|
|
77
76
|
ellipsized (0.3.0)
|
|
78
|
-
erb (6.0.
|
|
77
|
+
erb (6.0.4)
|
|
79
78
|
ethon (0.18.0)
|
|
80
79
|
ffi (>= 1.15.0)
|
|
81
80
|
logger
|
|
82
|
-
factbase (0.19.
|
|
81
|
+
factbase (0.19.11)
|
|
83
82
|
backtrace (~> 0.4)
|
|
84
83
|
decoor (~> 0.1)
|
|
85
84
|
ellipsized (~> 0.3)
|
|
@@ -90,7 +89,7 @@ GEM
|
|
|
90
89
|
others (~> 0.1)
|
|
91
90
|
tago (~> 0.1)
|
|
92
91
|
yaml (~> 0.3)
|
|
93
|
-
faraday (2.14.
|
|
92
|
+
faraday (2.14.2)
|
|
94
93
|
faraday-net_http (>= 2.0, < 3.5)
|
|
95
94
|
json
|
|
96
95
|
logger
|
|
@@ -98,7 +97,7 @@ GEM
|
|
|
98
97
|
faraday (>= 0.8)
|
|
99
98
|
faraday-multipart (1.2.0)
|
|
100
99
|
multipart-post (~> 2.0)
|
|
101
|
-
faraday-net_http (3.4.
|
|
100
|
+
faraday-net_http (3.4.3)
|
|
102
101
|
net-http (~> 0.5)
|
|
103
102
|
faraday-retry (2.4.0)
|
|
104
103
|
faraday (~> 2.0)
|
|
@@ -110,7 +109,7 @@ GEM
|
|
|
110
109
|
filesize (0.2.0)
|
|
111
110
|
gli (2.22.2)
|
|
112
111
|
ostruct
|
|
113
|
-
graphql (2.
|
|
112
|
+
graphql (2.6.3)
|
|
114
113
|
base64
|
|
115
114
|
fiber-storage
|
|
116
115
|
logger
|
|
@@ -123,8 +122,8 @@ GEM
|
|
|
123
122
|
intercepted (0.2.0)
|
|
124
123
|
iri (0.11.8)
|
|
125
124
|
joined (0.4.0)
|
|
126
|
-
json (2.
|
|
127
|
-
judges (0.60.
|
|
125
|
+
json (2.20.0)
|
|
126
|
+
judges (0.60.3)
|
|
128
127
|
backtrace (~> 0.4)
|
|
129
128
|
baza.rb (~> 0.10)
|
|
130
129
|
concurrent-ruby (~> 1.2)
|
|
@@ -152,7 +151,7 @@ GEM
|
|
|
152
151
|
loog (0.8.0)
|
|
153
152
|
ellipsized
|
|
154
153
|
logger (~> 1.0)
|
|
155
|
-
minitest (6.0.
|
|
154
|
+
minitest (6.0.6)
|
|
156
155
|
drb (~> 2.0)
|
|
157
156
|
prism (~> 1.5)
|
|
158
157
|
minitest-mock (5.27.0)
|
|
@@ -166,13 +165,13 @@ GEM
|
|
|
166
165
|
multipart-post (2.4.1)
|
|
167
166
|
net-http (0.9.1)
|
|
168
167
|
uri (>= 0.11.1)
|
|
169
|
-
nokogiri (1.19.
|
|
168
|
+
nokogiri (1.19.3-arm64-darwin)
|
|
170
169
|
racc (~> 1.4)
|
|
171
|
-
nokogiri (1.19.
|
|
170
|
+
nokogiri (1.19.3-x64-mingw-ucrt)
|
|
172
171
|
racc (~> 1.4)
|
|
173
|
-
nokogiri (1.19.
|
|
172
|
+
nokogiri (1.19.3-x86_64-darwin)
|
|
174
173
|
racc (~> 1.4)
|
|
175
|
-
nokogiri (1.19.
|
|
174
|
+
nokogiri (1.19.3-x86_64-linux-gnu)
|
|
176
175
|
racc (~> 1.4)
|
|
177
176
|
obk (0.3.2)
|
|
178
177
|
octokit (10.0.0)
|
|
@@ -181,16 +180,13 @@ GEM
|
|
|
181
180
|
os (1.1.4)
|
|
182
181
|
ostruct (0.6.3)
|
|
183
182
|
others (0.1.1)
|
|
184
|
-
parallel (2.0
|
|
183
|
+
parallel (2.1.0)
|
|
185
184
|
parser (3.3.11.1)
|
|
186
185
|
ast (~> 2.4.1)
|
|
187
186
|
racc
|
|
188
187
|
prism (1.9.0)
|
|
189
|
-
psych (5.3.1)
|
|
190
|
-
date
|
|
191
|
-
stringio
|
|
192
188
|
public_suffix (7.0.5)
|
|
193
|
-
qbash (0.8.
|
|
189
|
+
qbash (0.8.4)
|
|
194
190
|
backtrace (> 0)
|
|
195
191
|
elapsed (> 0)
|
|
196
192
|
loog (> 0)
|
|
@@ -198,14 +194,19 @@ GEM
|
|
|
198
194
|
racc (1.8.1)
|
|
199
195
|
rainbow (3.1.1)
|
|
200
196
|
rake (13.4.2)
|
|
201
|
-
|
|
197
|
+
rbs (4.0.3)
|
|
198
|
+
logger
|
|
199
|
+
prism (>= 1.6.0)
|
|
200
|
+
tsort
|
|
201
|
+
rdoc (8.0.0)
|
|
202
202
|
erb
|
|
203
|
-
|
|
203
|
+
prism (>= 1.6.0)
|
|
204
|
+
rbs (>= 4.0.0)
|
|
204
205
|
tsort
|
|
205
206
|
regexp_parser (2.12.0)
|
|
206
207
|
retries (0.0.5)
|
|
207
208
|
rexml (3.4.4)
|
|
208
|
-
rubocop (1.
|
|
209
|
+
rubocop (1.88.1)
|
|
209
210
|
json (~> 2.3)
|
|
210
211
|
language_server-protocol (~> 3.17.0.2)
|
|
211
212
|
lint_roller (~> 1.1.0)
|
|
@@ -219,7 +220,7 @@ GEM
|
|
|
219
220
|
rubocop-ast (1.49.1)
|
|
220
221
|
parser (>= 3.3.7.2)
|
|
221
222
|
prism (~> 1.7)
|
|
222
|
-
rubocop-elegant (0.
|
|
223
|
+
rubocop-elegant (0.5.1)
|
|
223
224
|
lint_roller (~> 1.1)
|
|
224
225
|
rubocop (~> 1.75)
|
|
225
226
|
rubocop-minitest (0.39.1)
|
|
@@ -242,16 +243,15 @@ GEM
|
|
|
242
243
|
docile (~> 1.1)
|
|
243
244
|
simplecov-html (~> 0.11)
|
|
244
245
|
simplecov_json_formatter (~> 0.1)
|
|
245
|
-
simplecov-cobertura (3.
|
|
246
|
+
simplecov-cobertura (3.2.0)
|
|
246
247
|
rexml
|
|
247
248
|
simplecov (~> 0.19)
|
|
248
249
|
simplecov-html (0.13.2)
|
|
249
250
|
simplecov_json_formatter (0.1.4)
|
|
250
|
-
sqlite3 (2.9.
|
|
251
|
-
sqlite3 (2.9.
|
|
252
|
-
sqlite3 (2.9.
|
|
253
|
-
sqlite3 (2.9.
|
|
254
|
-
stringio (3.2.0)
|
|
251
|
+
sqlite3 (2.9.4-arm64-darwin)
|
|
252
|
+
sqlite3 (2.9.4-x64-mingw-ucrt)
|
|
253
|
+
sqlite3 (2.9.4-x86_64-darwin)
|
|
254
|
+
sqlite3 (2.9.4-x86_64-linux-gnu)
|
|
255
255
|
strscan (3.1.8)
|
|
256
256
|
tago (0.7.0)
|
|
257
257
|
timeout (0.6.1)
|
|
@@ -274,7 +274,7 @@ GEM
|
|
|
274
274
|
crack (>= 0.3.2)
|
|
275
275
|
hashdiff (>= 0.4.0, < 2.0.0)
|
|
276
276
|
yaml (0.4.0)
|
|
277
|
-
yard (0.9.
|
|
277
|
+
yard (0.9.44)
|
|
278
278
|
|
|
279
279
|
PLATFORMS
|
|
280
280
|
arm64-darwin-22
|
|
@@ -295,7 +295,7 @@ DEPENDENCIES
|
|
|
295
295
|
os (~> 1.1)
|
|
296
296
|
qbash (~> 0.4)
|
|
297
297
|
rake (= 13.4.2)
|
|
298
|
-
rdoc (~>
|
|
298
|
+
rdoc (~> 8.0)
|
|
299
299
|
rubocop (~> 1.75)
|
|
300
300
|
rubocop-elegant (~> 0.0)
|
|
301
301
|
rubocop-minitest (~> 0.38)
|
data/README.md
CHANGED
|
@@ -15,7 +15,7 @@ It's a collection of tools for
|
|
|
15
15
|
You are not supposed to use it directly, but only in a combination
|
|
16
16
|
with other tools of Zerocracy.
|
|
17
17
|
|
|
18
|
-
The following tools
|
|
18
|
+
The following tools run a block:
|
|
19
19
|
|
|
20
20
|
* `Fbe.regularly` runs a block of code every X days.
|
|
21
21
|
* `Fbe.conclude` runs a block on every fact from a query.
|
|
@@ -52,7 +52,7 @@ Read
|
|
|
52
52
|
[these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).
|
|
53
53
|
Make sure your build is green before you contribute
|
|
54
54
|
your pull request. You will need to have
|
|
55
|
-
[Ruby](https://www.ruby-lang.org/en/) 3.
|
|
55
|
+
[Ruby](https://www.ruby-lang.org/en/) 3.3+ and
|
|
56
56
|
[Bundler](https://bundler.io/) installed. Then:
|
|
57
57
|
|
|
58
58
|
```bash
|
data/REUSE.toml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(award
|
|
2
|
-
(explain "If a branch has a name that doesn
|
|
2
|
+
(explain "If a branch has a name that doesn\'t obey the convention, a penalty is given to the author")
|
|
3
3
|
(aka
|
|
4
4
|
(let fee {{ -6 | times: anger }})
|
|
5
5
|
(give fee "as a basis")
|
data/fbe.gemspec
CHANGED
|
@@ -8,7 +8,7 @@ require_relative 'lib/fbe'
|
|
|
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=)
|
|
11
|
-
s.required_ruby_version = '>=3.
|
|
11
|
+
s.required_ruby_version = '>=3.3'
|
|
12
12
|
s.name = 'fbe'
|
|
13
13
|
s.version = Fbe::VERSION
|
|
14
14
|
s.license = 'MIT'
|
data/lib/fbe/award.rb
CHANGED
|
@@ -253,7 +253,7 @@ class Fbe::Award
|
|
|
253
253
|
when :min
|
|
254
254
|
"minimum of #{to_p(@operands[0])} and #{to_p(@operands[1])}"
|
|
255
255
|
when :between
|
|
256
|
-
"
|
|
256
|
+
"#{to_p(@operands[0])} clamped between #{to_p(@operands[1])} and #{to_p(@operands[2])}"
|
|
257
257
|
else
|
|
258
258
|
raise(Fbe::Error, "Unknown term '#{@op}'")
|
|
259
259
|
end
|
data/lib/fbe/conclude.rb
CHANGED
|
@@ -36,16 +36,16 @@ end
|
|
|
36
36
|
# A concluding block.
|
|
37
37
|
#
|
|
38
38
|
# You may want to use this class when you want to go through a number
|
|
39
|
-
# of facts in the factbase, applying certain algorithm to each of them
|
|
39
|
+
# of facts in the factbase, applying a certain algorithm to each of them
|
|
40
40
|
# and possibly creating new facts from them.
|
|
41
41
|
#
|
|
42
42
|
# For example, you want to make a new +good+ fact for every +bad+ fact found:
|
|
43
43
|
#
|
|
44
44
|
# require 'fbe/conclude'
|
|
45
45
|
# conclude do
|
|
46
|
-
# on '(
|
|
46
|
+
# on '(exists bad)'
|
|
47
47
|
# follow 'when'
|
|
48
|
-
# draw
|
|
48
|
+
# draw do |n, b|
|
|
49
49
|
# n.good = 'yes!'
|
|
50
50
|
# end
|
|
51
51
|
# end
|
|
@@ -123,6 +123,7 @@ class Fbe::Conclude
|
|
|
123
123
|
# @param [Array<String>] props List of property names
|
|
124
124
|
# @return [nil] Nothing
|
|
125
125
|
def follow(props)
|
|
126
|
+
raise(Fbe::Error, 'Follow is already set') unless @follows.empty?
|
|
126
127
|
@follows = props.strip.split.compact
|
|
127
128
|
end
|
|
128
129
|
|
|
@@ -132,9 +133,9 @@ class Fbe::Conclude
|
|
|
132
133
|
#
|
|
133
134
|
# require 'fbe/conclude'
|
|
134
135
|
# conclude do
|
|
135
|
-
# on '(
|
|
136
|
+
# on '(exists win)'
|
|
136
137
|
# follow 'win when'
|
|
137
|
-
# draw
|
|
138
|
+
# draw do |n, w|
|
|
138
139
|
# n.reward = 10
|
|
139
140
|
# end
|
|
140
141
|
# end
|
|
@@ -161,7 +162,7 @@ class Fbe::Conclude
|
|
|
161
162
|
# require 'fbe/conclude'
|
|
162
163
|
# conclude do
|
|
163
164
|
# on '(always)'
|
|
164
|
-
# consider
|
|
165
|
+
# consider do |f|
|
|
165
166
|
# f.when = Time.new
|
|
166
167
|
# end
|
|
167
168
|
# end
|
|
@@ -208,7 +209,12 @@ class Fbe::Conclude
|
|
|
208
209
|
)
|
|
209
210
|
@fb.txn do |fbt|
|
|
210
211
|
n = yield(fbt, a)
|
|
211
|
-
|
|
212
|
+
unless n.nil?
|
|
213
|
+
props = n.all_properties
|
|
214
|
+
if props.include?('what') && props.include?('details')
|
|
215
|
+
@loog.info("#{n.what}: #{n.details}")
|
|
216
|
+
end
|
|
217
|
+
end
|
|
212
218
|
end
|
|
213
219
|
passed += 1
|
|
214
220
|
end
|
|
@@ -242,8 +248,9 @@ class Fbe::Conclude
|
|
|
242
248
|
# end
|
|
243
249
|
def fill(fact, prev)
|
|
244
250
|
@follows.each do |follow|
|
|
245
|
-
|
|
246
|
-
|
|
251
|
+
prev[follow.to_s].each do |v|
|
|
252
|
+
fact.public_send(:"#{follow}=", v)
|
|
253
|
+
end
|
|
247
254
|
end
|
|
248
255
|
r = yield(fact, prev)
|
|
249
256
|
return unless r.is_a?(String)
|
data/lib/fbe/consider.rb
CHANGED
|
@@ -17,17 +17,21 @@ require_relative 'fb'
|
|
|
17
17
|
# @param [Loog] loog The logging facility
|
|
18
18
|
# @param [Time] epoch When the entire update started
|
|
19
19
|
# @param [Time] kickoff When the particular judge started
|
|
20
|
+
# @param [Boolean] lifetime_aware Check lifetime limitations (default: true)
|
|
21
|
+
# @param [Boolean] timeout_aware Check timeout limitations (default: true)
|
|
22
|
+
# @param [Boolean] quota_aware Check GitHub API quota (default: true)
|
|
20
23
|
# @yield [Factbase::Fact] The fact
|
|
21
24
|
def Fbe.consider(
|
|
22
25
|
query,
|
|
23
26
|
fb: Fbe.fb, judge: $judge, loog: $loog, options: $options, global: $global,
|
|
24
27
|
epoch: $epoch || Time.now, kickoff: $kickoff || Time.now,
|
|
25
|
-
lifetime_aware: true, timeout_aware: true, &
|
|
28
|
+
lifetime_aware: true, timeout_aware: true, quota_aware: true, &
|
|
26
29
|
)
|
|
27
30
|
Fbe.conclude(fb:, judge:, loog:, options:, global:, epoch:, kickoff:) do
|
|
28
31
|
on(query)
|
|
29
32
|
timeout_unaware unless timeout_aware
|
|
30
33
|
lifetime_unaware unless lifetime_aware
|
|
34
|
+
quota_unaware unless quota_aware
|
|
31
35
|
consider(&)
|
|
32
36
|
end
|
|
33
37
|
end
|
data/lib/fbe/delete.rb
CHANGED
|
@@ -33,10 +33,16 @@ def Fbe.delete(fact, *props, fb: Fbe.fb, id: '_id')
|
|
|
33
33
|
next if props.include?(k)
|
|
34
34
|
before[k] = fact[k]
|
|
35
35
|
end
|
|
36
|
-
before.delete(id)
|
|
37
36
|
fb.query("(eq #{id} #{i})").delete!
|
|
38
37
|
fb.txn do |fbt|
|
|
39
38
|
c = fbt.insert
|
|
39
|
+
f = c
|
|
40
|
+
while f.instance_variable_defined?(:@fact) || f.instance_variable_defined?(:@origin)
|
|
41
|
+
iv = f.instance_variable_defined?(:@fact) ? :@fact : :@origin
|
|
42
|
+
f = f.instance_variable_get(iv)
|
|
43
|
+
end
|
|
44
|
+
map = f.instance_variable_get(:@map)
|
|
45
|
+
%w[_id _time _version _job].each { |k| map.delete(k) if before.key?(k) }
|
|
40
46
|
before.each do |k, vv|
|
|
41
47
|
next unless c[k].nil?
|
|
42
48
|
vv.each do |v|
|
data/lib/fbe/delete_one.rb
CHANGED
|
@@ -28,11 +28,20 @@ def Fbe.delete_one(fact, prop, value, fb: Fbe.fb, id: '_id')
|
|
|
28
28
|
before[k] = fact[k]
|
|
29
29
|
end
|
|
30
30
|
return unless before[prop]
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
nv = before[prop] - [value]
|
|
32
|
+
return if nv == before[prop]
|
|
33
|
+
before[prop] = nv
|
|
34
|
+
before.delete(prop) if nv.empty?
|
|
33
35
|
fb.query("(eq #{id} #{i})").delete!
|
|
34
36
|
fb.txn do |fbt|
|
|
35
37
|
c = fbt.insert
|
|
38
|
+
f = c
|
|
39
|
+
while f.instance_variable_defined?(:@fact) || f.instance_variable_defined?(:@origin)
|
|
40
|
+
iv = f.instance_variable_defined?(:@fact) ? :@fact : :@origin
|
|
41
|
+
f = f.instance_variable_get(iv)
|
|
42
|
+
end
|
|
43
|
+
map = f.instance_variable_get(:@map)
|
|
44
|
+
%w[_id _time _version _job].each { |k| map.delete(k) if before.key?(k) }
|
|
36
45
|
before.each do |k, vv|
|
|
37
46
|
next unless c[k].nil?
|
|
38
47
|
vv.each do |v|
|