fbe 0.0.85 → 0.0.86

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.0pdd.yml +1 -1
  3. data/.github/workflows/actionlint.yml +1 -1
  4. data/.github/workflows/codecov.yml +2 -2
  5. data/.github/workflows/copyrights.yml +1 -1
  6. data/.github/workflows/markdown-lint.yml +1 -1
  7. data/.github/workflows/pdd.yml +1 -1
  8. data/.github/workflows/rake.yml +1 -1
  9. data/.github/workflows/xcop.yml +1 -1
  10. data/.github/workflows/yamllint.yml +1 -1
  11. data/.gitignore +1 -1
  12. data/.rubocop.yml +6 -1
  13. data/.rultor.yml +1 -1
  14. data/.simplecov +1 -1
  15. data/.yamllint.yml +1 -1
  16. data/Gemfile +4 -3
  17. data/Gemfile.lock +46 -33
  18. data/LICENSE.txt +1 -1
  19. data/Rakefile +1 -1
  20. data/assets/bylaws/dud-was-punished.liquid +1 -1
  21. data/fbe.gemspec +2 -2
  22. data/lib/fbe/award.rb +28 -10
  23. data/lib/fbe/bylaws.rb +1 -1
  24. data/lib/fbe/conclude.rb +3 -3
  25. data/lib/fbe/copy.rb +1 -1
  26. data/lib/fbe/enter.rb +1 -1
  27. data/lib/fbe/fb.rb +1 -1
  28. data/lib/fbe/github_graph.rb +2 -2
  29. data/lib/fbe/if_absent.rb +2 -2
  30. data/lib/fbe/issue.rb +1 -1
  31. data/lib/fbe/iterate.rb +2 -2
  32. data/lib/fbe/just_one.rb +2 -2
  33. data/lib/fbe/middleware/formatter.rb +2 -2
  34. data/lib/fbe/middleware/quota.rb +2 -2
  35. data/lib/fbe/middleware.rb +2 -2
  36. data/lib/fbe/octo.rb +4 -4
  37. data/lib/fbe/overwrite.rb +2 -2
  38. data/lib/fbe/pmp.rb +1 -1
  39. data/lib/fbe/regularly.rb +1 -1
  40. data/lib/fbe/repeatedly.rb +1 -1
  41. data/lib/fbe/sec.rb +1 -1
  42. data/lib/fbe/unmask_repos.rb +1 -1
  43. data/lib/fbe/who.rb +1 -1
  44. data/lib/fbe.rb +3 -3
  45. data/rules/basic.fe +1 -1
  46. data/test/fbe/middleware/test_formatter.rb +10 -8
  47. data/test/fbe/middleware/test_quota.rb +1 -1
  48. data/test/fbe/test_award.rb +6 -6
  49. data/test/fbe/test_bylaws.rb +5 -5
  50. data/test/fbe/test_conclude.rb +2 -2
  51. data/test/fbe/test_copy.rb +3 -3
  52. data/test/fbe/test_enter.rb +2 -2
  53. data/test/fbe/test_fb.rb +7 -7
  54. data/test/fbe/test_github_graph.rb +17 -17
  55. data/test/fbe/test_if_absent.rb +6 -6
  56. data/test/fbe/test_issue.rb +2 -2
  57. data/test/fbe/test_iterate.rb +2 -2
  58. data/test/fbe/test_just_one.rb +3 -3
  59. data/test/fbe/test_octo.rb +10 -10
  60. data/test/fbe/test_overwrite.rb +3 -3
  61. data/test/fbe/test_pmp.rb +3 -3
  62. data/test/fbe/test_regularly.rb +2 -2
  63. data/test/fbe/test_repeatedly.rb +2 -2
  64. data/test/fbe/test_sec.rb +2 -2
  65. data/test/fbe/test_unmask_repos.rb +6 -6
  66. data/test/fbe/test_who.rb +2 -2
  67. data/test/test__helper.rb +1 -1
  68. data/test/test_fbe.rb +3 -3
  69. metadata +6 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f75e0379657e041287f6d485353fbbbcce1636e1552f1e0c74bda9b49edf0f7f
