judges 0.57.1 → 0.57.3
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.lock +12 -12
- data/Rakefile +0 -1
- data/bin/judges +2 -0
- data/features/test.feature +2 -2
- data/judges.gemspec +1 -1
- data/lib/judges/commands/update.rb +3 -5
- data/lib/judges/commands/upload.rb +8 -7
- data/lib/judges/judges.rb +4 -2
- data/lib/judges.rb +1 -1
- data/package-lock.json +37 -33
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b995a5bc4afe05488b0261012335596fdeb046103bc626466fe094a75aaefe0d
|
|
4
|
+
data.tar.gz: 76bfaa700b489cf33e0830791bb1293d1418b0c3c373d30669d41f88f5f15691
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6aba33eabad340cb860a8fabc49e8707fe2bb700b626585e27bde8c1927da3031b5c04fb6ec97eb5aaa1af43fccc81759e0dc38291b3a58a142ca631cf970ecc
|
|
7
|
+
data.tar.gz: e9e395a105fe5b7794be9c1533279bd18b53c42807dd85f2e39bbe14064ada5f80fb78040ea750fa0939c12d29d1f825934063b6fc345bccfac7be66fa7c27d2
|
data/Gemfile.lock
CHANGED
|
@@ -22,13 +22,13 @@ PATH
|
|
|
22
22
|
GEM
|
|
23
23
|
remote: https://rubygems.org/
|
|
24
24
|
specs:
|
|
25
|
-
addressable (2.8.
|
|
26
|
-
public_suffix (>= 2.0.2, <
|
|
25
|
+
addressable (2.8.8)
|
|
26
|
+
public_suffix (>= 2.0.2, < 8.0)
|
|
27
27
|
ansi (1.5.0)
|
|
28
28
|
ast (2.4.3)
|
|
29
29
|
backtrace (0.4.1)
|
|
30
30
|
base64 (0.3.0)
|
|
31
|
-
baza.rb (0.11.
|
|
31
|
+
baza.rb (0.11.1)
|
|
32
32
|
backtrace (~> 0.4)
|
|
33
33
|
elapsed (~> 0.2)
|
|
34
34
|
faraday (~> 2.13)
|
|
@@ -70,7 +70,7 @@ GEM
|
|
|
70
70
|
cucumber-html-formatter (21.15.1)
|
|
71
71
|
cucumber-messages (> 19, < 28)
|
|
72
72
|
cucumber-messages (27.2.0)
|
|
73
|
-
cucumber-tag-expressions (8.
|
|
73
|
+
cucumber-tag-expressions (8.1.0)
|
|
74
74
|
decoor (0.1.0)
|
|
75
75
|
diff-lcs (1.6.2)
|
|
76
76
|
docile (1.4.1)
|
|
@@ -81,7 +81,7 @@ GEM
|
|
|
81
81
|
ethon (0.18.0)
|
|
82
82
|
ffi (>= 1.15.0)
|
|
83
83
|
logger
|
|
84
|
-
factbase (0.
|
|
84
|
+
factbase (0.17.0)
|
|
85
85
|
backtrace (~> 0.4)
|
|
86
86
|
decoor (~> 0.1)
|
|
87
87
|
ellipsized (~> 0.3)
|
|
@@ -116,7 +116,7 @@ GEM
|
|
|
116
116
|
gli (2.22.2)
|
|
117
117
|
ostruct
|
|
118
118
|
hashdiff (1.2.1)
|
|
119
|
-
iri (0.11.
|
|
119
|
+
iri (0.11.3)
|
|
120
120
|
json (2.16.0)
|
|
121
121
|
language_server-protocol (3.17.0.5)
|
|
122
122
|
lint_roller (1.1.0)
|
|
@@ -125,7 +125,7 @@ GEM
|
|
|
125
125
|
logger (~> 1.0)
|
|
126
126
|
memoist3 (1.0.0)
|
|
127
127
|
mini_mime (1.1.5)
|
|
128
|
-
minitest (5.26.
|
|
128
|
+
minitest (5.26.2)
|
|
129
129
|
minitest-reporters (1.7.1)
|
|
130
130
|
ansi
|
|
131
131
|
builder
|
|
@@ -136,8 +136,8 @@ GEM
|
|
|
136
136
|
moments (0.3.0)
|
|
137
137
|
multi_test (1.1.0)
|
|
138
138
|
multipart-post (2.4.1)
|
|
139
|
-
net-http (0.
|
|
140
|
-
uri
|
|
139
|
+
net-http (0.8.0)
|
|
140
|
+
uri (>= 0.11.1)
|
|
141
141
|
nokogiri (1.18.10-aarch64-linux-gnu)
|
|
142
142
|
racc (~> 1.4)
|
|
143
143
|
nokogiri (1.18.10-aarch64-linux-musl)
|
|
@@ -166,8 +166,8 @@ GEM
|
|
|
166
166
|
ast (~> 2.4.1)
|
|
167
167
|
racc
|
|
168
168
|
prism (1.6.0)
|
|
169
|
-
public_suffix (
|
|
170
|
-
qbash (0.4.
|
|
169
|
+
public_suffix (7.0.0)
|
|
170
|
+
qbash (0.4.8)
|
|
171
171
|
backtrace (> 0)
|
|
172
172
|
elapsed (> 0)
|
|
173
173
|
loog (> 0)
|
|
@@ -220,7 +220,7 @@ GEM
|
|
|
220
220
|
memoist3 (~> 1.0.0)
|
|
221
221
|
tago (0.4.0)
|
|
222
222
|
timeout (0.4.4)
|
|
223
|
-
total (0.4.
|
|
223
|
+
total (0.4.2)
|
|
224
224
|
typhoeus (1.4.1)
|
|
225
225
|
ethon (>= 0.9.0)
|
|
226
226
|
unicode-display_width (3.2.0)
|
data/Rakefile
CHANGED
data/bin/judges
CHANGED
|
@@ -118,6 +118,8 @@ class JudgesGLI extend GLI::App
|
|
|
118
118
|
c.flag([:lib])
|
|
119
119
|
c.desc 'Shuffle judges, except those starting with the specified prefix'
|
|
120
120
|
c.flag([:shuffle], default_value: '')
|
|
121
|
+
c.desc 'Random seed for judge ordering (default: 0)'
|
|
122
|
+
c.flag([:seed], default_value: 0, type: Integer)
|
|
121
123
|
c.desc 'Prioritize a judge to run before all others'
|
|
122
124
|
c.flag([:boost], multiple: true)
|
|
123
125
|
c.desc 'Demote a judge to run after all others'
|
data/features/test.feature
CHANGED
|
@@ -16,9 +16,9 @@ Feature: Test
|
|
|
16
16
|
And Exit code is zero
|
|
17
17
|
|
|
18
18
|
Scenario: Factbase version can be set
|
|
19
|
-
When I run bin/judges with "--factbase 0.
|
|
19
|
+
When I run bin/judges with "--factbase 0.17.0 --verbose test --judge guess ./fixtures"
|
|
20
20
|
Then Exit code is zero
|
|
21
|
-
And Stdout contains "Factbase version to be used: '0.
|
|
21
|
+
And Stdout contains "Factbase version to be used: '0.17.0'"
|
|
22
22
|
|
|
23
23
|
Scenario: Simple test of no judges
|
|
24
24
|
Given I run bin/judges with "test --judge absent_for_sure ./fixtures"
|
data/judges.gemspec
CHANGED
|
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
|
|
|
9
9
|
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
|
|
10
10
|
s.required_ruby_version = '>=3.2'
|
|
11
11
|
s.name = 'judges'
|
|
12
|
-
s.version = '0.57.
|
|
12
|
+
s.version = '0.57.3'
|
|
13
13
|
s.license = 'MIT'
|
|
14
14
|
s.summary = 'Command-Line Tool for a Factbase'
|
|
15
15
|
s.description =
|
|
@@ -68,11 +68,11 @@ class Judges::Update
|
|
|
68
68
|
judges = Judges::Judges.new(
|
|
69
69
|
dir, opts['lib'], @loog,
|
|
70
70
|
epoch: @epoch, shuffle: opts['shuffle'], boost: opts['boost'],
|
|
71
|
-
demote: opts['demote']
|
|
71
|
+
demote: opts['demote'], seed: opts['seed']
|
|
72
72
|
)
|
|
73
73
|
begin
|
|
74
74
|
Timeout.timeout(opts['lifetime']) do
|
|
75
|
-
loop_them(
|
|
75
|
+
loop_them(judges, fb, opts, options)
|
|
76
76
|
end
|
|
77
77
|
rescue Timeout::Error, Timeout::ExitException => e
|
|
78
78
|
@loog.error("Terminated due to --lifetime=#{opts['lifetime']}")
|
|
@@ -85,7 +85,7 @@ class Judges::Update
|
|
|
85
85
|
|
|
86
86
|
private
|
|
87
87
|
|
|
88
|
-
def loop_them(
|
|
88
|
+
def loop_them(judges, fb, opts, options)
|
|
89
89
|
c = 0
|
|
90
90
|
churn = Factbase::Churn.new
|
|
91
91
|
errors = []
|
|
@@ -112,7 +112,6 @@ class Judges::Update
|
|
|
112
112
|
end
|
|
113
113
|
delta = cycle(opts, judges, fb, options, errors, statistics)
|
|
114
114
|
churn += delta
|
|
115
|
-
impex.export(fb)
|
|
116
115
|
if delta.zero?
|
|
117
116
|
@loog.info("The update cycle ##{c} has made no changes to the factbase, let's stop")
|
|
118
117
|
break
|
|
@@ -132,7 +131,6 @@ class Judges::Update
|
|
|
132
131
|
statistics&.report(@loog)
|
|
133
132
|
return unless %w[add append].include?(opts['summary'])
|
|
134
133
|
summarize(fb, churn, errors, c)
|
|
135
|
-
impex.export(fb)
|
|
136
134
|
end
|
|
137
135
|
|
|
138
136
|
# Update the summary.
|
|
@@ -43,19 +43,20 @@ class Judges::Upload
|
|
|
43
43
|
)
|
|
44
44
|
elapsed(@loog, level: Logger::INFO) do
|
|
45
45
|
id = baza.durable_find(jname, name)
|
|
46
|
-
size = File.size(path)
|
|
47
46
|
if id.nil? || id.to_s.strip.empty?
|
|
48
|
-
|
|
47
|
+
# Block form of Dir.mkdir causes error Errno::EACCESS on windows
|
|
48
|
+
# so we use non-block form
|
|
49
|
+
tmp = Dir.mktmpdir
|
|
49
50
|
begin
|
|
50
|
-
File.
|
|
51
|
-
f
|
|
52
|
-
id = baza.durable_place(jname, f
|
|
51
|
+
f = File.join(tmp, name)
|
|
52
|
+
File.write(f, 'placeholder')
|
|
53
|
+
id = baza.durable_place(jname, f)
|
|
53
54
|
@loog.info("Placed a placeholder to new durable '#{name}' in '#{jname}' (ID: #{id})")
|
|
54
55
|
ensure
|
|
55
|
-
|
|
56
|
-
f.unlink
|
|
56
|
+
FileUtils.rm_rf(tmp, secure: true)
|
|
57
57
|
end
|
|
58
58
|
end
|
|
59
|
+
size = File.size(path)
|
|
59
60
|
id = id.to_i
|
|
60
61
|
baza.durable_lock(id, opts['owner'] || 'default')
|
|
61
62
|
begin
|
data/lib/judges/judges.rb
CHANGED
|
@@ -34,7 +34,8 @@ class Judges::Judges
|
|
|
34
34
|
# @param [String] shuffle Prefix for names of judges to shuffle
|
|
35
35
|
# @param [Array<String>] boost Names of judges to boost in priority
|
|
36
36
|
# @param [Array<String>] demote Names of judges to demote in priority
|
|
37
|
-
|
|
37
|
+
# @param [Integer] seed Random seed for judge ordering (default: 0)
|
|
38
|
+
def initialize(dir, lib, loog, epoch: Time.now, shuffle: '', boost: [], demote: [], seed: 0)
|
|
38
39
|
@dir = dir
|
|
39
40
|
@lib = lib
|
|
40
41
|
@loog = loog
|
|
@@ -42,6 +43,7 @@ class Judges::Judges
|
|
|
42
43
|
@shuffle = shuffle || ''
|
|
43
44
|
@boost = boost
|
|
44
45
|
@demote = demote
|
|
46
|
+
@seed = seed || 0
|
|
45
47
|
end
|
|
46
48
|
|
|
47
49
|
# Retrieves a specific judge by its name.
|
|
@@ -86,7 +88,7 @@ class Judges::Judges
|
|
|
86
88
|
.map { |a| [a[0].name, a[1], a[1]] }
|
|
87
89
|
.reject { |a| !@shuffle.empty? && a[0].start_with?(@shuffle) }
|
|
88
90
|
.to_h { |a| [a[1], a[2]] }
|
|
89
|
-
positions = mapping.values.shuffle
|
|
91
|
+
positions = mapping.values.shuffle(random: Random.new(@seed))
|
|
90
92
|
mapping.keys.zip(positions).to_h.each do |before, after|
|
|
91
93
|
good[after] = all[before]
|
|
92
94
|
end
|
data/lib/judges.rb
CHANGED
data/package-lock.json
CHANGED
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"node_modules/@eslint-community/eslint-utils": {
|
|
13
|
-
"version": "4.
|
|
14
|
-
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.
|
|
15
|
-
"integrity": "sha512-
|
|
13
|
+
"version": "4.9.0",
|
|
14
|
+
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz",
|
|
15
|
+
"integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==",
|
|
16
16
|
"dev": true,
|
|
17
17
|
"license": "MIT",
|
|
18
18
|
"dependencies": {
|
|
@@ -52,13 +52,13 @@
|
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
"node_modules/@eslint/config-array": {
|
|
55
|
-
"version": "0.21.
|
|
56
|
-
"resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.
|
|
57
|
-
"integrity": "sha512-
|
|
55
|
+
"version": "0.21.1",
|
|
56
|
+
"resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.1.tgz",
|
|
57
|
+
"integrity": "sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==",
|
|
58
58
|
"dev": true,
|
|
59
59
|
"license": "Apache-2.0",
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@eslint/object-schema": "^2.1.
|
|
61
|
+
"@eslint/object-schema": "^2.1.7",
|
|
62
62
|
"debug": "^4.3.1",
|
|
63
63
|
"minimatch": "^3.1.2"
|
|
64
64
|
},
|
|
@@ -67,19 +67,22 @@
|
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
69
|
"node_modules/@eslint/config-helpers": {
|
|
70
|
-
"version": "0.
|
|
71
|
-
"resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.
|
|
72
|
-
"integrity": "sha512-
|
|
70
|
+
"version": "0.4.2",
|
|
71
|
+
"resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz",
|
|
72
|
+
"integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==",
|
|
73
73
|
"dev": true,
|
|
74
74
|
"license": "Apache-2.0",
|
|
75
|
+
"dependencies": {
|
|
76
|
+
"@eslint/core": "^0.17.0"
|
|
77
|
+
},
|
|
75
78
|
"engines": {
|
|
76
79
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
|
77
80
|
}
|
|
78
81
|
},
|
|
79
82
|
"node_modules/@eslint/core": {
|
|
80
|
-
"version": "0.
|
|
81
|
-
"resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.
|
|
82
|
-
"integrity": "sha512-
|
|
83
|
+
"version": "0.17.0",
|
|
84
|
+
"resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz",
|
|
85
|
+
"integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==",
|
|
83
86
|
"dev": true,
|
|
84
87
|
"license": "Apache-2.0",
|
|
85
88
|
"dependencies": {
|
|
@@ -114,9 +117,9 @@
|
|
|
114
117
|
}
|
|
115
118
|
},
|
|
116
119
|
"node_modules/@eslint/js": {
|
|
117
|
-
"version": "9.
|
|
118
|
-
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.
|
|
119
|
-
"integrity": "sha512-
|
|
120
|
+
"version": "9.39.1",
|
|
121
|
+
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.1.tgz",
|
|
122
|
+
"integrity": "sha512-S26Stp4zCy88tH94QbBv3XCuzRQiZ9yXofEILmglYTh/Ug/a9/umqvgFtYBAo3Lp0nsI/5/qH1CCrbdK3AP1Tw==",
|
|
120
123
|
"dev": true,
|
|
121
124
|
"license": "MIT",
|
|
122
125
|
"engines": {
|
|
@@ -127,9 +130,9 @@
|
|
|
127
130
|
}
|
|
128
131
|
},
|
|
129
132
|
"node_modules/@eslint/object-schema": {
|
|
130
|
-
"version": "2.1.
|
|
131
|
-
"resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.
|
|
132
|
-
"integrity": "sha512-
|
|
133
|
+
"version": "2.1.7",
|
|
134
|
+
"resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz",
|
|
135
|
+
"integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==",
|
|
133
136
|
"dev": true,
|
|
134
137
|
"license": "Apache-2.0",
|
|
135
138
|
"engines": {
|
|
@@ -137,13 +140,13 @@
|
|
|
137
140
|
}
|
|
138
141
|
},
|
|
139
142
|
"node_modules/@eslint/plugin-kit": {
|
|
140
|
-
"version": "0.
|
|
141
|
-
"resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.
|
|
142
|
-
"integrity": "sha512-
|
|
143
|
+
"version": "0.4.1",
|
|
144
|
+
"resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz",
|
|
145
|
+
"integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==",
|
|
143
146
|
"dev": true,
|
|
144
147
|
"license": "Apache-2.0",
|
|
145
148
|
"dependencies": {
|
|
146
|
-
"@eslint/core": "^0.
|
|
149
|
+
"@eslint/core": "^0.17.0",
|
|
147
150
|
"levn": "^0.4.1"
|
|
148
151
|
},
|
|
149
152
|
"engines": {
|
|
@@ -236,6 +239,7 @@
|
|
|
236
239
|
"integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
|
|
237
240
|
"dev": true,
|
|
238
241
|
"license": "MIT",
|
|
242
|
+
"peer": true,
|
|
239
243
|
"bin": {
|
|
240
244
|
"acorn": "bin/acorn"
|
|
241
245
|
},
|
|
@@ -419,25 +423,25 @@
|
|
|
419
423
|
}
|
|
420
424
|
},
|
|
421
425
|
"node_modules/eslint": {
|
|
422
|
-
"version": "9.
|
|
423
|
-
"resolved": "https://registry.npmjs.org/eslint/-/eslint-9.
|
|
424
|
-
"integrity": "sha512-
|
|
426
|
+
"version": "9.39.1",
|
|
427
|
+
"resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.1.tgz",
|
|
428
|
+
"integrity": "sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g==",
|
|
425
429
|
"dev": true,
|
|
426
430
|
"license": "MIT",
|
|
431
|
+
"peer": true,
|
|
427
432
|
"dependencies": {
|
|
428
|
-
"@eslint-community/eslint-utils": "^4.
|
|
433
|
+
"@eslint-community/eslint-utils": "^4.8.0",
|
|
429
434
|
"@eslint-community/regexpp": "^4.12.1",
|
|
430
|
-
"@eslint/config-array": "^0.21.
|
|
431
|
-
"@eslint/config-helpers": "^0.
|
|
432
|
-
"@eslint/core": "^0.
|
|
435
|
+
"@eslint/config-array": "^0.21.1",
|
|
436
|
+
"@eslint/config-helpers": "^0.4.2",
|
|
437
|
+
"@eslint/core": "^0.17.0",
|
|
433
438
|
"@eslint/eslintrc": "^3.3.1",
|
|
434
|
-
"@eslint/js": "9.
|
|
435
|
-
"@eslint/plugin-kit": "^0.
|
|
439
|
+
"@eslint/js": "9.39.1",
|
|
440
|
+
"@eslint/plugin-kit": "^0.4.1",
|
|
436
441
|
"@humanfs/node": "^0.16.6",
|
|
437
442
|
"@humanwhocodes/module-importer": "^1.0.1",
|
|
438
443
|
"@humanwhocodes/retry": "^0.4.2",
|
|
439
444
|
"@types/estree": "^1.0.6",
|
|
440
|
-
"@types/json-schema": "^7.0.15",
|
|
441
445
|
"ajv": "^6.12.4",
|
|
442
446
|
"chalk": "^4.0.0",
|
|
443
447
|
"cross-spawn": "^7.0.6",
|