judges 0.27.0 ā 0.28.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/copyrights.yml +1 -1
- data/.github/workflows/rake.yml +1 -1
- data/Gemfile +5 -5
- data/Gemfile.lock +73 -69
- data/README.md +1 -0
- data/judges.gemspec +1 -1
- data/lib/judges/commands/update.rb +12 -5
- data/lib/judges/judge.rb +5 -2
- data/lib/judges/judges.rb +4 -2
- data/lib/judges.rb +1 -1
- data/test/test_judge.rb +12 -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: 341626c0bc376f735ba16fccda467dfb3fe1fa9d8b4740e1a61704538cf989c8
|
4
|
+
data.tar.gz: d1ca8113d163559cc8df9e073c40dc54e02aae046f57793f8e983c92d880b0c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2cc1c7207eae7e3cc59be1c634cc821f55c527f51014f1164f473c1d34d861302e596cf394900e869cd0304fbb5593eb9e333ffb87db6409dbbb999e6d372890
|
7
|
+
data.tar.gz: e8d9ff08a6238b2bf580bf7c45ce47330f62d3d3174ad52e44a3fa2289aaf22bb1cfe69997fed2bcd0719c029f4597cc375cc48e09cb017b72deee67b3736689
|
data/.github/workflows/rake.yml
CHANGED
data/Gemfile
CHANGED
@@ -24,14 +24,14 @@ source 'https://rubygems.org'
|
|
24
24
|
gemspec
|
25
25
|
|
26
26
|
gem 'cucumber', '9.2.0', require: false
|
27
|
-
gem 'minitest', '5.25.
|
27
|
+
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 'random-port', '~>0.0', require: false
|
31
|
-
gem 'rspec-rails', '7.0
|
32
|
-
gem 'rubocop', '1.
|
33
|
-
gem 'rubocop-performance', '1.
|
34
|
-
gem 'rubocop-rspec', '3.
|
31
|
+
gem 'rspec-rails', '7.1.0', require: false
|
32
|
+
gem 'rubocop', '1.69.2', require: false
|
33
|
+
gem 'rubocop-performance', '1.23.0', require: false
|
34
|
+
gem 'rubocop-rspec', '3.3.0', require: false
|
35
35
|
gem 'simplecov', '0.22.0', require: false
|
36
36
|
gem 'simplecov-cobertura', '2.1.0', require: false
|
37
37
|
gem 'w3c_validators', '1.3.7', require: false
|
data/Gemfile.lock
CHANGED
@@ -20,25 +20,25 @@ PATH
|
|
20
20
|
GEM
|
21
21
|
remote: https://rubygems.org/
|
22
22
|
specs:
|
23
|
-
actionpack (
|
24
|
-
actionview (=
|
25
|
-
activesupport (=
|
23
|
+
actionpack (8.0.1)
|
24
|
+
actionview (= 8.0.1)
|
25
|
+
activesupport (= 8.0.1)
|
26
26
|
nokogiri (>= 1.8.5)
|
27
|
-
|
28
|
-
rack (>= 2.2.4, < 3.2)
|
27
|
+
rack (>= 2.2.4)
|
29
28
|
rack-session (>= 1.0.1)
|
30
29
|
rack-test (>= 0.6.3)
|
31
30
|
rails-dom-testing (~> 2.2)
|
32
31
|
rails-html-sanitizer (~> 1.6)
|
33
32
|
useragent (~> 0.16)
|
34
|
-
actionview (
|
35
|
-
activesupport (=
|
33
|
+
actionview (8.0.1)
|
34
|
+
activesupport (= 8.0.1)
|
36
35
|
builder (~> 3.1)
|
37
36
|
erubi (~> 1.11)
|
38
37
|
rails-dom-testing (~> 2.2)
|
39
38
|
rails-html-sanitizer (~> 1.6)
|
40
|
-
activesupport (
|
39
|
+
activesupport (8.0.1)
|
41
40
|
base64
|
41
|
+
benchmark (>= 0.3)
|
42
42
|
bigdecimal
|
43
43
|
concurrent-ruby (~> 1.0, >= 1.3.1)
|
44
44
|
connection_pool (>= 2.2.5)
|
@@ -48,6 +48,7 @@ GEM
|
|
48
48
|
minitest (>= 5.1)
|
49
49
|
securerandom (>= 0.3)
|
50
50
|
tzinfo (~> 2.0, >= 2.0.5)
|
51
|
+
uri (>= 0.13.1)
|
51
52
|
addressable (2.8.7)
|
52
53
|
public_suffix (>= 2.0.2, < 7.0)
|
53
54
|
ansi (1.5.0)
|
@@ -66,6 +67,7 @@ GEM
|
|
66
67
|
retries (~> 0)
|
67
68
|
tago (~> 0)
|
68
69
|
typhoeus (~> 1.3)
|
70
|
+
benchmark (0.4.0)
|
69
71
|
bigdecimal (3.1.8)
|
70
72
|
builder (3.3.0)
|
71
73
|
concurrent-ruby (1.3.4)
|
@@ -98,7 +100,8 @@ GEM
|
|
98
100
|
cucumber-html-formatter (21.7.0)
|
99
101
|
cucumber-messages (> 19, < 27)
|
100
102
|
cucumber-messages (22.0.0)
|
101
|
-
cucumber-tag-expressions (6.1.
|
103
|
+
cucumber-tag-expressions (6.1.1)
|
104
|
+
date (3.4.1)
|
102
105
|
decoor (0.0.1)
|
103
106
|
diff-lcs (1.5.1)
|
104
107
|
docile (1.4.1)
|
@@ -106,7 +109,7 @@ GEM
|
|
106
109
|
elapsed (0.0.1)
|
107
110
|
loog (> 0)
|
108
111
|
tago (> 0)
|
109
|
-
erubi (1.13.
|
112
|
+
erubi (1.13.1)
|
110
113
|
ethon (0.16.0)
|
111
114
|
ffi (>= 1.15.0)
|
112
115
|
factbase (0.4.0)
|
@@ -118,16 +121,16 @@ GEM
|
|
118
121
|
others (> 0)
|
119
122
|
tago (> 0)
|
120
123
|
yaml (~> 0.3)
|
121
|
-
faraday (2.12.
|
122
|
-
faraday-net_http (>= 2.0, < 3.
|
124
|
+
faraday (2.12.2)
|
125
|
+
faraday-net_http (>= 2.0, < 3.5)
|
123
126
|
json
|
124
127
|
logger
|
125
128
|
faraday-http-cache (2.5.1)
|
126
129
|
faraday (>= 0.8)
|
127
|
-
faraday-multipart (1.0
|
128
|
-
multipart-post (~> 2)
|
129
|
-
faraday-net_http (3.
|
130
|
-
net-http
|
130
|
+
faraday-multipart (1.1.0)
|
131
|
+
multipart-post (~> 2.0)
|
132
|
+
faraday-net_http (3.4.0)
|
133
|
+
net-http (>= 0.5.0)
|
131
134
|
faraday-retry (2.2.1)
|
132
135
|
faraday (~> 2.0)
|
133
136
|
ffi (1.17.0-aarch64-linux-gnu)
|
@@ -137,24 +140,24 @@ GEM
|
|
137
140
|
ffi (1.17.0-x86-linux-gnu)
|
138
141
|
ffi (1.17.0-x86_64-darwin)
|
139
142
|
ffi (1.17.0-x86_64-linux-gnu)
|
140
|
-
gli (2.
|
141
|
-
hashdiff (1.1.
|
143
|
+
gli (2.22.0)
|
144
|
+
hashdiff (1.1.2)
|
142
145
|
i18n (1.14.6)
|
143
146
|
concurrent-ruby (~> 1.0)
|
144
|
-
io-console (0.
|
145
|
-
irb (1.14.
|
147
|
+
io-console (0.8.0)
|
148
|
+
irb (1.14.3)
|
146
149
|
rdoc (>= 4.0.0)
|
147
150
|
reline (>= 0.4.2)
|
148
151
|
iri (0.8.0)
|
149
|
-
json (2.
|
152
|
+
json (2.9.1)
|
150
153
|
language_server-protocol (3.17.0.3)
|
151
|
-
logger (1.6.
|
152
|
-
loofah (2.
|
154
|
+
logger (1.6.4)
|
155
|
+
loofah (2.23.1)
|
153
156
|
crass (~> 1.0.2)
|
154
157
|
nokogiri (>= 1.12.0)
|
155
158
|
loog (0.6.0)
|
156
159
|
mini_mime (1.1.5)
|
157
|
-
minitest (5.25.
|
160
|
+
minitest (5.25.4)
|
158
161
|
minitest-reporters (1.7.1)
|
159
162
|
ansi
|
160
163
|
builder
|
@@ -163,28 +166,29 @@ GEM
|
|
163
166
|
moments (0.3.0)
|
164
167
|
multi_test (1.1.0)
|
165
168
|
multipart-post (2.4.1)
|
166
|
-
net-http (0.
|
169
|
+
net-http (0.6.0)
|
167
170
|
uri
|
168
|
-
nokogiri (1.
|
171
|
+
nokogiri (1.17.2-aarch64-linux)
|
169
172
|
racc (~> 1.4)
|
170
|
-
nokogiri (1.
|
173
|
+
nokogiri (1.17.2-arm-linux)
|
171
174
|
racc (~> 1.4)
|
172
|
-
nokogiri (1.
|
175
|
+
nokogiri (1.17.2-arm64-darwin)
|
173
176
|
racc (~> 1.4)
|
174
|
-
nokogiri (1.
|
177
|
+
nokogiri (1.17.2-x64-mingw-ucrt)
|
175
178
|
racc (~> 1.4)
|
176
|
-
nokogiri (1.
|
179
|
+
nokogiri (1.17.2-x86-linux)
|
177
180
|
racc (~> 1.4)
|
178
|
-
nokogiri (1.
|
181
|
+
nokogiri (1.17.2-x86_64-darwin)
|
179
182
|
racc (~> 1.4)
|
180
|
-
nokogiri (1.
|
183
|
+
nokogiri (1.17.2-x86_64-linux)
|
181
184
|
racc (~> 1.4)
|
182
185
|
others (0.0.3)
|
183
186
|
parallel (1.26.3)
|
184
|
-
parser (3.3.
|
187
|
+
parser (3.3.6.0)
|
185
188
|
ast (~> 2.4.1)
|
186
189
|
racc
|
187
|
-
psych (5.
|
190
|
+
psych (5.2.2)
|
191
|
+
date
|
188
192
|
stringio
|
189
193
|
public_suffix (6.0.1)
|
190
194
|
racc (1.8.1)
|
@@ -193,19 +197,18 @@ GEM
|
|
193
197
|
rack (>= 3.0.0)
|
194
198
|
rack-test (2.1.0)
|
195
199
|
rack (>= 1.3)
|
196
|
-
rackup (2.1
|
200
|
+
rackup (2.2.1)
|
197
201
|
rack (>= 3)
|
198
|
-
webrick (~> 1.8)
|
199
202
|
rails-dom-testing (2.2.0)
|
200
203
|
activesupport (>= 5.0.0)
|
201
204
|
minitest
|
202
205
|
nokogiri (>= 1.6)
|
203
|
-
rails-html-sanitizer (1.6.
|
206
|
+
rails-html-sanitizer (1.6.2)
|
204
207
|
loofah (~> 2.21)
|
205
|
-
nokogiri (
|
206
|
-
railties (
|
207
|
-
actionpack (=
|
208
|
-
activesupport (=
|
208
|
+
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)
|
209
|
+
railties (8.0.1)
|
210
|
+
actionpack (= 8.0.1)
|
211
|
+
activesupport (= 8.0.1)
|
209
212
|
irb (~> 1.13)
|
210
213
|
rackup (>= 1.0.0)
|
211
214
|
rake (>= 12.2)
|
@@ -214,14 +217,14 @@ GEM
|
|
214
217
|
rainbow (3.1.1)
|
215
218
|
rake (13.2.1)
|
216
219
|
random-port (0.7.1)
|
217
|
-
rdoc (6.
|
220
|
+
rdoc (6.10.0)
|
218
221
|
psych (>= 4.0.0)
|
219
|
-
regexp_parser (2.9.
|
220
|
-
reline (0.
|
222
|
+
regexp_parser (2.9.3)
|
223
|
+
reline (0.6.0)
|
221
224
|
io-console (~> 0.5)
|
222
225
|
retries (0.0.5)
|
223
|
-
rexml (3.
|
224
|
-
rspec-core (3.13.
|
226
|
+
rexml (3.4.0)
|
227
|
+
rspec-core (3.13.2)
|
225
228
|
rspec-support (~> 3.13.0)
|
226
229
|
rspec-expectations (3.13.3)
|
227
230
|
diff-lcs (>= 1.2.0, < 2.0)
|
@@ -229,7 +232,7 @@ GEM
|
|
229
232
|
rspec-mocks (3.13.2)
|
230
233
|
diff-lcs (>= 1.2.0, < 2.0)
|
231
234
|
rspec-support (~> 3.13.0)
|
232
|
-
rspec-rails (7.0
|
235
|
+
rspec-rails (7.1.0)
|
233
236
|
actionpack (>= 7.0)
|
234
237
|
activesupport (>= 7.0)
|
235
238
|
railties (>= 7.0)
|
@@ -237,26 +240,26 @@ GEM
|
|
237
240
|
rspec-expectations (~> 3.13)
|
238
241
|
rspec-mocks (~> 3.13)
|
239
242
|
rspec-support (~> 3.13)
|
240
|
-
rspec-support (3.13.
|
241
|
-
rubocop (1.
|
243
|
+
rspec-support (3.13.2)
|
244
|
+
rubocop (1.69.2)
|
242
245
|
json (~> 2.3)
|
243
246
|
language_server-protocol (>= 3.17.0)
|
244
247
|
parallel (~> 1.10)
|
245
248
|
parser (>= 3.3.0.2)
|
246
249
|
rainbow (>= 2.2.2, < 4.0)
|
247
|
-
regexp_parser (>= 2.
|
248
|
-
rubocop-ast (>= 1.
|
250
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
251
|
+
rubocop-ast (>= 1.36.2, < 2.0)
|
249
252
|
ruby-progressbar (~> 1.7)
|
250
|
-
unicode-display_width (>= 2.4.0, <
|
251
|
-
rubocop-ast (1.
|
253
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
254
|
+
rubocop-ast (1.37.0)
|
252
255
|
parser (>= 3.3.1.0)
|
253
|
-
rubocop-performance (1.
|
256
|
+
rubocop-performance (1.23.0)
|
254
257
|
rubocop (>= 1.48.1, < 2.0)
|
255
258
|
rubocop-ast (>= 1.31.1, < 2.0)
|
256
|
-
rubocop-rspec (3.
|
259
|
+
rubocop-rspec (3.3.0)
|
257
260
|
rubocop (~> 1.61)
|
258
261
|
ruby-progressbar (1.13.0)
|
259
|
-
securerandom (0.
|
262
|
+
securerandom (0.4.1)
|
260
263
|
simplecov (0.22.0)
|
261
264
|
docile (~> 1.1)
|
262
265
|
simplecov-html (~> 0.11)
|
@@ -266,8 +269,8 @@ GEM
|
|
266
269
|
simplecov (~> 0.19)
|
267
270
|
simplecov-html (0.13.1)
|
268
271
|
simplecov_json_formatter (0.1.4)
|
269
|
-
stringio (3.1.
|
270
|
-
sys-uname (1.3.
|
272
|
+
stringio (3.1.2)
|
273
|
+
sys-uname (1.3.1)
|
271
274
|
ffi (~> 1.1)
|
272
275
|
tago (0.0.2)
|
273
276
|
thor (1.3.2)
|
@@ -275,9 +278,11 @@ GEM
|
|
275
278
|
ethon (>= 0.9.0)
|
276
279
|
tzinfo (2.0.6)
|
277
280
|
concurrent-ruby (~> 1.0)
|
278
|
-
unicode-display_width (
|
279
|
-
|
280
|
-
|
281
|
+
unicode-display_width (3.1.2)
|
282
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
283
|
+
unicode-emoji (4.0.4)
|
284
|
+
uri (1.0.2)
|
285
|
+
useragent (0.16.11)
|
281
286
|
w3c_validators (1.3.7)
|
282
287
|
json (>= 1.8)
|
283
288
|
nokogiri (~> 1.6)
|
@@ -286,10 +291,9 @@ GEM
|
|
286
291
|
addressable (>= 2.8.0)
|
287
292
|
crack (>= 0.3.2)
|
288
293
|
hashdiff (>= 0.4.0, < 2.0.0)
|
289
|
-
|
290
|
-
yaml (0.3.0)
|
294
|
+
yaml (0.4.0)
|
291
295
|
yard (0.9.37)
|
292
|
-
zeitwerk (2.7.
|
296
|
+
zeitwerk (2.7.1)
|
293
297
|
|
294
298
|
PLATFORMS
|
295
299
|
aarch64-linux
|
@@ -303,14 +307,14 @@ PLATFORMS
|
|
303
307
|
DEPENDENCIES
|
304
308
|
cucumber (= 9.2.0)
|
305
309
|
judges!
|
306
|
-
minitest (= 5.25.
|
310
|
+
minitest (= 5.25.4)
|
307
311
|
minitest-reporters (= 1.7.1)
|
308
312
|
rake (= 13.2.1)
|
309
313
|
random-port (~> 0.0)
|
310
|
-
rspec-rails (= 7.0
|
311
|
-
rubocop (= 1.
|
312
|
-
rubocop-performance (= 1.
|
313
|
-
rubocop-rspec (= 3.
|
314
|
+
rspec-rails (= 7.1.0)
|
315
|
+
rubocop (= 1.69.2)
|
316
|
+
rubocop-performance (= 1.23.0)
|
317
|
+
rubocop-rspec (= 3.3.0)
|
314
318
|
simplecov (= 0.22.0)
|
315
319
|
simplecov-cobertura (= 2.1.0)
|
316
320
|
w3c_validators (= 1.3.7)
|
data/README.md
CHANGED
@@ -30,6 +30,7 @@ global variables available to it:
|
|
30
30
|
a judge is finished;
|
31
31
|
* `$global` ā a hash map that is never cleaned up;
|
32
32
|
* `$judge` ā the basename of the directory, where the `.rb` script is located.
|
33
|
+
* `$start` ā the time moment when plugin was started
|
33
34
|
|
34
35
|
Every `.yml` file must be formatted as such:
|
35
36
|
|
data/judges.gemspec
CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
|
|
26
26
|
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
|
27
27
|
s.required_ruby_version = '>=3.2'
|
28
28
|
s.name = 'judges'
|
29
|
-
s.version = '0.
|
29
|
+
s.version = '0.28.1'
|
30
30
|
s.license = 'MIT'
|
31
31
|
s.summary = 'Command-Line Tool for a Factbase'
|
32
32
|
s.description =
|
@@ -21,8 +21,9 @@
|
|
21
21
|
# SOFTWARE.
|
22
22
|
|
23
23
|
require 'backtrace'
|
24
|
-
require 'factbase/looged'
|
25
24
|
require 'elapsed'
|
25
|
+
require 'factbase/looged'
|
26
|
+
require 'tago'
|
26
27
|
require_relative '../../judges'
|
27
28
|
require_relative '../../judges/to_rel'
|
28
29
|
require_relative '../../judges/judges'
|
@@ -60,7 +61,7 @@ class Judges::Update
|
|
60
61
|
else
|
61
62
|
@loog.debug("The following options provided:\n\t#{options.to_s.gsub("\n", "\n\t")}")
|
62
63
|
end
|
63
|
-
judges = Judges::Judges.new(dir, opts['lib'], @loog)
|
64
|
+
judges = Judges::Judges.new(dir, opts['lib'], @loog, start:)
|
64
65
|
c = 0
|
65
66
|
churn = Judges::Churn.new(0, 0)
|
66
67
|
elapsed(@loog, level: Logger::INFO) do
|
@@ -69,7 +70,7 @@ class Judges::Update
|
|
69
70
|
if c > 1
|
70
71
|
@loog.info("\nStarting cycle ##{c}#{opts['max-cycles'] ? " (out of #{opts['max-cycles']})" : ''}...")
|
71
72
|
end
|
72
|
-
delta = cycle(opts, judges, fb, options)
|
73
|
+
delta = cycle(opts, judges, fb, options, start)
|
73
74
|
churn += delta
|
74
75
|
impex.export(fb)
|
75
76
|
if delta.zero?
|
@@ -101,14 +102,20 @@ class Judges::Update
|
|
101
102
|
private
|
102
103
|
|
103
104
|
# Run all judges in a full cycle, one by one.
|
105
|
+
#
|
106
|
+
# @param [Hash] opts The command line options
|
107
|
+
# @param [Judges::Judges] judges The judges
|
108
|
+
# @param [Factbase] fb The factbase
|
109
|
+
# @param [Judges::Options] options The options
|
110
|
+
# @param [Float] start When we started
|
104
111
|
# @return [Churn] How many modifications have been made
|
105
|
-
def cycle(opts, judges, fb, options)
|
112
|
+
def cycle(opts, judges, fb, options, start)
|
106
113
|
churn = Judges::Churn.new(0, 0)
|
107
114
|
global = {}
|
108
115
|
elapsed(@loog, level: Logger::INFO) do
|
109
116
|
done =
|
110
117
|
judges.each_with_index do |p, i|
|
111
|
-
@loog.info("\nš Running #{p.name} (##{i}) at #{p.dir.to_rel}...")
|
118
|
+
@loog.info("\nš Running #{p.name} (##{i}) at #{p.dir.to_rel} (#{start.ago} already)...")
|
112
119
|
elapsed(@loog, level: Logger::INFO) do
|
113
120
|
c = one_judge(fb, p, global, options)
|
114
121
|
churn += c
|
data/lib/judges/judge.rb
CHANGED
@@ -21,6 +21,7 @@
|
|
21
21
|
# SOFTWARE.
|
22
22
|
|
23
23
|
require 'elapsed'
|
24
|
+
require 'tago'
|
24
25
|
require_relative '../judges'
|
25
26
|
require_relative '../judges/to_rel'
|
26
27
|
|
@@ -35,10 +36,11 @@ class Judges::Judge
|
|
35
36
|
# @param [String] dir The directory with the judge
|
36
37
|
# @param [String] lib The directory with the lib/
|
37
38
|
# @param [Loog] loog The logging facility
|
38
|
-
def initialize(dir, lib, loog)
|
39
|
+
def initialize(dir, lib, loog, start: Time.now)
|
39
40
|
@dir = dir
|
40
41
|
@lib = lib
|
41
42
|
@loog = loog
|
43
|
+
@start = start
|
42
44
|
end
|
43
45
|
|
44
46
|
# Run it with the given Factbase and environment variables.
|
@@ -54,6 +56,7 @@ class Judges::Judge
|
|
54
56
|
$loog = @loog
|
55
57
|
$global = global
|
56
58
|
$local = local
|
59
|
+
$start = @start
|
57
60
|
options.to_h.each { |k, v| ENV.store(k.to_s, v.to_s) }
|
58
61
|
unless @lib.nil?
|
59
62
|
raise "Lib dir #{@lib.to_rel} is absent" unless File.exist?(@lib)
|
@@ -64,7 +67,7 @@ class Judges::Judge
|
|
64
67
|
end
|
65
68
|
s = File.join(@dir, script)
|
66
69
|
raise "Can't load '#{s}'" unless File.exist?(s)
|
67
|
-
elapsed(@loog, intro: "#{$judge} finished", level: Logger::INFO) do
|
70
|
+
elapsed(@loog, intro: "#{$judge} finished (#{@start.ago} already)", level: Logger::INFO) do
|
68
71
|
load(s, true)
|
69
72
|
ensure
|
70
73
|
$fb = $judge = $options = $loog = nil
|
data/lib/judges/judges.rb
CHANGED
@@ -20,6 +20,7 @@
|
|
20
20
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
21
|
# SOFTWARE.
|
22
22
|
|
23
|
+
require 'time'
|
23
24
|
require_relative '../judges'
|
24
25
|
require_relative 'judge'
|
25
26
|
|
@@ -42,10 +43,11 @@ require_relative 'judge'
|
|
42
43
|
# Copyright:: Copyright (c) 2024 Yegor Bugayenko
|
43
44
|
# License:: MIT
|
44
45
|
class Judges::Judges
|
45
|
-
def initialize(dir, lib, loog)
|
46
|
+
def initialize(dir, lib, loog, start: Time.now)
|
46
47
|
@dir = dir
|
47
48
|
@lib = lib
|
48
49
|
@loog = loog
|
50
|
+
@start = start
|
49
51
|
end
|
50
52
|
|
51
53
|
# Get one judge by name.
|
@@ -53,7 +55,7 @@ class Judges::Judges
|
|
53
55
|
def get(name)
|
54
56
|
d = File.absolute_path(File.join(@dir, name))
|
55
57
|
raise "Judge #{name} doesn't exist in #{@dir}" unless File.exist?(d)
|
56
|
-
Judges::Judge.new(d, @lib, @loog)
|
58
|
+
Judges::Judge.new(d, @lib, @loog, start: @start)
|
57
59
|
end
|
58
60
|
|
59
61
|
# Iterate over them all.
|
data/lib/judges.rb
CHANGED
data/test/test_judge.rb
CHANGED
@@ -85,6 +85,18 @@ class TestJudge < Minitest::Test
|
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
88
|
+
def test_sets_start_value_correctly
|
89
|
+
Dir.mktmpdir do |d|
|
90
|
+
j = 'this_is_it'
|
91
|
+
dir = File.join(d, j)
|
92
|
+
save_it(File.join(dir, "#{j}.rb"), '$loog.info("start=#{$start}")')
|
93
|
+
log = Loog::Buffer.new
|
94
|
+
time = Time.now
|
95
|
+
Judges::Judge.new(dir, nil, log, start: time).run(Factbase.new, {}, {}, {})
|
96
|
+
assert(log.to_s.include?("start=#{time}"))
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
88
100
|
def test_with_broken_ruby_syntax
|
89
101
|
assert_raises do
|
90
102
|
Dir.mktmpdir do |d|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: judges
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.28.1
|
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-
|
11
|
+
date: 2024-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: backtrace
|