4
- data.tar.gz: c247750a225973f8cafae4cfff8258331d559e61e854cb0706af395e28c1fc14
3
+ metadata.gz: 98738810784b2a4f40b1290f2066fdd07655a6173207bc2f7de3114614eca51b
4
+ data.tar.gz: f3a6739033cf7ab23bdbe1266f11025b72537fc6f63738b39b1ff89f217ab2cf
5
5
  SHA512:
6
- metadata.gz: 56c469eb86233927f480f4d48351651f6f7ac8caeebb7a313269511c209e06fd605552fe581c23152b0af05c1cb51dce309ea193425bca673307b4d4b331cdc7
7
- data.tar.gz: dd96a0e7430e6749aa2c9f16d38ea2b6edafbbc39476d1165f7d55ab50a6a1265ec5a0e2cbfe0db321c0a84365e0090c312c8a47fef1956e3bdcddd57c37c9ba
6
+ metadata.gz: a2b0dc04291421a421cd1f944227421e79690a80d91dc12c7f28a6f6d03e1cd956699de66a3a81f9cb71c338e669ca4a3bf02840755cf0348f3151e8329fb64c
7
+ data.tar.gz: 15e10d1840372132c368166302aa404c5a84e5f20ad09fd4abc6a85a2318cb6e0c69b11e8fc87425f5862710e72ea48e66557591879476dec7eea0ffbb1cd773
data/.0pdd.yml CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2024 Zerocracy
1
+ # Copyright (c) 2024-2025 Zerocracy
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2024 Zerocracy
1
+ # Copyright (c) 2024-2025 Zerocracy
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2024 Zerocracy
1
+ # Copyright (c) 2024-2025 Zerocracy
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -34,6 +34,6 @@ jobs:
34
34
  bundler-cache: true
35
35
  - run: bundle install
36
36
  - run: bundle exec rake
37
- - uses: codecov/codecov-action@v4.0.0-beta.3
37
+ - uses: codecov/codecov-action@v5
38
38
  with:
39
39
  token: ${{ secrets.CODECOV_TOKEN }}
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2024 Zerocracy
1
+ # Copyright (c) 2024-2025 Zerocracy
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2024 Zerocracy
1
+ # Copyright (c) 2024-2025 Zerocracy
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2024 Zerocracy
1
+ # Copyright (c) 2024-2025 Zerocracy
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2024 Zerocracy
1
+ # Copyright (c) 2024-2025 Zerocracy
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2024 Zerocracy
1
+ # Copyright (c) 2024-2025 Zerocracy
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2024 Zerocracy
1
+ # Copyright (c) 2024-2025 Zerocracy
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  # of this software and associated documentation files (the 'Software'), to deal
data/.gitignore CHANGED
@@ -5,4 +5,4 @@ coverage/
5
5
  .DS_Store
6
6
  rdoc/
7
7
  doc/
8
- .yardoc/
8
+ .yardoc/
data/.rubocop.yml CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2024 Zerocracy
1
+ # Copyright (c) 2024-2025 Zerocracy
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -27,7 +27,12 @@ AllCops:
27
27
  TargetRubyVersion: 3.2
28
28
  SuggestExtensions: false
29
29
  NewCops: enable
30
+ require:
31
+ - rubocop-minitest
32
+ - rubocop-performance
30
33
 
34
+ Minitest/EmptyLineBeforeAssertionMethods:
35
+ Enabled: false
31
36
  Style/GlobalVars:
32
37
  Enabled: false
33
38
  Lint/NestedMethodDefinition:
data/.rultor.yml CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2024 Zerocracy
1
+ # Copyright (c) 2024-2025 Zerocracy
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  # of this software and associated documentation files (the 'Software'), to deal
data/.simplecov CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  #
4
- # Copyright (c) 2024 Zerocracy
4
+ # Copyright (c) 2024-2025 Zerocracy
5
5
  #
6
6
  # Permission is hereby granted, free of charge, to any person obtaining a copy
7
7
  # of this software and associated documentation files (the 'Software'), to deal
