fbe 0.1.0 → 0.2.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/.rubocop.yml +2 -0
- data/Gemfile +4 -3
- data/Gemfile.lock +35 -27
- data/REUSE.toml +7 -2
- data/Rakefile +16 -1
- data/fbe.gemspec +1 -1
- data/lib/fbe/award.rb +6 -16
- data/lib/fbe/fb.rb +2 -2
- data/lib/fbe/github_graph.rb +1 -0
- data/lib/fbe/iterate.rb +1 -1
- data/lib/fbe/middleware/formatter.rb +1 -0
- data/lib/fbe/middleware/quota.rb +1 -0
- data/lib/fbe.rb +1 -1
- data/rules/basic.fe +1 -1
- data/test/fbe/middleware/test_quota.rb +5 -0
- data/test/fbe/test_enter.rb +3 -1
- data/test/fbe/test_github_graph.rb +1 -0
- data/test/fbe/test_issue.rb +3 -1
- data/test/fbe/test_sec.rb +1 -0
- data/test/fbe/test_who.rb +3 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e30d3c664dd4f68ba599c702153fd09dc1e7cb9159d52a9ca131447dfe6bcda
|
4
|
+
data.tar.gz: bb35a47f645aaa956f8476759393c29be14ca339b64b4798bfe6d3d310ce79a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 956a7c66623e26e3d642c634fd0e382073962bfbbb7b28d1f6a686b775491f98ca8e2bd5b73a5bbae52fb6feaae40a503e674c694e7a65bb92b6e39de4e649cd
|
7
|
+
data.tar.gz: 50532d3aa0f16a7f60d5f81793b28cd1f836312116d3791c9b552de060f7b95ba18993d85d83d0a6917ec111aeb7223f588aafe04809e8df8a4185cad6fc5237
|
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
@@ -6,16 +6,17 @@
|
|
6
6
|
source 'https://rubygems.org'
|
7
7
|
gemspec
|
8
8
|
|
9
|
-
gem 'minitest', '5.25.
|
9
|
+
gem 'minitest', '5.25.5', require: false
|
10
10
|
gem 'minitest-reporters', '>=1.7', require: false
|
11
|
+
gem 'qbash', '>0', require: false
|
11
12
|
gem 'rake', '>=13', require: false
|
12
13
|
gem 'rspec-rails', '>0', require: false
|
13
|
-
gem 'rubocop', '1.73.
|
14
|
+
gem 'rubocop', '1.73.2', require: false
|
14
15
|
gem 'rubocop-minitest', '>0', require: false
|
15
16
|
gem 'rubocop-performance', '>0', require: false
|
16
17
|
gem 'rubocop-rake', '>0', require: false
|
17
18
|
gem 'rubocop-rspec', '>0', require: false
|
18
19
|
gem 'simplecov', '0.22.0', require: false
|
19
20
|
gem 'simplecov-cobertura', '2.1.0', require: false
|
20
|
-
gem 'webmock', '3.25.
|
21
|
+
gem 'webmock', '3.25.1', require: false
|
21
22
|
gem 'yard', '0.9.37', 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.9.1)
|
9
9
|
faraday (~> 2)
|
10
10
|
faraday-http-cache (~> 2)
|
11
11
|
faraday-multipart (~> 1)
|
@@ -22,9 +22,9 @@ PATH
|
|
22
22
|
GEM
|
23
23
|
remote: https://rubygems.org/
|
24
24
|
specs:
|
25
|
-
actionpack (8.0.
|
26
|
-
actionview (= 8.0.
|
27
|
-
activesupport (= 8.0.
|
25
|
+
actionpack (8.0.2)
|
26
|
+
actionview (= 8.0.2)
|
27
|
+
activesupport (= 8.0.2)
|
28
28
|
nokogiri (>= 1.8.5)
|
29
29
|
rack (>= 2.2.4)
|
30
30
|
rack-session (>= 1.0.1)
|
@@ -32,13 +32,13 @@ GEM
|
|
32
32
|
rails-dom-testing (~> 2.2)
|
33
33
|
rails-html-sanitizer (~> 1.6)
|
34
34
|
useragent (~> 0.16)
|
35
|
-
actionview (8.0.
|
36
|
-
activesupport (= 8.0.
|
35
|
+
actionview (8.0.2)
|
36
|
+
activesupport (= 8.0.2)
|
37
37
|
builder (~> 3.1)
|
38
38
|
erubi (~> 1.11)
|
39
39
|
rails-dom-testing (~> 2.2)
|
40
40
|
rails-html-sanitizer (~> 1.6)
|
41
|
-
activesupport (8.0.
|
41
|
+
activesupport (8.0.2)
|
42
42
|
base64
|
43
43
|
benchmark (>= 0.3)
|
44
44
|
bigdecimal
|
@@ -89,14 +89,14 @@ GEM
|
|
89
89
|
erubi (1.13.1)
|
90
90
|
ethon (0.16.0)
|
91
91
|
ffi (>= 1.15.0)
|
92
|
-
factbase (0.
|
93
|
-
backtrace (
|
94
|
-
decoor (
|
92
|
+
factbase (0.9.1)
|
93
|
+
backtrace (>= 0.4.0)
|
94
|
+
decoor (>= 0.0.1)
|
95
95
|
json (~> 2.7)
|
96
|
-
loog (
|
96
|
+
loog (>= 0.6.0)
|
97
97
|
nokogiri (~> 1.10)
|
98
|
-
others (
|
99
|
-
tago (
|
98
|
+
others (>= 0.0.3)
|
99
|
+
tago (>= 0.0.2)
|
100
100
|
yaml (~> 0.3)
|
101
101
|
faraday (2.12.2)
|
102
102
|
faraday-net_http (>= 2.0, < 3.5)
|
@@ -117,7 +117,7 @@ GEM
|
|
117
117
|
fiber-storage (1.0.0)
|
118
118
|
gli (2.22.2)
|
119
119
|
ostruct
|
120
|
-
graphql (2.4.
|
120
|
+
graphql (2.4.13)
|
121
121
|
base64
|
122
122
|
fiber-storage
|
123
123
|
logger
|
@@ -133,13 +133,13 @@ GEM
|
|
133
133
|
rdoc (>= 4.0.0)
|
134
134
|
reline (>= 0.4.2)
|
135
135
|
iri (0.10.0)
|
136
|
-
json (2.10.
|
137
|
-
judges (0.
|
136
|
+
json (2.10.2)
|
137
|
+
judges (0.36.3)
|
138
138
|
backtrace (~> 0)
|
139
139
|
baza.rb (~> 0)
|
140
140
|
concurrent-ruby (~> 1.2)
|
141
141
|
elapsed (~> 0)
|
142
|
-
factbase (>= 0.
|
142
|
+
factbase (>= 0.9.1)
|
143
143
|
gli (~> 2.21)
|
144
144
|
iri (~> 0)
|
145
145
|
loog (~> 0)
|
@@ -149,6 +149,7 @@ GEM
|
|
149
149
|
retries (~> 0)
|
150
150
|
tago (~> 0)
|
151
151
|
timeout (~> 0)
|
152
|
+
total (~> 0)
|
152
153
|
typhoeus (~> 1.3)
|
153
154
|
language_server-protocol (3.17.0.4)
|
154
155
|
lint_roller (1.1.0)
|
@@ -158,7 +159,7 @@ GEM
|
|
158
159
|
crass (~> 1.0.2)
|
159
160
|
nokogiri (>= 1.12.0)
|
160
161
|
loog (0.6.0)
|
161
|
-
minitest (5.25.
|
162
|
+
minitest (5.25.5)
|
162
163
|
minitest-reporters (1.7.1)
|
163
164
|
ansi
|
164
165
|
builder
|
@@ -193,8 +194,13 @@ GEM
|
|
193
194
|
date
|
194
195
|
stringio
|
195
196
|
public_suffix (6.0.1)
|
197
|
+
qbash (0.4.0)
|
198
|
+
backtrace (> 0)
|
199
|
+
elapsed (> 0)
|
200
|
+
loog (> 0)
|
201
|
+
tago (> 0)
|
196
202
|
racc (1.8.1)
|
197
|
-
rack (3.1.
|
203
|
+
rack (3.1.12)
|
198
204
|
rack-session (2.1.0)
|
199
205
|
base64 (>= 0.1.0)
|
200
206
|
rack (>= 3.0.0)
|
@@ -209,9 +215,9 @@ GEM
|
|
209
215
|
rails-html-sanitizer (1.6.2)
|
210
216
|
loofah (~> 2.21)
|
211
217
|
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
|
212
|
-
railties (8.0.
|
213
|
-
actionpack (= 8.0.
|
214
|
-
activesupport (= 8.0.
|
218
|
+
railties (8.0.2)
|
219
|
+
actionpack (= 8.0.2)
|
220
|
+
activesupport (= 8.0.2)
|
215
221
|
irb (~> 1.13)
|
216
222
|
rackup (>= 1.0.0)
|
217
223
|
rake (>= 12.2)
|
@@ -243,7 +249,7 @@ GEM
|
|
243
249
|
rspec-mocks (~> 3.13)
|
244
250
|
rspec-support (~> 3.13)
|
245
251
|
rspec-support (3.13.2)
|
246
|
-
rubocop (1.73.
|
252
|
+
rubocop (1.73.2)
|
247
253
|
json (~> 2.3)
|
248
254
|
language_server-protocol (~> 3.17.0.2)
|
249
255
|
lint_roller (~> 1.1.0)
|
@@ -288,6 +294,7 @@ GEM
|
|
288
294
|
tago (0.0.2)
|
289
295
|
thor (1.3.2)
|
290
296
|
timeout (0.4.3)
|
297
|
+
total (0.4.1)
|
291
298
|
typhoeus (1.4.1)
|
292
299
|
ethon (>= 0.9.0)
|
293
300
|
tzinfo (2.0.6)
|
@@ -300,7 +307,7 @@ GEM
|
|
300
307
|
verbose (0.0.2)
|
301
308
|
loog (~> 0.2)
|
302
309
|
tago (~> 0.0)
|
303
|
-
webmock (3.25.
|
310
|
+
webmock (3.25.1)
|
304
311
|
addressable (>= 2.8.0)
|
305
312
|
crack (>= 0.3.2)
|
306
313
|
hashdiff (>= 0.4.0, < 2.0.0)
|
@@ -319,18 +326,19 @@ PLATFORMS
|
|
319
326
|
|
320
327
|
DEPENDENCIES
|
321
328
|
fbe!
|
322
|
-
minitest (= 5.25.
|
329
|
+
minitest (= 5.25.5)
|
323
330
|
minitest-reporters (>= 1.7)
|
331
|
+
qbash (> 0)
|
324
332
|
rake (>= 13)
|
325
333
|
rspec-rails (> 0)
|
326
|
-
rubocop (= 1.73.
|
334
|
+
rubocop (= 1.73.2)
|
327
335
|
rubocop-minitest (> 0)
|
328
336
|
rubocop-performance (> 0)
|
329
337
|
rubocop-rake (> 0)
|
330
338
|
rubocop-rspec (> 0)
|
331
339
|
simplecov (= 0.22.0)
|
332
340
|
simplecov-cobertura (= 2.1.0)
|
333
|
-
webmock (= 3.25.
|
341
|
+
webmock (= 3.25.1)
|
334
342
|
yard (= 0.9.37)
|
335
343
|
|
336
344
|
BUNDLED WITH
|
data/REUSE.toml
CHANGED
@@ -4,6 +4,9 @@
|
|
4
4
|
version = 1
|
5
5
|
[[annotations]]
|
6
6
|
path = [
|
7
|
+
"**.json",
|
8
|
+
"**.md",
|
9
|
+
"**.txt",
|
7
10
|
"**/*.csv",
|
8
11
|
"**/*.fe",
|
9
12
|
"**/*.jpg",
|
@@ -15,13 +18,15 @@ path = [
|
|
15
18
|
"**/*.svg",
|
16
19
|
"**/*.txt",
|
17
20
|
"**/*.vm",
|
21
|
+
"**/.DS_Store",
|
18
22
|
"**/.gitignore",
|
23
|
+
"**/.pdd",
|
19
24
|
"**/CNAME",
|
25
|
+
"**/Gemfile.lock",
|
26
|
+
".DS_Store",
|
20
27
|
".gitattributes",
|
21
28
|
".gitignore",
|
22
|
-
".gitleaksignore",
|
23
29
|
".pdd",
|
24
|
-
".xcop",
|
25
30
|
"Gemfile.lock",
|
26
31
|
"README.md",
|
27
32
|
"renovate.json",
|
data/Rakefile
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Zerocracy
|
4
4
|
# SPDX-License-Identifier: MIT
|
5
5
|
|
6
|
+
require 'qbash'
|
6
7
|
require 'rubygems'
|
7
8
|
require 'rake'
|
8
9
|
require 'rake/clean'
|
@@ -17,7 +18,7 @@ end
|
|
17
18
|
|
18
19
|
ENV['RACK_ENV'] = 'test'
|
19
20
|
|
20
|
-
task default: %i[clean test rubocop yard]
|
21
|
+
task default: %i[clean test picks reqs rubocop yard]
|
21
22
|
|
22
23
|
require 'rake/testtask'
|
23
24
|
desc 'Run all unit tests'
|
@@ -29,6 +30,20 @@ Rake::TestTask.new(:test) do |test|
|
|
29
30
|
test.verbose = false
|
30
31
|
end
|
31
32
|
|
33
|
+
desc 'Run them via Ruby, one by one'
|
34
|
+
task :picks do
|
35
|
+
Dir['test/**/*.rb'].each do |f|
|
36
|
+
qbash("bundle exec ruby #{Shellwords.escape(f)}", log: $stdout)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
desc 'Require them via Ruby, one by one'
|
41
|
+
task :reqs do
|
42
|
+
Dir['lib/**/*.rb'].each do |f|
|
43
|
+
qbash("bundle exec ruby #{Shellwords.escape(f)}", log: $stdout)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
32
47
|
require 'yard'
|
33
48
|
desc 'Build Yard documentation'
|
34
49
|
YARD::Rake::YardocTask.new do |t|
|
data/fbe.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
|
|
25
25
|
s.add_dependency 'backtrace', '~>0'
|
26
26
|
s.add_dependency 'baza.rb', '~>0'
|
27
27
|
s.add_dependency 'decoor', '~>0'
|
28
|
-
s.add_dependency 'factbase', '>=0.
|
28
|
+
s.add_dependency 'factbase', '>=0.9.1'
|
29
29
|
s.add_dependency 'faraday', '~>2'
|
30
30
|
s.add_dependency 'faraday-http-cache', '~>2'
|
31
31
|
s.add_dependency 'faraday-multipart', '~>1'
|
data/lib/fbe/award.rb
CHANGED
@@ -41,7 +41,8 @@ class Fbe::Award
|
|
41
41
|
# @param [Hash] vars Hash of variables
|
42
42
|
# @return [Fbe::Award::Bill] The bill
|
43
43
|
def bill(vars = {})
|
44
|
-
term = Factbase::Syntax.new(
|
44
|
+
term = Factbase::Syntax.new(@query).to_term
|
45
|
+
term.redress!(Fbe::Award::BTerm)
|
45
46
|
bill = Bill.new
|
46
47
|
vars.each { |k, v| bill.set(k, v) }
|
47
48
|
term.bill_to(bill)
|
@@ -51,20 +52,15 @@ class Fbe::Award
|
|
51
52
|
# Build a bylaw object from this award query.
|
52
53
|
# @return [Fbe::Award::Bylaw] The bylaw
|
53
54
|
def bylaw
|
54
|
-
term = Factbase::Syntax.new(
|
55
|
+
term = Factbase::Syntax.new(@query).to_term
|
56
|
+
term.redress!(Fbe::Award::PTerm)
|
55
57
|
bylaw = Bylaw.new
|
56
58
|
term.publish_to(bylaw)
|
57
59
|
bylaw
|
58
60
|
end
|
59
61
|
|
60
62
|
# A term for bill.
|
61
|
-
|
62
|
-
def initialize(_fb, operator, operands)
|
63
|
-
super(nil, nil, nil)
|
64
|
-
@op = operator
|
65
|
-
@operands = operands
|
66
|
-
end
|
67
|
-
|
63
|
+
module BTerm
|
68
64
|
def to_s
|
69
65
|
"(#{@op} #{@operands.join(' ')})"
|
70
66
|
end
|
@@ -164,13 +160,7 @@ class Fbe::Award
|
|
164
160
|
end
|
165
161
|
|
166
162
|
# A term for bylaw.
|
167
|
-
|
168
|
-
def initialize(_fb, operator, operands)
|
169
|
-
super(nil, nil, nil)
|
170
|
-
@op = operator
|
171
|
-
@operands = operands
|
172
|
-
end
|
173
|
-
|
163
|
+
module PTerm
|
174
164
|
def to_s
|
175
165
|
case @op
|
176
166
|
when :total
|
data/lib/fbe/fb.rb
CHANGED
@@ -3,12 +3,12 @@
|
|
3
3
|
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Zerocracy
|
4
4
|
# SPDX-License-Identifier: MIT
|
5
5
|
|
6
|
-
require 'loog'
|
7
|
-
require 'judges'
|
8
6
|
require 'factbase'
|
9
7
|
require 'factbase/logged'
|
10
8
|
require 'factbase/pre'
|
11
9
|
require 'factbase/rules'
|
10
|
+
require 'judges'
|
11
|
+
require 'loog'
|
12
12
|
require_relative '../fbe'
|
13
13
|
|
14
14
|
# Returns an instance of +Factbase+ (cached).
|
data/lib/fbe/github_graph.rb
CHANGED
data/lib/fbe/iterate.rb
CHANGED
@@ -126,7 +126,7 @@ class Fbe::Iterate
|
|
126
126
|
).one
|
127
127
|
@fb.query("(and (eq what '#{@label}') (eq where 'github') (eq repository #{rid}))").delete!
|
128
128
|
before = before.nil? ? @since : before.first
|
129
|
-
nxt = @fb.query(@query).one(before:, repository: rid)
|
129
|
+
nxt = @fb.query(@query).one(@fb, before:, repository: rid)
|
130
130
|
after =
|
131
131
|
if nxt.nil?
|
132
132
|
@loog.debug("Next element after ##{before} not suggested, re-starting from ##{@since}: #{@query}")
|
data/lib/fbe/middleware/quota.rb
CHANGED
data/lib/fbe.rb
CHANGED
data/rules/basic.fe
CHANGED
@@ -5,7 +5,12 @@
|
|
5
5
|
|
6
6
|
require 'faraday'
|
7
7
|
require 'logger'
|
8
|
+
require 'loog'
|
9
|
+
require 'judges'
|
10
|
+
require 'judges/options'
|
8
11
|
require_relative '../../../lib/fbe/middleware'
|
12
|
+
require_relative '../../../lib/fbe/middleware/quota'
|
13
|
+
require_relative '../../test__helper'
|
9
14
|
|
10
15
|
class QuotaTest < Minitest::Test
|
11
16
|
class FakeApp
|
data/test/fbe/test_enter.rb
CHANGED
@@ -3,9 +3,11 @@
|
|
3
3
|
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Zerocracy
|
4
4
|
# SPDX-License-Identifier: MIT
|
5
5
|
|
6
|
+
require 'judges/options'
|
6
7
|
require 'loog'
|
7
|
-
|
8
|
+
require 'webmock/minitest'
|
8
9
|
require_relative '../../lib/fbe/enter'
|
10
|
+
require_relative '../test__helper'
|
9
11
|
|
10
12
|
# Test.
|
11
13
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
data/test/fbe/test_issue.rb
CHANGED
@@ -3,9 +3,11 @@
|
|
3
3
|
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Zerocracy
|
4
4
|
# SPDX-License-Identifier: MIT
|
5
5
|
|
6
|
+
require 'factbase'
|
7
|
+
require 'judges/options'
|
6
8
|
require 'loog'
|
7
|
-
require_relative '../test__helper'
|
8
9
|
require_relative '../../lib/fbe/issue'
|
10
|
+
require_relative '../test__helper'
|
9
11
|
|
10
12
|
# Test.
|
11
13
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
data/test/fbe/test_sec.rb
CHANGED
data/test/fbe/test_who.rb
CHANGED
@@ -3,9 +3,11 @@
|
|
3
3
|
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Zerocracy
|
4
4
|
# SPDX-License-Identifier: MIT
|
5
5
|
|
6
|
+
require 'factbase'
|
7
|
+
require 'judges/options'
|
6
8
|
require 'loog'
|
7
|
-
require_relative '../test__helper'
|
8
9
|
require_relative '../../lib/fbe/who'
|
10
|
+
require_relative '../test__helper'
|
9
11
|
|
10
12
|
# Test.
|
11
13
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fbe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-03-
|
10
|
+
date: 2025-03-13 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: backtrace
|
@@ -57,14 +57,14 @@ dependencies:
|
|
57
57
|
requirements:
|
58
58
|
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: 0.
|
60
|
+
version: 0.9.1
|
61
61
|
type: :runtime
|
62
62
|
prerelease: false
|
63
63
|
version_requirements: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
65
|
- - ">="
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: 0.
|
67
|
+
version: 0.9.1
|
68
68
|
- !ruby/object:Gem::Dependency
|
69
69
|
name: faraday
|
70
70
|
requirement: !ruby/object:Gem::Requirement
|