judges 0.53.1 → 0.53.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: 60345e60cca92c8891851f29e255831796747e5451a14934538f52c764c3322e
4
- data.tar.gz: 27ecf7b216dc3a1f66267168b8bd77c76531067246716765ee3158f6cd1ae00e
3
+ metadata.gz: aa86305c49cd5701b671c3e8a6705e07971e7000ea5c327ad6db9e0aa688f4c8
4
+ data.tar.gz: 9f9445c8c832b285b75d6b816127bb504e6bb3e548616c6cc999dda56dbe15c4
5
5
  SHA512:
6
- metadata.gz: 87e466051c31be7106a95670c4508789fac2a790627135e26afeef970306c3e7f9762e20c13641277048929e0e8f430343427da49dac387d5a2f09e9f0cde625
7
- data.tar.gz: 9aa334a66a192dc65a1e6f7533d6a539c91c72dcbcb7506a0d85ccd01065d7446d58abdd0174dc15c428079078914bf67f08b5aa43a0222155653f82c643799f
6
+ metadata.gz: b07a315a2bbd216ce359b6f81b1a04993929dc58feaa315413254ef0d72335a6fca76ef1716e597b39e81c8d5cc9f4a03f2d9de365b0e614f9420425afa9c81b
7
+ data.tar.gz: 9732e62b8e45b852b6eaa673a5924d61f7d6f67e0fae1f4bd76f0ecc996337236c3b52e2212a1b7efe2a31a701aae2f874f1be1bf15f814131dea9f90f4c3761
@@ -14,7 +14,7 @@ jobs:
14
14
  rake:
15
15
  strategy:
16
16
  matrix:
17
- os: [ubuntu-24.04, macos-15]
17
+ os: [ubuntu-24.04, macos-15, windows-2022]
18
18
  ruby: [3.3]
19
19
  runs-on: ${{ matrix.os }}
20
20
  steps:
@@ -16,4 +16,4 @@ jobs:
16
16
  runs-on: ubuntu-24.04
17
17
  steps:
18
18
  - uses: actions/checkout@v5
19
- - uses: crate-ci/typos@v1.35.4
19
+ - uses: crate-ci/typos@v1.35.5
data/Gemfile CHANGED
@@ -12,7 +12,6 @@ gem 'diff-lcs', '1.6.2', require: false # GPL
12
12
  gem 'minitest', '~>5.25', require: false
13
13
  gem 'minitest-reporters', '~>1.7', require: false
14
14
  gem 'minitest-retry', '~>0.2', require: false
15
- gem 'net-ping', '~>2.0', require: false
16
15
  gem 'online', '~>0.0', require: false
17
16
  gem 'os', '~>1.1', require: false
18
17
  gem 'qbash', '~>0.4', require: false
data/Gemfile.lock CHANGED
@@ -46,7 +46,7 @@ GEM
46
46
  crack (1.0.0)
47
47
  bigdecimal
48
48
  rexml
49
- cucumber (10.0.0)
49
+ cucumber (10.1.0)
50
50
  base64 (~> 0.2)
51
51
  builder (~> 3.2)
52
52
  cucumber-ci-environment (> 9, < 11)
@@ -59,7 +59,7 @@ GEM
59
59
  multi_test (~> 1.1)
60
60
  sys-uname (~> 1.3)
61
61
  cucumber-ci-environment (10.0.1)
62
- cucumber-core (15.2.0)
62
+ cucumber-core (15.2.1)
63
63
  cucumber-gherkin (> 27, < 33)
64
64
  cucumber-messages (> 26, < 30)
65
65
  cucumber-tag-expressions (> 5, < 7)
@@ -78,18 +78,18 @@ GEM
78
78
  loog (~> 0.6)
79
79
  tago (~> 0.1)
80
80
  ellipsized (0.3.0)
81
- ethon (0.16.0)
81
+ ethon (0.17.0)
82
82
  ffi (>= 1.15.0)
83
- factbase (0.15.0)
83
+ factbase (0.15.6)
84
84
  backtrace (~> 0.4)
85
- decoor (~> 0.0)
85
+ decoor (~> 0.1)
86
86
  ellipsized (~> 0.3)
87
87
  json (~> 2.7)
88
88
  logger (~> 1.0)
89
89
  loog (~> 0.6)
90
90
  nokogiri (~> 1.10)
91
- others (~> 0.0)
92
- tago (~> 0.0)
91
+ others (~> 0.1)
92
+ tago (~> 0.1)
93
93
  yaml (~> 0.3)
94
94
  faraday (2.13.4)
95
95
  faraday-net_http (>= 2.0, < 3.5)
@@ -136,7 +136,6 @@ GEM
136
136
  multipart-post (2.4.1)
137
137
  net-http (0.6.0)
138
138
  uri
139
- net-ping (2.0.8)
140
139
  nokogiri (1.18.9-aarch64-linux-gnu)
141
140
  racc (~> 1.4)
142
141
  nokogiri (1.18.9-aarch64-linux-musl)
@@ -179,7 +178,7 @@ GEM
179
178
  regexp_parser (2.11.2)
180
179
  retries (0.0.5)
181
180
  rexml (3.4.1)
182
- rubocop (1.79.2)
181
+ rubocop (1.80.0)
183
182
  json (~> 2.3)
184
183
  language_server-protocol (~> 3.17.0.2)
185
184
  lint_roller (~> 1.1.0)
@@ -255,7 +254,6 @@ DEPENDENCIES
255
254
  minitest (~> 5.25)
256
255
  minitest-reporters (~> 1.7)
257
256
  minitest-retry (~> 0.2)
258
- net-ping (~> 2.0)
259
257
  online (~> 0.0)
260
258
  os (~> 1.1)
261
259
  qbash (~> 0.4)
@@ -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.15.0 --verbose test --judge guess ./fixtures"
19
+ When I run bin/judges with "--factbase 0.15.6 --verbose test --judge guess ./fixtures"
20
20
  Then Exit code is zero
21
- And Stdout contains "Factbase version to be used: '0.15.0'"
21
+ And Stdout contains "Factbase version to be used: '0.15.6'"
22
22
 
23
23
  Scenario: Simple test of no judges
24
24
  Given I run bin/judges with "test --judge absent_for_sure ./fixtures"
@@ -55,15 +55,15 @@ Feature: Update
55
55
  """
56
56
  n = $fb.insert
57
57
  n.type = 'first'
58
- sleep 0.9
58
+ sleep 1.9
59
59
  """
60
60
  Then I have a "second/second.rb" file with content:
61
61
  """
62
62
  n = $fb.insert
63
63
  n.type = 'second'
64
64
  """
65
- Then I run bin/judges with "--verbose update --lifetime 1 --max-cycles 5 . simple.fb"
66
- Then Stdout contains "Update completed in 1 cycle(s), did 2i/0d/2a"
65
+ Then I run bin/judges with "--verbose update --quiet --lifetime 2 --timeout 1 --max-cycles 5 . simple.fb"
66
+ Then Stdout contains "Update completed in 2 cycle(s), did 1i/0d/1a"
67
67
  And Exit code is zero
68
68
 
69
69
  Scenario: Use options from a file
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.53.1'
12
+ s.version = '0.53.2'
13
13
  s.license = 'MIT'
14
14
  s.summary = 'Command-Line Tool for a Factbase'
15
15
  s.description =
@@ -45,7 +45,10 @@ class Judges::Update
45
45
  impex = Judges::Impex.new(@loog, args[1])
46
46
  fb = impex.import(strict: false)
47
47
  fb = Factbase::Logged.new(fb, @loog) if opts['log']
48
- options = Judges::Options.new(timeout: opts['timeout'], lifetime: opts['lifetime'])
48
+ options = Judges::Options.new(timeout: opts['timeout']&.to_i, lifetime: opts['lifetime']&.to_i)
49
+ if options.lifetime && options.timeout && options.lifetime < options.timeout * 1.1
50
+ raise "The --timeout=#{options.timeout} must be at least 10 percent smaller than --lifetime=#{options.lifetime}"
51
+ end
49
52
  options += Judges::Options.new(opts['option'])
50
53
  if opts['options-file']
51
54
  options += Judges::Options.new(
@@ -127,6 +127,7 @@ class Judges::Options
127
127
  end
128
128
  pp
129
129
  .reject { |k, _| k.nil? }
130
+ .compact
130
131
  .reject { |k, _| k.is_a?(String) && k.empty? }
131
132
  .to_h
132
133
  .transform_values { |v| v.nil? ? 'true' : v }
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.53.1' unless const_defined?(:VERSION)
11
+ VERSION = '0.53.2' unless const_defined?(:VERSION)
12
12
  end
@@ -51,6 +51,18 @@ class TestUpdate < Minitest::Test
51
51
  end
52
52
  end
53
53
 
54
+ def test_accepts_changes_from_slow_judge
55
+ Dir.mktmpdir do |d|
56
+ save_it(File.join(d, 'foo/foo.rb'), '$fb.insert.foo = 1; sleep 10')
57
+ file = File.join(d, 'base.fb')
58
+ Judges::Update.new(Loog::NULL).run({ 'timeout' => 0.1, 'quiet' => true }, [d, file])
59
+ fb = Factbase.new
60
+ fb.import(File.binread(file))
61
+ xml = Nokogiri::XML.parse(Factbase::ToXML.new(fb).xml)
62
+ refute_empty(xml.xpath('/fb/f[foo]'), xml)
63
+ end
64
+ end
65
+
54
66
  def test_extend_existing_factbase
55
67
  Dir.mktmpdir do |d|
56
68
  file = File.join(d, 'base.fb')
data/test/test_options.rb CHANGED
@@ -60,6 +60,11 @@ class TestOptions < Minitest::Test
60
60
  assert_nil(opts.xxx)
61
61
  end
62
62
 
63
+ def test_with_nil_values
64
+ opts = Judges::Options.new('foo' => nil)
65
+ assert_nil(opts.foo)
66
+ end
67
+
63
68
  def test_converts_to_string
64
69
  opts = Judges::Options.new('foo' => 44, 'bar' => 'long-string-maybe-secret')
65
70
  s = opts.to_s
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.53.1
4
+ version: 0.53.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko