fbe 0.0.14 → 0.0.15
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 +3 -2
- data/Gemfile.lock +20 -13
- data/fbe.gemspec +13 -13
- data/lib/fbe/fb.rb +2 -2
- data/lib/fbe/iterate.rb +4 -5
- data/lib/fbe/octo.rb +1 -1
- data/lib/fbe.rb +1 -1
- data/test/fbe/test_conclude.rb +18 -1
- data/test/fbe/test_fb.rb +2 -0
- data/test/test__helper.rb +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c5ea827d19e33c1c0ad518ddbb0d72d258e3dadddbff602160239f24484404e7
|
|
4
|
+
data.tar.gz: 120705aa037a3b913df3e2bf71345866d1116c613289ae18bad45a00e4cd12c2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e67f7173ede47f85219145b238557ee902a9c9bad68eb3282fb6ca6b05988cda85c12c645204f1687637edd48aea575e579e6ca07977f731bb62319e1b2f992c
|
|
7
|
+
data.tar.gz: da98195d8f36a36625da70cf38a0f5342d62e09da6ee40fef291e22ccf02f29487462bdda5e212aaa6fd4855ca6ddde1ea1abf9bee84ab3693a839013f844824
|
data/Gemfile
CHANGED
|
@@ -24,11 +24,12 @@ source 'https://rubygems.org'
|
|
|
24
24
|
gemspec
|
|
25
25
|
|
|
26
26
|
gem 'minitest', '5.24.1', require: false
|
|
27
|
+
gem 'minitest-reporters', '1.6.1', require: false
|
|
27
28
|
gem 'rake', '13.2.1', require: false
|
|
28
29
|
gem 'rspec-rails', '6.1.3', require: false
|
|
29
|
-
gem 'rubocop', '1.
|
|
30
|
+
gem 'rubocop', '1.65.0', require: false
|
|
30
31
|
gem 'rubocop-performance', '1.21.1', require: false
|
|
31
|
-
gem 'rubocop-rspec', '3.0.
|
|
32
|
+
gem 'rubocop-rspec', '3.0.3', require: false
|
|
32
33
|
gem 'simplecov', '0.22.0', require: false
|
|
33
34
|
gem 'simplecov-cobertura', '2.1.0', require: false
|
|
34
35
|
gem 'yard', '0.9.36', require: false
|
data/Gemfile.lock
CHANGED
|
@@ -47,6 +47,7 @@ GEM
|
|
|
47
47
|
tzinfo (~> 2.0)
|
|
48
48
|
addressable (2.8.7)
|
|
49
49
|
public_suffix (>= 2.0.2, < 7.0)
|
|
50
|
+
ansi (1.5.0)
|
|
50
51
|
ast (2.4.2)
|
|
51
52
|
backtrace (0.4.0)
|
|
52
53
|
base64 (0.2.0)
|
|
@@ -95,18 +96,18 @@ GEM
|
|
|
95
96
|
reline (>= 0.4.2)
|
|
96
97
|
iri (0.8.0)
|
|
97
98
|
json (2.7.2)
|
|
98
|
-
judges (0.
|
|
99
|
-
backtrace (~> 0
|
|
99
|
+
judges (0.17.0)
|
|
100
|
+
backtrace (~> 0)
|
|
100
101
|
concurrent-ruby (~> 1.2)
|
|
101
|
-
factbase (~> 0
|
|
102
|
+
factbase (~> 0)
|
|
102
103
|
gli (~> 2.21)
|
|
103
|
-
iri (~> 0
|
|
104
|
-
loog (~> 0
|
|
104
|
+
iri (~> 0)
|
|
105
|
+
loog (~> 0)
|
|
105
106
|
moments (~> 0.3)
|
|
106
107
|
nokogiri (~> 1.10)
|
|
107
|
-
others (~> 0
|
|
108
|
-
retries (~> 0
|
|
109
|
-
tago (~> 0
|
|
108
|
+
others (~> 0)
|
|
109
|
+
retries (~> 0)
|
|
110
|
+
tago (~> 0)
|
|
110
111
|
typhoeus (~> 1.3)
|
|
111
112
|
language_server-protocol (3.17.0.3)
|
|
112
113
|
logger (1.6.0)
|
|
@@ -115,6 +116,11 @@ GEM
|
|
|
115
116
|
nokogiri (>= 1.12.0)
|
|
116
117
|
loog (0.5.2)
|
|
117
118
|
minitest (5.24.1)
|
|
119
|
+
minitest-reporters (1.6.1)
|
|
120
|
+
ansi
|
|
121
|
+
builder
|
|
122
|
+
minitest (>= 5.0)
|
|
123
|
+
ruby-progressbar
|
|
118
124
|
moments (0.3.0)
|
|
119
125
|
multipart-post (2.4.1)
|
|
120
126
|
mutex_m (0.2.0)
|
|
@@ -191,13 +197,13 @@ GEM
|
|
|
191
197
|
rspec-mocks (~> 3.13)
|
|
192
198
|
rspec-support (~> 3.13)
|
|
193
199
|
rspec-support (3.13.1)
|
|
194
|
-
rubocop (1.
|
|
200
|
+
rubocop (1.65.0)
|
|
195
201
|
json (~> 2.3)
|
|
196
202
|
language_server-protocol (>= 3.17.0)
|
|
197
203
|
parallel (~> 1.10)
|
|
198
204
|
parser (>= 3.3.0.2)
|
|
199
205
|
rainbow (>= 2.2.2, < 4.0)
|
|
200
|
-
regexp_parser (>=
|
|
206
|
+
regexp_parser (>= 2.4, < 3.0)
|
|
201
207
|
rexml (>= 3.2.5, < 4.0)
|
|
202
208
|
rubocop-ast (>= 1.31.1, < 2.0)
|
|
203
209
|
ruby-progressbar (~> 1.7)
|
|
@@ -207,7 +213,7 @@ GEM
|
|
|
207
213
|
rubocop-performance (1.21.1)
|
|
208
214
|
rubocop (>= 1.48.1, < 2.0)
|
|
209
215
|
rubocop-ast (>= 1.31.1, < 2.0)
|
|
210
|
-
rubocop-rspec (3.0.
|
|
216
|
+
rubocop-rspec (3.0.3)
|
|
211
217
|
rubocop (~> 1.61)
|
|
212
218
|
ruby-progressbar (1.13.0)
|
|
213
219
|
sawyer (0.9.2)
|
|
@@ -249,11 +255,12 @@ PLATFORMS
|
|
|
249
255
|
DEPENDENCIES
|
|
250
256
|
fbe!
|
|
251
257
|
minitest (= 5.24.1)
|
|
258
|
+
minitest-reporters (= 1.6.1)
|
|
252
259
|
rake (= 13.2.1)
|
|
253
260
|
rspec-rails (= 6.1.3)
|
|
254
|
-
rubocop (= 1.
|
|
261
|
+
rubocop (= 1.65.0)
|
|
255
262
|
rubocop-performance (= 1.21.1)
|
|
256
|
-
rubocop-rspec (= 3.0.
|
|
263
|
+
rubocop-rspec (= 3.0.3)
|
|
257
264
|
simplecov (= 0.22.0)
|
|
258
265
|
simplecov-cobertura (= 2.1.0)
|
|
259
266
|
yard (= 0.9.36)
|
data/fbe.gemspec
CHANGED
|
@@ -39,18 +39,18 @@ Gem::Specification.new do |s|
|
|
|
39
39
|
s.files = `git ls-files`.split($RS)
|
|
40
40
|
s.rdoc_options = ['--charset=UTF-8']
|
|
41
41
|
s.extra_rdoc_files = ['README.md', 'LICENSE.txt']
|
|
42
|
-
s.
|
|
43
|
-
s.
|
|
44
|
-
s.
|
|
45
|
-
s.
|
|
46
|
-
s.
|
|
47
|
-
s.
|
|
48
|
-
s.
|
|
49
|
-
s.
|
|
50
|
-
s.
|
|
51
|
-
s.
|
|
52
|
-
s.
|
|
53
|
-
s.
|
|
54
|
-
s.
|
|
42
|
+
s.add_dependency 'backtrace'
|
|
43
|
+
s.add_dependency 'decoor'
|
|
44
|
+
s.add_dependency 'factbase'
|
|
45
|
+
s.add_dependency 'faraday'
|
|
46
|
+
s.add_dependency 'faraday-http-cache'
|
|
47
|
+
s.add_dependency 'faraday-multipart'
|
|
48
|
+
s.add_dependency 'faraday-retry'
|
|
49
|
+
s.add_dependency 'judges'
|
|
50
|
+
s.add_dependency 'loog'
|
|
51
|
+
s.add_dependency 'obk'
|
|
52
|
+
s.add_dependency 'octokit'
|
|
53
|
+
s.add_dependency 'others'
|
|
54
|
+
s.add_dependency 'verbose'
|
|
55
55
|
s.metadata['rubygems_mfa_required'] = 'true'
|
|
56
56
|
end
|
data/lib/fbe/fb.rb
CHANGED
|
@@ -30,7 +30,7 @@ require 'factbase/pre'
|
|
|
30
30
|
require 'factbase/rules'
|
|
31
31
|
require_relative '../fbe'
|
|
32
32
|
|
|
33
|
-
def Fbe.fb(fb: $fb, global: $global, options: $options)
|
|
33
|
+
def Fbe.fb(fb: $fb, global: $global, options: $options, loog: $loog)
|
|
34
34
|
global[:fb] ||= begin
|
|
35
35
|
rules = Dir.glob(File.join('rules', '*.fe')).map { |f| File.read(f) }
|
|
36
36
|
fbe = Factbase::Rules.new(
|
|
@@ -44,6 +44,6 @@ def Fbe.fb(fb: $fb, global: $global, options: $options)
|
|
|
44
44
|
f._time = Time.now
|
|
45
45
|
f._version = "#{Factbase::VERSION}/#{Judges::VERSION}/#{options.judges_action_version}"
|
|
46
46
|
end
|
|
47
|
-
Factbase::Looged.new(fbe,
|
|
47
|
+
Factbase::Looged.new(fbe, loog)
|
|
48
48
|
end
|
|
49
49
|
end
|
data/lib/fbe/iterate.rb
CHANGED
|
@@ -84,7 +84,6 @@ class Fbe::Iterate
|
|
|
84
84
|
oct = Fbe.octo(loog: @loog, options: @options, global: @global)
|
|
85
85
|
repos = Fbe.unmask_repos(loog: @loog, options: @options, global: @global)
|
|
86
86
|
restarted = []
|
|
87
|
-
fb = Fbe.fb(fb: @fb, global: @global, options: @options)
|
|
88
87
|
loop do
|
|
89
88
|
repos.each do |repo|
|
|
90
89
|
next if restarted.include?(repo)
|
|
@@ -94,12 +93,12 @@ class Fbe::Iterate
|
|
|
94
93
|
next
|
|
95
94
|
end
|
|
96
95
|
rid = oct.repo_id_by_name(repo)
|
|
97
|
-
before = fb.query(
|
|
96
|
+
before = @fb.query(
|
|
98
97
|
"(agg (and (eq what '#{@label}') (eq where 'github') (eq repository #{rid})) (first latest))"
|
|
99
98
|
).one
|
|
100
|
-
fb.query("(and (eq what '#{@label}') (eq where 'github') (eq repository #{rid}))").delete!
|
|
99
|
+
@fb.query("(and (eq what '#{@label}') (eq where 'github') (eq repository #{rid}))").delete!
|
|
101
100
|
before = before.nil? ? @since : before.first
|
|
102
|
-
nxt = fb.query(@query).one(before:, repository: rid)
|
|
101
|
+
nxt = @fb.query(@query).one(before:, repository: rid)
|
|
103
102
|
after =
|
|
104
103
|
if nxt.nil?
|
|
105
104
|
@loog.debug("Next element after ##{before} not suggested, re-starting from ##{@since}: #{@query}")
|
|
@@ -110,7 +109,7 @@ class Fbe::Iterate
|
|
|
110
109
|
yield(rid, nxt)
|
|
111
110
|
end
|
|
112
111
|
raise "Iterator must return an Integer, while #{after.class} returned" unless after.is_a?(Integer)
|
|
113
|
-
f = fb.insert
|
|
112
|
+
f = @fb.insert
|
|
114
113
|
f.where = 'github'
|
|
115
114
|
f.repository = rid
|
|
116
115
|
f.latest =
|
data/lib/fbe/octo.rb
CHANGED
|
@@ -31,7 +31,7 @@ require 'faraday/http_cache'
|
|
|
31
31
|
require 'faraday/retry'
|
|
32
32
|
require_relative '../fbe'
|
|
33
33
|
|
|
34
|
-
def Fbe.octo(options: $options, global: $global, loog:
|
|
34
|
+
def Fbe.octo(options: $options, global: $global, loog: $loog)
|
|
35
35
|
raise 'The $global is not set' if global.nil?
|
|
36
36
|
global[:octo] ||= begin
|
|
37
37
|
if options.testing.nil?
|
data/lib/fbe.rb
CHANGED
data/test/fbe/test_conclude.rb
CHANGED
|
@@ -65,7 +65,7 @@ class TestConclude < Minitest::Test
|
|
|
65
65
|
|
|
66
66
|
def test_maybe
|
|
67
67
|
options = Judges::Options.new
|
|
68
|
-
fb = Fbe.fb(global: {}, options:)
|
|
68
|
+
fb = Fbe.fb(fb: Factbase.new, global: {}, options:, loog: Loog::NULL)
|
|
69
69
|
fb.insert.foo = 1
|
|
70
70
|
Fbe.conclude(fb:, judge: 'issue-was-opened', loog: Loog::NULL, options:, global: {}) do
|
|
71
71
|
on '(exists foo)'
|
|
@@ -96,4 +96,21 @@ class TestConclude < Minitest::Test
|
|
|
96
96
|
f = fb.query('(exists bar)').each.to_a[0]
|
|
97
97
|
assert_equal(42, f.bar)
|
|
98
98
|
end
|
|
99
|
+
|
|
100
|
+
def test_ignores_globals
|
|
101
|
+
$fb = nil
|
|
102
|
+
$loog = nil
|
|
103
|
+
$options = nil
|
|
104
|
+
$global = nil
|
|
105
|
+
fb = Factbase.new
|
|
106
|
+
fb.insert.foo = 1
|
|
107
|
+
Fbe.conclude(fb:, judge: 'judge-xxx', loog: Loog::NULL, global: {}, options: Judges::Options.new) do
|
|
108
|
+
on '(exists foo)'
|
|
109
|
+
draw do |n, prev|
|
|
110
|
+
n.sum = prev.foo + 1
|
|
111
|
+
'something funny'
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
assert_equal(2, fb.size)
|
|
115
|
+
end
|
|
99
116
|
end
|
data/test/fbe/test_fb.rb
CHANGED
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
require 'minitest/autorun'
|
|
26
26
|
require 'factbase'
|
|
27
|
+
require 'loog'
|
|
27
28
|
require 'judges/options'
|
|
28
29
|
require_relative '../../lib/fbe'
|
|
29
30
|
require_relative '../../lib/fbe/fb'
|
|
@@ -37,6 +38,7 @@ class TestFb < Minitest::Test
|
|
|
37
38
|
$fb = Factbase.new
|
|
38
39
|
$global = {}
|
|
39
40
|
$options = Judges::Options.new
|
|
41
|
+
$loog = Loog::NULL
|
|
40
42
|
Fbe.fb.insert.foo = 1
|
|
41
43
|
Fbe.fb.insert.bar = 2
|
|
42
44
|
assert_equal(1, Fbe.fb.query('(exists bar)').each.to_a.size)
|
data/test/test__helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fbe
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.15
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yegor Bugayenko
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-07-
|
|
11
|
+
date: 2024-07-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: backtrace
|