data/.yamllint.yml CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2024 Zerocracy
1
+ # Copyright (c) 2024-2025 Zerocracy
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  # of this software and associated documentation files (the 'Software'), to deal
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2024 Zerocracy
3
+ # Copyright (c) 2024-2025 Zerocracy
4
4
  #
5
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  # of this software and associated documentation files (the 'Software'), to deal
@@ -28,9 +28,10 @@ gem 'minitest', '5.25.4', require: false
28
28
  gem 'minitest-reporters', '1.7.1', require: false
29
29
  gem 'rake', '13.2.1', require: false
30
30
  gem 'rspec-rails', '7.1.0', require: false
31
- gem 'rubocop', '1.69.2', require: false
31
+ gem 'rubocop', '1.71.0', require: false
32
+ gem 'rubocop-minitest', '0.36.0', require: false
32
33
  gem 'rubocop-performance', '1.23.0', require: false
33
- gem 'rubocop-rspec', '3.3.0', require: false
34
+ gem 'rubocop-rspec', '3.4.0', require: false
34
35
  gem 'simplecov', '0.22.0', require: false
35
36
  gem 'simplecov-cobertura', '2.1.0', require: false
36
37
  gem 'webmock', '3.24.0', require: false
data/Gemfile.lock CHANGED
@@ -5,7 +5,7 @@ PATH
5
5
  backtrace (~> 0)
6
6
  baza.rb (~> 0)
7
7
  decoor (~> 0)
8
- factbase (~> 0)
8
+ factbase (>= 0.5.2)
9
9
  faraday (~> 2)
10
10
  faraday-http-cache (~> 2)
11
11
  faraday-multipart (~> 1)
@@ -70,10 +70,10 @@ GEM
70
70
  tago (~> 0)
71
71
  typhoeus (~> 1.3)
72
72
  benchmark (0.4.0)
73
- bigdecimal (3.1.8)
73
+ bigdecimal (3.1.9)
74
74
  builder (3.3.0)
75
- concurrent-ruby (1.3.4)
76
- connection_pool (2.4.1)
75
+ concurrent-ruby (1.3.5)
76
+ connection_pool (2.5.0)
77
77
  crack (1.0.0)
78
78
  bigdecimal
79
79
  rexml
@@ -89,7 +89,7 @@ GEM
89
89
  erubi (1.13.1)
90
90
  ethon (0.16.0)
91
91
  ffi (>= 1.15.0)
92
- factbase (0.4.0)
92
+ factbase (0.5.2)
93
93
  backtrace (> 0)
94
94
  decoor (> 0)
95
95
  json (~> 2.7)
@@ -110,12 +110,13 @@ GEM
110
110
  net-http (>= 0.5.0)
111
111
  faraday-retry (2.2.1)
112
112
  faraday (~> 2.0)
113
- ffi (1.17.0-arm64-darwin)
114
- ffi (1.17.0-x64-mingw-ucrt)
115
- ffi (1.17.0-x86_64-darwin)
116
- ffi (1.17.0-x86_64-linux-gnu)
113
+ ffi (1.17.1-arm64-darwin)
114
+ ffi (1.17.1-x64-mingw-ucrt)
115
+ ffi (1.17.1-x86_64-darwin)
116
+ ffi (1.17.1-x86_64-linux-gnu)
117
117
  fiber-storage (1.0.0)
118
- gli (2.22.0)
118
+ gli (2.22.2)
119
+ ostruct
119
120
  graphql (2.4.8)
120
121
  base64
121
122
  fiber-storage
@@ -123,20 +124,21 @@ GEM
123
124
  activesupport (>= 3.0)
124
125
  graphql (>= 1.13.0)
125
126
  hashdiff (1.1.2)
126
- i18n (1.14.6)
127
+ i18n (1.14.7)
127
128
  concurrent-ruby (~> 1.0)
128
129
  io-console (0.8.0)
129
- irb (1.14.3)
130
+ irb (1.15.1)
131
+ pp (>= 0.6.0)
130
132
  rdoc (>= 4.0.0)
131
133
  reline (>= 0.4.2)
132
134
  iri (0.8.0)
133
135
  json (2.9.1)
134
- judges (0.28.1)
136
+ judges (0.31.1)
135
137
  backtrace (~> 0)
136
138
  baza.rb (~> 0)
137
139
  concurrent-ruby (~> 1.2)
138
140
  elapsed (~> 0)
139
- factbase (~> 0)
141
+ factbase (>= 0.5.0)
140
142
  gli (~> 2.21)
141
143
  iri (~> 0)
142
144
  loog (~> 0)
@@ -145,11 +147,12 @@ GEM
145
147
  others (~> 0)
146
148
  retries (~> 0)
147
149
  tago (~> 0)
150
+ timeout (~> 0)
148
151
  typhoeus (~> 1.3)
149
- language_server-protocol (3.17.0.3)
152
+ language_server-protocol (3.17.0.4)
150
153
  liquid (5.5.1)
151
- logger (1.6.4)
152
- loofah (2.23.1)
154
+ logger (1.6.5)
155
+ loofah (2.24.0)
153
156
  crass (~> 1.0.2)
154
157
  nokogiri (>= 1.12.0)
155
158
  loog (0.6.0)
@@ -163,32 +166,37 @@ GEM
163
166
  multipart-post (2.4.1)
164
167
  net-http (0.6.0)
165
168
  uri
166
- nokogiri (1.17.2-arm64-darwin)
169
+ nokogiri (1.18.2-arm64-darwin)
167
170
  racc (~> 1.4)
168
- nokogiri (1.17.2-x64-mingw-ucrt)
171
+ nokogiri (1.18.2-x64-mingw-ucrt)
169
172
  racc (~> 1.4)
170
- nokogiri (1.17.2-x86_64-darwin)
173
+ nokogiri (1.18.2-x86_64-darwin)
171
174
  racc (~> 1.4)
172
- nokogiri (1.17.2-x86_64-linux)
175
+ nokogiri (1.18.2-x86_64-linux-gnu)
173
176
  racc (~> 1.4)
174
177
  obk (0.3.1)
175
178
  octokit (9.2.0)
176
179
  faraday (>= 1, < 3)
177
180
  sawyer (~> 0.9)
181
+ ostruct (0.6.1)
178
182
  others (0.0.3)
179
183
  parallel (1.26.3)
180
- parser (3.3.6.0)
184
+ parser (3.3.7.0)
181
185
  ast (~> 2.4.1)
182
186
  racc
183
- psych (5.2.2)
187
+ pp (0.6.2)
188
+ prettyprint
189
+ prettyprint (0.2.0)
190
+ psych (5.2.3)
184
191
  date
185
192
  stringio
186
193
  public_suffix (6.0.1)
187
194
  racc (1.8.1)
188
195
  rack (3.1.8)
189
- rack-session (2.0.0)
196
+ rack-session (2.1.0)
197
+ base64 (>= 0.1.0)
190
198
  rack (>= 3.0.0)
191
- rack-test (2.1.0)
199
+ rack-test (2.2.0)
192
200
  rack (>= 1.3)
193
201
  rackup (2.2.1)
194
202
  rack (>= 3)
@@ -209,9 +217,9 @@ GEM
209
217
  zeitwerk (~> 2.6)
210
218
  rainbow (3.1.1)
211
219
  rake (13.2.1)
212
- rdoc (6.10.0)
220
+ rdoc (6.11.0)
213
221
  psych (>= 4.0.0)
214
- regexp_parser (2.9.3)
222
+ regexp_parser (2.10.0)
215
223
  reline (0.6.0)
216
224
  io-console (~> 0.5)
217
225
  retries (0.0.5)
@@ -233,7 +241,7 @@ GEM
233
241
  rspec-mocks (~> 3.13)
234
242
  rspec-support (~> 3.13)
235
243
  rspec-support (3.13.2)
236
- rubocop (1.69.2)
244
+ rubocop (1.71.0)
237
245
  json (~> 2.3)
238
246
  language_server-protocol (>= 3.17.0)
239
247
  parallel (~> 1.10)
@@ -243,12 +251,15 @@ GEM
243
251
  rubocop-ast (>= 1.36.2, < 2.0)
244
252
  ruby-progressbar (~> 1.7)
245
253
  unicode-display_width (>= 2.4.0, < 4.0)
246
- rubocop-ast (1.37.0)
254
+ rubocop-ast (1.38.0)
247
255
  parser (>= 3.3.1.0)
256
+ rubocop-minitest (0.36.0)
257
+ rubocop (>= 1.61, < 2.0)
258
+ rubocop-ast (>= 1.31.1, < 2.0)
248
259
  rubocop-performance (1.23.0)
249
260
  rubocop (>= 1.48.1, < 2.0)
250
261
  rubocop-ast (>= 1.31.1, < 2.0)
251
- rubocop-rspec (3.3.0)
262
+ rubocop-rspec (3.4.0)
252
263
  rubocop (~> 1.61)
253
264
  ruby-progressbar (1.13.0)
254
265
  sawyer (0.9.2)
@@ -267,11 +278,12 @@ GEM
267
278
  stringio (3.1.2)
268
279
  tago (0.0.2)
269
280
  thor (1.3.2)
281
+ timeout (0.4.3)
270
282
  typhoeus (1.4.1)
271
283
  ethon (>= 0.9.0)
272
284
  tzinfo (2.0.6)
273
285
  concurrent-ruby (~> 1.0)
274
- unicode-display_width (3.1.2)
286
+ unicode-display_width (3.1.4)
275
287
  unicode-emoji (~> 4.0, >= 4.0.4)
276
288
  unicode-emoji (4.0.4)
277
289
  uri (1.0.2)
@@ -303,9 +315,10 @@ DEPENDENCIES
303
315
  minitest-reporters (= 1.7.1)
304
316
  rake (= 13.2.1)
305
317
  rspec-rails (= 7.1.0)
306
- rubocop (= 1.69.2)
318
+ rubocop (= 1.71.0)
319
+ rubocop-minitest (= 0.36.0)
307
320
  rubocop-performance (= 1.23.0)
308
- rubocop-rspec (= 3.3.0)
321
+ rubocop-rspec (= 3.4.0)
309
322
  simplecov (= 0.22.0)
310
323
  simplecov-cobertura (= 2.1.0)
311
324
  webmock (= 3.24.0)
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2024 Zerocracy
3
+ Copyright (c) 2024-2025 Zerocracy
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the 'Software'), to deal
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2024 Zerocracy
3
+ # Copyright (c) 2024-2025 Zerocracy
4
4
  #
5
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  # of this software and associated documentation files (the 'Software'), to deal
@@ -4,4 +4,4 @@
4
4
  (let fee {{ -8 | times: anger }})
5
5
  (give fee "as a basis")
6
6
  "deduct ${fee} points")
7
- )
7
+ )
data/fbe.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2024 Zerocracy
3
+ # Copyright (c) 2024-2025 Zerocracy
4
4
  #
5
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  # of this software and associated documentation files (the 'Software'), to deal
@@ -42,7 +42,7 @@ Gem::Specification.new do |s|
42
42
  s.add_dependency 'backtrace', '~>0'
43
43
  s.add_dependency 'baza.rb', '~>0'
44
44
  s.add_dependency 'decoor', '~>0'
45
- s.add_dependency 'factbase', '~>0'
45
+ s.add_dependency 'factbase', '>=0.5.2'
46
46
  s.add_dependency 'faraday', '~>2'
47
47
  s.add_dependency 'faraday-http-cache', '~>2'
48
48
  s.add_dependency 'faraday-multipart', '~>1'
data/lib/fbe/award.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # MIT License
4
4
  #
5
- # Copyright (c) 2024 Zerocracy
5
+ # Copyright (c) 2024-2025 Zerocracy
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"), to deal
@@ -52,7 +52,7 @@ class Fbe::Award
52
52
  # @param [String] query The query with the bylaw
53
53
  # @param [String] judge The name of the judge
54
54
  def initialize(query = nil, judge: $judge, global: $global, options: $options, loog: $loog)
55
- query = Fbe.pmp(fb: Fbe.fb, global:, options:, loog:).hr.send(judge.gsub('-', '_')) if query.nil?
55
+ query = Fbe.pmp(fb: Fbe.fb, global:, options:, loog:).hr.send(judge.tr('-', '_')) if query.nil?
56
56
  @query = query
57
57
  end
58
58
 
@@ -60,7 +60,7 @@ class Fbe::Award
60
60
  # @param [Hash] vars Hash of variables
61
61
  # @return [Fbe::Award::Bill] The bill
62
62
  def bill(vars = {})
63
- term = Factbase::Syntax.new(@query, term: Fbe::Award::BTerm).to_term
63
+ term = Factbase::Syntax.new(Factbase.new, @query, term: Fbe::Award::BTerm).to_term
64
64
  bill = Bill.new
65
65
  vars.each { |k, v| bill.set(k, v) }
66
66
  term.bill_to(bill)
@@ -70,15 +70,16 @@ class Fbe::Award
70
70
  # Build a bylaw object from this award query.
71
71
  # @return [Fbe::Award::Bylaw] The bylaw
72
72
  def bylaw
73
- term = Factbase::Syntax.new(@query, term: Fbe::Award::PTerm).to_term
73
+ term = Factbase::Syntax.new(Factbase.new, @query, term: Fbe::Award::PTerm).to_term
74
74
  bylaw = Bylaw.new
75
75
  term.publish_to(bylaw)
76
76
  bylaw
77
77
  end
78
78
 
79
79
  # A term for bill.
80
- class BTerm
81
- def initialize(operator, operands)
80
+ class BTerm < Factbase::Term
81
+ def initialize(_fb, operator, operands)
82
+ super(nil, nil, nil)
82
83
  @op = operator
83
84
  @operands = operands
84
85
  end
@@ -87,6 +88,14 @@ class Fbe::Award
87
88
  "(#{@op} #{@operands.join(' ')})"
88
89
  end
89
90
 
91
+ def static?
92
+ true
93
+ end
94
+
95
+ def abstract?
96
+ false
97
+ end
98
+
90
99
  def bill_to(bill)
91
100
  case @op
92
101
  when :award
@@ -174,8 +183,9 @@ class Fbe::Award
174
183
  end
175
184
 
176
185
  # A term for bylaw.
177
- class PTerm
178
- def initialize(operator, operands)
186
+ class PTerm < Factbase::Term
187
+ def initialize(_fb, operator, operands)
188
+ super(nil, nil, nil)
179
189
  @op = operator
180
190
  @operands = operands
181
191
  end
@@ -221,6 +231,14 @@ class Fbe::Award
221
231
  end
222
232
  end
223
233
 
234
+ def static?
235
+ true
236
+ end
237
+
238
+ def abstract?
239
+ false
240
+ end
241
+
224
242
  def publish_to(bylaw)
225
243
  case @op
226
244
  when :award
@@ -272,7 +290,7 @@ class Fbe::Award
272
290
  9 => '₉'
273
291
  }
274
292
  s.gsub!(/([a-z]+)([0-9])/) { |_| "#{Regexp.last_match[1]}#{subs[Regexp.last_match[2].to_i]}" }
275
- "_#{s.gsub('_', '-')}_"
293
+ "_#{s.tr('_', '-')}_"
276
294
  when Integer, Float
277
295
  "**#{any}**"
278
296
  else
@@ -301,7 +319,7 @@ class Fbe::Award
301
319
  end
302
320
 
303
321
  def points
304
- @lines.map { |l| l[:v] }.inject(&:+).to_f.round.to_i
322
+ @lines.sum { |l| l[:v] }.to_f.round.to_i
305
323
  end
306
324
 
307
325
  def greeting
data/lib/fbe/bylaws.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # MIT License
4
4
  #
5
- # Copyright (c) 2024 Zerocracy
5
+ # Copyright (c) 2024-2025 Zerocracy
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"), to deal
data/lib/fbe/conclude.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # MIT License
4
4
  #
5
- # Copyright (c) 2024 Zerocracy
5
+ # Copyright (c) 2024-2025 Zerocracy
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"), to deal
@@ -61,7 +61,7 @@ end
61
61
  # new facts, letting the block in the {Fbe::Conclude#draw} deal with them.
62
62
  #
63
63
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
64
- # Copyright:: Copyright (c) 2024 Zerocracy
64
+ # Copyright:: Copyright (c) 2024-2025 Zerocracy
65
65
  # License:: MIT
66
66
  class Fbe::Conclude
67
67
  # Ctor.
@@ -180,7 +180,7 @@ class Fbe::Conclude
180
180
  def fill(fact, prev)
181
181
  @follows.each do |follow|
182
182
  v = prev.send(follow)
183
- fact.send("#{follow}=", v)
183
+ fact.send(:"#{follow}=", v)
184
184
  end
185
185
  r = yield fact, prev
186
186
  return unless r.is_a?(String)
data/lib/fbe/copy.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # MIT License
4
4
  #
5
- # Copyright (c) 2024 Zerocracy
5
+ # Copyright (c) 2024-2025 Zerocracy
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"), to deal
data/lib/fbe/enter.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # MIT License
4
4
  #
5
- # Copyright (c) 2024 Zerocracy
5
+ # Copyright (c) 2024-2025 Zerocracy
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"), to deal
data/lib/fbe/fb.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # MIT License
4
4
  #
5
- # Copyright (c) 2024 Zerocracy
5
+ # Copyright (c) 2024-2025 Zerocracy
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"), to deal
@@ -2,7 +2,7 @@
2
2
 
3
3
  # MIT License
4
4
  #
5
- # Copyright (c) 2024 Zerocracy
5
+ # Copyright (c) 2024-2025 Zerocracy
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"), to deal
@@ -45,7 +45,7 @@ end
45
45
  # A client to GitHub GraphQL.
46
46
  #
47
47
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
48
- # Copyright:: Copyright (c) 2024 Zerocracy
48
+ # Copyright:: Copyright (c) 2024-2025 Zerocracy
49
49
  # License:: MIT
50
50
  class Fbe::Graph
51
51
  def initialize(token:, host: 'api.github.com')
data/lib/fbe/if_absent.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # MIT License
4
4
  #
5
- # Copyright (c) 2024 Zerocracy
5
+ # Copyright (c) 2024-2025 Zerocracy
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"), to deal
@@ -74,6 +74,6 @@ def Fbe.if_absent(fb: Fbe.fb)
74
74
  before = fb.query(q).each.to_a.first
75
75
  return nil if before
76
76
  n = fb.insert
77
- attrs.each { |k, v| n.send("#{k}=", v) }
77
+ attrs.each { |k, v| n.send(:"#{k}=", v) }
78
78
  n
79
79
  end
data/lib/fbe/issue.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # MIT License
4
4
  #
5
- # Copyright (c) 2024 Zerocracy
5
+ # Copyright (c) 2024-2025 Zerocracy
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"), to deal
data/lib/fbe/iterate.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # MIT License
4
4
  #
5
- # Copyright (c) 2024 Zerocracy
5
+ # Copyright (c) 2024-2025 Zerocracy
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"), to deal
@@ -50,7 +50,7 @@ end
50
50
  # beginning.
51
51
  #
52
52
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
53
- # Copyright:: Copyright (c) 2024 Zerocracy
53
+ # Copyright:: Copyright (c) 2024-2025 Zerocracy
54
54
  # License:: MIT
55
55
  class Fbe::Iterate
56
56
  # Ctor.
data/lib/fbe/just_one.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # MIT License
4
4
  #
5
- # Copyright (c) 2024 Zerocracy
5
+ # Copyright (c) 2024-2025 Zerocracy
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"), to deal
@@ -68,6 +68,6 @@ def Fbe.just_one(fb: Fbe.fb)
68
68
  before = fb.query(q).each.to_a.first
69
69
  return before unless before.nil?
70
70
  n = fb.insert
71
- attrs.each { |k, v| n.send("#{k}=", v) }
71
+ attrs.each { |k, v| n.send(:"#{k}=", v) }
72
72
  n
73
73
  end