judges 0.57.0 → 0.57.1
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/bin/judges +1 -0
- data/features/print.feature +8 -0
- data/features/step_definitions/steps.rb +5 -0
- data/features/update.feature +2 -2
- data/judges.gemspec +1 -1
- data/lib/judges/judges.rb +4 -4
- data/lib/judges.rb +1 -1
- 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: 99e0f160f5dfa27ca34a0e3869bbc26d7f7ee4c7bb25beca1197e4e2dd462e68
|
|
4
|
+
data.tar.gz: 923b096bf564c2c2e03ae4ad1697df5c8b7331f211246fef0f2b1fffb28b8333
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9bae673902b779709eb86dbc939fc234baabc546a08b953a2e5f9c7006467ad5279c0bc59268c7b240d60da93f6e5aca28adbe3774748a8b08eaa2d499b8c7e7
|
|
7
|
+
data.tar.gz: 38fbbd8411637b54b6515e96599e91924a82ea63599315a9d166a26d6aeff4aa65c0be86eb09fb39b8ce4de2494c6bf09d7af9baa6abd97f4ba32c7da452468f
|
data/bin/judges
CHANGED
|
@@ -27,6 +27,7 @@ class JudgesGLI extend GLI::App
|
|
|
27
27
|
require_relative "../lib/judges/commands/#{ruby}"
|
|
28
28
|
start = Time.now
|
|
29
29
|
@@loog.debug("Running '#{ruby}' command...")
|
|
30
|
+
options = global.merge(options)
|
|
30
31
|
begin
|
|
31
32
|
Object.const_get("Judges::#{ruby.capitalize}").new(@@loog).run(options, args)
|
|
32
33
|
@@loog.debug("Command '#{ruby}' completed in #{start.ago}")
|
data/features/print.feature
CHANGED
|
@@ -18,6 +18,14 @@ Feature: Print
|
|
|
18
18
|
Then Stdout contains "printed"
|
|
19
19
|
And Exit code is zero
|
|
20
20
|
|
|
21
|
+
Scenario: Simple print of a small factbase, to HTML, in offline mode
|
|
22
|
+
Given I make a temp directory
|
|
23
|
+
Then I run bin/judges with "--verbose eval simple.fb '$fb.insert.foo = 42'"
|
|
24
|
+
Then I run bin/judges with "--offline print --format=html simple.fb simple.html"
|
|
25
|
+
Then Stdout contains "printed"
|
|
26
|
+
Then simple.html contains "sha256-offline"
|
|
27
|
+
And Exit code is zero
|
|
28
|
+
|
|
21
29
|
Scenario: Simple print of a small factbase, to JSON
|
|
22
30
|
Given I make a temp directory
|
|
23
31
|
Then I run bin/judges with "--verbose eval simple.fb '$fb.insert.foo = 42'"
|
|
@@ -56,6 +56,11 @@ When(/^I run bash with:$/) do |text|
|
|
|
56
56
|
@exitstatus = $CHILD_STATUS.exitstatus
|
|
57
57
|
end
|
|
58
58
|
|
|
59
|
+
Then(/^([a-z].+) contains "([^"]*)"$/) do |file, txt|
|
|
60
|
+
data = File.read(file)
|
|
61
|
+
raise "The file #{file} doesn't contain '#{txt}':\n#{data}" unless data.include?(txt)
|
|
62
|
+
end
|
|
63
|
+
|
|
59
64
|
Then(/^Stdout contains "([^"]*)"$/) do |txt|
|
|
60
65
|
raise "STDOUT doesn't contain '#{txt}':\n#{@stdout}" unless @stdout.include?(txt)
|
|
61
66
|
end
|
data/features/update.feature
CHANGED
|
@@ -62,7 +62,7 @@ Feature: Update
|
|
|
62
62
|
n = $fb.insert
|
|
63
63
|
n.type = 'second'
|
|
64
64
|
"""
|
|
65
|
-
Then I run bin/judges with "--verbose update --quiet --lifetime 4 --timeout 3 --max-cycles 5 . simple.fb"
|
|
65
|
+
Then I run bin/judges with "--verbose update --quiet --lifetime 4 --timeout 3 --max-cycles 5 --shuffle 'first' . simple.fb"
|
|
66
66
|
Then Stdout contains "Update completed in 2 cycle(s), did 3i/0d/3a"
|
|
67
67
|
And Exit code is zero
|
|
68
68
|
|
|
@@ -248,7 +248,7 @@ Feature: Update
|
|
|
248
248
|
"""
|
|
249
249
|
$fb.insert.name = 'beta'
|
|
250
250
|
"""
|
|
251
|
-
Then I run bin/judges with "update --statistics --quiet --max-cycles 2 --lifetime 4 --timeout 3 . stats.fb"
|
|
251
|
+
Then I run bin/judges with "update --statistics --quiet --max-cycles 2 --lifetime 4 --timeout 3 --shuffle 'alpha' . stats.fb"
|
|
252
252
|
Then Stdout contains "Judge execution summary:"
|
|
253
253
|
Then Stdout contains "alpha"
|
|
254
254
|
Then Stdout contains "beta"
|
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.1'
|
|
13
13
|
s.license = 'MIT'
|
|
14
14
|
s.summary = 'Command-Line Tool for a Factbase'
|
|
15
15
|
s.description =
|
data/lib/judges/judges.rb
CHANGED
|
@@ -62,10 +62,10 @@ class Judges::Judges
|
|
|
62
62
|
# This method discovers all judge directories, validates them (ensuring they contain
|
|
63
63
|
# a corresponding .rb file), and yields them in a specific order. The order is
|
|
64
64
|
# determined by:
|
|
65
|
-
# 1.
|
|
66
|
-
#
|
|
65
|
+
# 1. Randomly reorder judges (if shuffle prefix is empty, shuffle all judges;
|
|
66
|
+
# if prefix is not empty, shuffle only those NOT starting with the prefix)
|
|
67
|
+
# 2. Judges whose names match the boost list are placed first
|
|
67
68
|
# 3. Judges whose names match the demote list are placed last
|
|
68
|
-
# 4. All other judges maintain their alphabetical order
|
|
69
69
|
#
|
|
70
70
|
# @yield [Judges::Judge] Yields each valid judge object
|
|
71
71
|
# @return [Enumerator] Returns an enumerator if no block is given
|
|
@@ -84,7 +84,7 @@ class Judges::Judges
|
|
|
84
84
|
good = all.dup
|
|
85
85
|
mapping = all
|
|
86
86
|
.map { |a| [a[0].name, a[1], a[1]] }
|
|
87
|
-
.reject { |a| a[0].start_with?(@shuffle) }
|
|
87
|
+
.reject { |a| !@shuffle.empty? && a[0].start_with?(@shuffle) }
|
|
88
88
|
.to_h { |a| [a[1], a[2]] }
|
|
89
89
|
positions = mapping.values.shuffle
|
|
90
90
|
mapping.keys.zip(positions).to_h.each do |before, after|
|
data/lib/judges.rb
CHANGED