fbe 0.48.5 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e54b9ecd59fd5bf0087090ec4d320a09e4468fd1d30c943968255992d37af3a9
4
- data.tar.gz: d309db436c5f4902e1bfb50f6c32fbc93a5aeed57aa47653d60828079cb5540e
3
+ metadata.gz: cb9882f8daa663f05cdb5c37b6cf409cc8d6d2c8d5865008e3cccfffd7055f25
4
+ data.tar.gz: e3a2965c7a4075963eae7b2ff954cc6cc2392d44ab8ec63b3e49fc3b0dc8261b
5
5
  SHA512:
6
- metadata.gz: c0131eae4897865be58003cda673768124456e990e74be4650d671bb2038fb71fcf58fec08d7f2c922c3e694875abfbfc52f2a9584a3a54e4a9ca7a5ef5c2076
7
- data.tar.gz: c68253c55d621d3ce8d7da0721f7e330532fe4b8eec18ef641acb801b57098c884307782fa31c2d403781a5b38afbbcaddb5574505eb6da4ab8be6587614a1ca
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
- - 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
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: 4.0.3
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@v6
23
+ - uses: codecov/codecov-action@v7
24
24
  with:
25
25
  token: ${{ secrets.CODECOV_TOKEN }}
@@ -20,4 +20,4 @@ jobs:
20
20
  runs-on: ubuntu-24.04
21
21
  steps:
22
22
  - uses: actions/checkout@v6
23
- - uses: DavidAnson/markdownlint-cli2-action@v23.2.0
23
+ - uses: DavidAnson/markdownlint-cli2-action@v24.0.0
@@ -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: ${{ matrix.ruby }}
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
@@ -16,6 +16,6 @@ jobs:
16
16
  runs-on: ubuntu-24.04
17
17
  steps:
18
18
  - uses: actions/checkout@v6
19
- - uses: crate-ci/typos@v1.46.0
19
+ - uses: crate-ci/typos@v1.48.0
20
20
  with:
21
21
  config: .github/.typos.toml
data/.gitignore CHANGED
@@ -9,3 +9,5 @@ node_modules/
9
9
  rdoc/
10
10
  vendor/
11
11
  .claude/
12
+ .opencode/
13
+ .vscode/
data/.rubocop.yml CHANGED
@@ -7,7 +7,7 @@ AllCops:
7
7
  - 'assets/**/*'
8
8
  - 'vendor/**/**'
9
9
  DisplayCopNames: true
10
- TargetRubyVersion: 3.2
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', '~>7.0', require: false
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.3)
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.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.3)
77
+ erb (6.0.4)
79
78
  ethon (0.18.0)
80
79
  ffi (>= 1.15.0)
81
80
  logger
82
- factbase (0.19.9)
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.1)
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.2)
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.5.23)
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.19.3)
127
- judges (0.60.2)
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)
@@ -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.2-arm64-darwin)
168
+ nokogiri (1.19.3-arm64-darwin)
170
169
  racc (~> 1.4)
171
- nokogiri (1.19.2-x64-mingw-ucrt)
170
+ nokogiri (1.19.3-x64-mingw-ucrt)
172
171
  racc (~> 1.4)
173
- nokogiri (1.19.2-x86_64-darwin)
172
+ nokogiri (1.19.3-x86_64-darwin)
174
173
  racc (~> 1.4)
175
- nokogiri (1.19.2-x86_64-linux-gnu)
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.1)
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.3)
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
- rdoc (7.2.0)
197
+ rbs (4.0.3)
198
+ logger
199
+ prism (>= 1.6.0)
200
+ tsort
201
+ rdoc (8.0.0)
202
202
  erb
203
- psych (>= 4.0.0)
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.86.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.0.16)
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.1.0)
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.3-arm64-darwin)
251
- sqlite3 (2.9.3-x64-mingw-ucrt)
252
- sqlite3 (2.9.3-x86_64-darwin)
253
- sqlite3 (2.9.3-x86_64-linux-gnu)
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.43)
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 (~> 7.0)
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
@@ -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.2+ and
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
@@ -8,6 +8,7 @@ path = [
8
8
  ".gitattributes",
9
9
  ".gitignore",
10
10
  ".pdd",
11
+ ".ruby-version",
11
12
  "**.json",
12
13
  "**.md",
13
14
  "**.png",
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.2'
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
- "at least #{to_p(@operands[0])} and at most #{to_p(@operands[1])}"
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
@@ -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
 
@@ -247,8 +248,9 @@ class Fbe::Conclude
247
248
  # end
248
249
  def fill(fact, prev)
249
250
  @follows.each do |follow|
250
- v = prev.public_send(follow)
251
- fact.public_send(:"#{follow}=", v)
251
+ prev[follow.to_s].each do |v|
252
+ fact.public_send(:"#{follow}=", v)
253
+ end
252
254
  end
253
255
  r = yield(fact, prev)
254
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|
@@ -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
- before[prop] = before[prop] - [value]
32
- before.delete(prop) if before[prop].empty?
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|