judges 0.57.1 → 0.57.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 99e0f160f5dfa27ca34a0e3869bbc26d7f7ee4c7bb25beca1197e4e2dd462e68
4
- data.tar.gz: 923b096bf564c2c2e03ae4ad1697df5c8b7331f211246fef0f2b1fffb28b8333
3
+ metadata.gz: 88354a97358028176ab246461d697b8a15665f9cc7f40a8027ea06e319ad2cac
4
+ data.tar.gz: a14e5f0de607ae66d42c564d0acce72bad9f631173e62012ffbd1e8930dabf42
5
5
  SHA512:
6
- metadata.gz: 9bae673902b779709eb86dbc939fc234baabc546a08b953a2e5f9c7006467ad5279c0bc59268c7b240d60da93f6e5aca28adbe3774748a8b08eaa2d499b8c7e7
7
- data.tar.gz: 38fbbd8411637b54b6515e96599e91924a82ea63599315a9d166a26d6aeff4aa65c0be86eb09fb39b8ce4de2494c6bf09d7af9baa6abd97f4ba32c7da452468f
6
+ metadata.gz: 2f0e66bc1557e30a9e1197971c5218b8b31afa371bb5db7e180f758458e6c8efa9c6734ddf260101238a1b56b5b5acb05cf5946e5ad3205b4d201063f9a8c820
7
+ data.tar.gz: '08f46b98339901d7f045e07fd9569dedc09b33ccf20060a00421f5e52b0010cac384a92e2d24375c22a0ba8626d61a6501aba46fe6758c7ec5c98dfae8655838'
data/Gemfile.lock CHANGED
@@ -116,7 +116,7 @@ GEM
116
116
  gli (2.22.2)
117
117
  ostruct
118
118
  hashdiff (1.2.1)
119
- iri (0.11.2)
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.1)
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.7.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)
@@ -167,7 +167,7 @@ GEM
167
167
  racc
168
168
  prism (1.6.0)
169
169
  public_suffix (6.0.2)
170
- qbash (0.4.7)
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.1)
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
@@ -7,7 +7,6 @@ require 'os'
7
7
  require 'qbash'
8
8
  require 'rubygems'
9
9
  require 'rake'
10
- require 'rdoc'
11
10
  require 'rake/clean'
12
11
  require 'shellwords'
13
12
 
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/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.1'
12
+ s.version = '0.57.2'
13
13
  s.license = 'MIT'
14
14
  s.summary = 'Command-Line Tool for a Factbase'
15
15
  s.description =
@@ -68,7 +68,7 @@ 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
@@ -43,19 +43,15 @@ 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
- f = Tempfile.new('placeholder')
49
- begin
50
- File.write(f.path, 'placeholder')
51
- f.close
52
- id = baza.durable_place(jname, f.path)
47
+ Dir.mktmpdir do |tmp|
48
+ f = File.join(tmp, name)
49
+ File.write(f, 'placeholder')
50
+ id = baza.durable_place(jname, f)
53
51
  @loog.info("Placed a placeholder to new durable '#{name}' in '#{jname}' (ID: #{id})")
54
- ensure
55
- f.close unless f.closed?
56
- f.unlink
57
52
  end
58
53
  end
54
+ size = File.size(path)
59
55
  id = id.to_i
60
56
  baza.durable_lock(id, opts['owner'] || 'default')
61
57
  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
- def initialize(dir, lib, loog, epoch: Time.now, shuffle: '', boost: [], demote: [])
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
@@ -8,5 +8,5 @@
8
8
  # Copyright:: Copyright (c) 2024-2025 Yegor Bugayenko
9
9
  # License:: MIT
10
10
  module Judges
11
- VERSION = '0.57.1' unless const_defined?(:VERSION)
11
+ VERSION = '0.57.2' unless const_defined?(:VERSION)
12
12
  end
data/package-lock.json CHANGED
@@ -10,9 +10,9 @@
10
10
  }
11
11
  },
12
12
  "node_modules/@eslint-community/eslint-utils": {
13
- "version": "4.7.0",
14
- "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz",
15
- "integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==",
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.0",
56
- "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.0.tgz",
57
- "integrity": "sha512-ENIdc4iLu0d93HeYirvKmrzshzofPw6VkZRKQGe9Nv46ZnWUzcF1xV01dcvEg/1wXUR61OmmlSfyeyO7EvjLxQ==",
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.6",
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.3.0",
71
- "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.3.0.tgz",
72
- "integrity": "sha512-ViuymvFmcJi04qdZeDc2whTHryouGcDlaxPqarTD0ZE10ISpxGUVZGZDx4w01upyIynL3iu6IXH2bS1NhclQMw==",
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.14.0",
81
- "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.14.0.tgz",
82
- "integrity": "sha512-qIbV0/JZr7iSDjqAc60IqbLdsj9GDt16xQtWD+B78d/HAlvysGdZZ6rpJHGAc2T0FQx1X6thsSPdnoiGKdNtdg==",
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.30.1",
118
- "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.30.1.tgz",
119
- "integrity": "sha512-zXhuECFlyep42KZUhWjfvsmXGX39W8K8LFb8AWXM9gSV9dQB+MrJGLKvW6Zw0Ggnbpw0VHTtrhFXYe3Gym18jg==",
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.6",
131
- "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz",
132
- "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==",
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.3.1",
141
- "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.1.tgz",
142
- "integrity": "sha512-0J+zgWxHN+xXONWIyPWKFMgVuJoZuGiIFu8yxk7RJjxkzpGmyja5wRFqZIVtjDVOQpV+Rw0iOAjYPE2eQyjr0w==",
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.14.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.30.1",
423
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.30.1.tgz",
424
- "integrity": "sha512-zmxXPNMOXmwm9E0yQLi5uqXHs7uq2UIiqEKo3Gq+3fwo1XrJ+hijAZImyF7hclW3E6oHz43Yk3RP8at6OTKflQ==",
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.2.0",
433
+ "@eslint-community/eslint-utils": "^4.8.0",
429
434
  "@eslint-community/regexpp": "^4.12.1",
430
- "@eslint/config-array": "^0.21.0",
431
- "@eslint/config-helpers": "^0.3.0",
432
- "@eslint/core": "^0.14.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.30.1",
435
- "@eslint/plugin-kit": "^0.3.1",
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",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: judges
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.57.1
4
+ version: 0.57.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko