judges 0.41.0 → 0.42.0

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: 9b8d5f00535940e391cb86c440deffcb1ec82bd4cf59fac0fb63b5abc9769dce
4
- data.tar.gz: f41d0e2dee81768c06fc8168f36fea0e6fe86cd0fda0b991556ed7c4d8b772a2
3
+ metadata.gz: af0d2479c169453b9879f770a4dffbe7530f15665941200658d9255490a36db8
4
+ data.tar.gz: 99aa6fe32517235bae4c0a8841658e40cf41d589b75bf1da1f160c12a27a5452
5
5
  SHA512:
6
- metadata.gz: a02fb28cd12efcfdcb600a4721d8e54cfccd7b0b5be90ca4d942fd35f81c0765b4d90f3ac2757e3307af68ca40f88c92c24c11924b81c87c8071a31138bbb743
7
- data.tar.gz: 20d7bc1ba7ad984bccf5be876813aa300721eadd11606c00f44a29efe81fa270d29fc05b8ec45d946e20517ce4e7694b401d8768e8b64bc2103d45227df773c2
6
+ metadata.gz: 339dd1173c591e66b517c1665fef77e9c279f9286364abc964ef725275857f90d973cdedf7895da3ba25b48a07e1d71a532b0d7dd193f967490a67c9263c19a5
7
+ data.tar.gz: 24b25cd92ef031e7459aa5c12f77a4ac88359795a58c878d387840e5ce94f4a011f624db305104c95a867c7397b6fb0c17e6fede0d9ccacfbdc71637cc583cd7
data/Gemfile.lock CHANGED
@@ -80,7 +80,7 @@ GEM
80
80
  tago (> 0)
81
81
  ethon (0.16.0)
82
82
  ffi (>= 1.15.0)
83
- factbase (0.10.0)
83
+ factbase (0.10.1)
84
84
  backtrace (~> 0.4)
85
85
  decoor (~> 0.0)
86
86
  json (~> 2.7)
@@ -90,7 +90,7 @@ GEM
90
90
  others (~> 0.0)
91
91
  tago (~> 0.0)
92
92
  yaml (~> 0.3)
93
- faraday (2.13.0)
93
+ faraday (2.13.1)
94
94
  faraday-net_http (>= 2.0, < 3.5)
95
95
  json
96
96
  logger
@@ -113,7 +113,7 @@ GEM
113
113
  ostruct
114
114
  hashdiff (1.1.2)
115
115
  iri (0.10.0)
116
- json (2.10.2)
116
+ json (2.11.3)
117
117
  language_server-protocol (3.17.0.4)
118
118
  lint_roller (1.1.0)
119
119
  logger (1.7.0)
@@ -134,20 +134,20 @@ GEM
134
134
  net-http (0.6.0)
135
135
  uri
136
136
  net-ping (2.0.8)
137
- nokogiri (1.18.7)
137
+ nokogiri (1.18.8)
138
138
  mini_portile2 (~> 2.8.2)
139
139
  racc (~> 1.4)
140
- nokogiri (1.18.7-aarch64-linux-gnu)
140
+ nokogiri (1.18.8-aarch64-linux-gnu)
141
141
  racc (~> 1.4)
142
- nokogiri (1.18.7-arm-linux-gnu)
142
+ nokogiri (1.18.8-arm-linux-gnu)
143
143
  racc (~> 1.4)
144
- nokogiri (1.18.7-arm64-darwin)
144
+ nokogiri (1.18.8-arm64-darwin)
145
145
  racc (~> 1.4)
146
- nokogiri (1.18.7-x64-mingw-ucrt)
146
+ nokogiri (1.18.8-x64-mingw-ucrt)
147
147
  racc (~> 1.4)
148
- nokogiri (1.18.7-x86_64-darwin)
148
+ nokogiri (1.18.8-x86_64-darwin)
149
149
  racc (~> 1.4)
150
- nokogiri (1.18.7-x86_64-linux-gnu)
150
+ nokogiri (1.18.8-x86_64-linux-gnu)
151
151
  racc (~> 1.4)
152
152
  os (1.1.4)
153
153
  ostruct (0.6.1)
@@ -160,7 +160,7 @@ GEM
160
160
  psych (5.2.3)
161
161
  date
162
162
  stringio
163
- public_suffix (6.0.1)
163
+ public_suffix (6.0.2)
164
164
  qbash (0.4.0)
165
165
  backtrace (> 0)
166
166
  elapsed (> 0)
@@ -176,7 +176,7 @@ GEM
176
176
  regexp_parser (2.10.0)
177
177
  retries (0.0.5)
178
178
  rexml (3.4.1)
179
- rubocop (1.75.2)
179
+ rubocop (1.75.4)
180
180
  json (~> 2.3)
181
181
  language_server-protocol (~> 3.17.0.2)
182
182
  lint_roller (~> 1.1.0)
@@ -214,7 +214,7 @@ GEM
214
214
  simplecov (~> 0.19)
215
215
  simplecov-html (0.13.1)
216
216
  simplecov_json_formatter (0.1.4)
217
- stringio (3.1.6)
217
+ stringio (3.1.7)
218
218
  sys-uname (1.3.1)
219
219
  ffi (~> 1.1)
220
220
  tago (0.1.0)
data/bin/judges CHANGED
@@ -73,6 +73,8 @@ class JudgesGLI extend GLI::App
73
73
  c.flag([:lib])
74
74
  c.desc 'Shuffle them, except the ones that start with the prefix'
75
75
  c.flag([:shuffle], default_value: '')
76
+ c.desc 'Boost one judge, running it on top of all others'
77
+ c.flag([:boost], multiple: true)
76
78
  c.desc 'Maximum time in seconds to spend on the entire update cycle'
77
79
  c.flag([:lifetime], default_value: 300, type: Integer)
78
80
  c.desc 'Maximum time in seconds to spend on every judge (forcefully terminate if over time)'
@@ -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.10.0 --verbose test --judge guess ./fixtures"
19
+ When I run bin/judges with "--factbase 0.10.1 --verbose test --judge guess ./fixtures"
20
20
  Then Exit code is zero
21
- And Stdout contains "Factbase version to be used: '0.10.0'"
21
+ And Stdout contains "Factbase version to be used: '0.10.1'"
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.41.0'
12
+ s.version = '0.42.0'
13
13
  s.license = 'MIT'
14
14
  s.summary = 'Command-Line Tool for a Factbase'
15
15
  s.description =
@@ -58,7 +58,7 @@ class Judges::Update
58
58
  else
59
59
  @loog.debug("The following options provided:\n\t#{options.to_s.gsub("\n", "\n\t")}")
60
60
  end
61
- judges = Judges::Judges.new(dir, opts['lib'], @loog, start:, shuffle: opts['shuffle'])
61
+ judges = Judges::Judges.new(dir, opts['lib'], @loog, start:, shuffle: opts['shuffle'], boost: opts['boost'])
62
62
  c = 0
63
63
  churn = Factbase::Churn.new
64
64
  errors = []
data/lib/judges/judges.rb CHANGED
@@ -26,12 +26,13 @@ require_relative 'judge'
26
26
  # Copyright:: Copyright (c) 2024-2025 Yegor Bugayenko
27
27
  # License:: MIT
28
28
  class Judges::Judges
29
- def initialize(dir, lib, loog, start: Time.now, shuffle: '')
29
+ def initialize(dir, lib, loog, start: Time.now, shuffle: '', boost: [])
30
30
  @dir = dir
31
31
  @lib = lib
32
32
  @loog = loog
33
33
  @start = start
34
34
  @shuffle = shuffle || ''
35
+ @boost = boost
35
36
  end
36
37
 
37
38
  # Get one judge by name.
@@ -65,7 +66,15 @@ class Judges::Judges
65
66
  mapping.keys.zip(positions).to_h.each do |before, after|
66
67
  good[after] = all[before]
67
68
  end
68
- good.map { |a| a[0] }.each(&)
69
+ ret = []
70
+ good.map { |a| a[0] }.each do |j|
71
+ if @boost&.include?(j.name)
72
+ ret.prepend(j)
73
+ else
74
+ ret.append(j)
75
+ end
76
+ end
77
+ ret.each(&)
69
78
  end
70
79
 
71
80
  # Iterate over them all, with an index.
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.41.0' unless const_defined?(:VERSION)
11
+ VERSION = '0.42.0' unless const_defined?(:VERSION)
12
12
  end
data/package-lock.json CHANGED
@@ -106,9 +106,9 @@
106
106
  }
107
107
  },
108
108
  "node_modules/@eslint/js": {
109
- "version": "9.25.0",
110
- "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.25.0.tgz",
111
- "integrity": "sha512-iWhsUS8Wgxz9AXNfvfOPFSW4VfMXdVhp1hjkZVhXCrpgh/aLcc45rX6MPu+tIVUWDw0HfNwth7O28M1xDxNf9w==",
109
+ "version": "9.25.1",
110
+ "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.25.1.tgz",
111
+ "integrity": "sha512-dEIwmjntEx8u3Uvv+kr3PDeeArL8Hw07H9kyYxCjnM9pBjfEhk6uLXSchxxzgiwtRhhzVzqmUSDFBOi1TuZ7qg==",
112
112
  "license": "MIT",
113
113
  "engines": {
114
114
  "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -382,9 +382,9 @@
382
382
  }
383
383
  },
384
384
  "node_modules/eslint": {
385
- "version": "9.25.0",
386
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.25.0.tgz",
387
- "integrity": "sha512-MsBdObhM4cEwkzCiraDv7A6txFXEqtNXOb877TsSp2FCkBNl8JfVQrmiuDqC1IkejT6JLPzYBXx/xAiYhyzgGA==",
385
+ "version": "9.25.1",
386
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.25.1.tgz",
387
+ "integrity": "sha512-E6Mtz9oGQWDCpV12319d59n4tx9zOTXSTmc8BLVxBx+G/0RdM5MvEEJLU9c0+aleoePYYgVTOsRblx433qmhWQ==",
388
388
  "license": "MIT",
389
389
  "dependencies": {
390
390
  "@eslint-community/eslint-utils": "^4.2.0",
@@ -393,7 +393,7 @@
393
393
  "@eslint/config-helpers": "^0.2.1",
394
394
  "@eslint/core": "^0.13.0",
395
395
  "@eslint/eslintrc": "^3.3.1",
396
- "@eslint/js": "9.25.0",
396
+ "@eslint/js": "9.25.1",
397
397
  "@eslint/plugin-kit": "^0.2.8",
398
398
  "@humanfs/node": "^0.16.6",
399
399
  "@humanwhocodes/module-importer": "^1.0.1",
data/test/test_judges.rb CHANGED
@@ -45,6 +45,18 @@ class TestJudges < Minitest::Test
45
45
  end
46
46
  end
47
47
 
48
+ def test_shuffles_and_boosts
49
+ Dir.mktmpdir do |d|
50
+ names = %w[red blue green black orange pink yellow].sort
51
+ names.each do |n|
52
+ dir = File.join(d, n)
53
+ save_it(File.join(dir, "#{n}.rb"), 'puts 1')
54
+ end
55
+ list = Judges::Judges.new(d, nil, Loog::NULL, shuffle: '', boost: ['yellow']).each.to_a
56
+ assert_equal('yellow', list[0].name)
57
+ end
58
+ end
59
+
48
60
  def test_keeps_them_all
49
61
  colors = %w[blue orange yellow black white pink magenta]
50
62
  ['', 'b', 'ye'].each do |pfx|
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: judges
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.41.0
4
+ version: 0.42.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-04-19 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: backtrace
@@ -241,8 +241,8 @@ executables:
241
241
  - judges
242
242
  extensions: []
243
243
  extra_rdoc_files:
244
- - README.md
245
244
  - LICENSE.txt
245
+ - README.md
246
246
  files:
247
247
  - ".0pdd.yml"
248
248
  - ".gitattributes"
@@ -351,7 +351,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
351
351
  - !ruby/object:Gem::Version
352
352
  version: '0'
353
353
  requirements: []
354
- rubygems_version: 3.6.2
354
+ rubygems_version: 3.6.7
355
355
  specification_version: 4
356
356
  summary: Command-Line Tool for a Factbase
357
357
  test_files: []