judges 0.53.3 → 0.53.4
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 +2 -2
- data/judges.gemspec +1 -1
- data/lib/judges/commands/update.rb +7 -2
- data/lib/judges.rb +1 -1
- data/test/commands/test_update.rb +14 -0
- 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: 8ee9872053ac43a975675a9eaed91b496bdb91ba0d3dc5595f956073c5ba2a13
|
4
|
+
data.tar.gz: 67e1409f8793c1fa9ad634d732f3596ef4ff08e9d587a14dc0a8b1ce3490622c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca7c356028c05c6bfdab1e6d7e826865dfe6f4e3ca5bec43718465a2ec03f39ba7823fb2fee05982e95c1ca0312003b3856f65a9e3e737d48ad3613c1afcb5b7
|
7
|
+
data.tar.gz: 692e4a5de4b92d85fcc15a22b7004dc72e5ebf83c339c34e5a8d4ac9bce08e62327f57ad1e96e50f3ddc4ce98fb149caadf567a9fe13943150fa1fda67ec667c
|
data/Gemfile.lock
CHANGED
@@ -177,7 +177,7 @@ GEM
|
|
177
177
|
tago (> 0)
|
178
178
|
regexp_parser (2.11.2)
|
179
179
|
retries (0.0.5)
|
180
|
-
rexml (3.4.
|
180
|
+
rexml (3.4.2)
|
181
181
|
rubocop (1.80.0)
|
182
182
|
json (~> 2.3)
|
183
183
|
language_server-protocol (~> 3.17.0.2)
|
@@ -208,7 +208,7 @@ GEM
|
|
208
208
|
docile (~> 1.1)
|
209
209
|
simplecov-html (~> 0.11)
|
210
210
|
simplecov_json_formatter (~> 0.1)
|
211
|
-
simplecov-cobertura (3.
|
211
|
+
simplecov-cobertura (3.1.0)
|
212
212
|
rexml
|
213
213
|
simplecov (~> 0.19)
|
214
214
|
simplecov-html (0.13.2)
|
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.
|
12
|
+
s.version = '0.53.4'
|
13
13
|
s.license = 'MIT'
|
14
14
|
s.summary = 'Command-Line Tool for a Factbase'
|
15
15
|
s.description =
|
@@ -69,8 +69,13 @@ class Judges::Update
|
|
69
69
|
start: @start, shuffle: opts['shuffle'], boost: opts['boost'],
|
70
70
|
demote: opts['demote']
|
71
71
|
)
|
72
|
-
|
73
|
-
|
72
|
+
begin
|
73
|
+
Timeout.timeout(opts['lifetime']) do
|
74
|
+
loop_them(impex, judges, fb, opts, options)
|
75
|
+
end
|
76
|
+
rescue Timeout::Error, Timeout::ExitException => e
|
77
|
+
raise e unless opts['quiet']
|
78
|
+
@loog.info("Had to stop due to the --lifetime=#{opts['lifetime']}")
|
74
79
|
end
|
75
80
|
end
|
76
81
|
|
data/lib/judges.rb
CHANGED
@@ -39,6 +39,20 @@ class TestUpdate < Minitest::Test
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
+
def test_cancels_slow_execution
|
43
|
+
Dir.mktmpdir do |d|
|
44
|
+
10.times do |i|
|
45
|
+
save_it(File.join(d, "foo-#{i}/foo-#{i}.rb"), '$fb.insert.foo = 0.05; sleep 2;')
|
46
|
+
end
|
47
|
+
file = File.join(d, 'base.fb')
|
48
|
+
Judges::Update.new(Loog::NULL).run({ 'lifetime' => 0.12, 'timeout' => 0.1, 'quiet' => true }, [d, file])
|
49
|
+
fb = Factbase.new
|
50
|
+
fb.import(File.binread(file))
|
51
|
+
xml = Nokogiri::XML.parse(Factbase::ToXML.new(fb).xml)
|
52
|
+
refute_empty(xml.xpath('/fb/f[foo]'), xml)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
42
56
|
def test_cancels_slow_judge
|
43
57
|
Dir.mktmpdir do |d|
|
44
58
|
save_it(File.join(d, 'foo/foo.rb'), 'sleep 10; $fb.insert.foo = 1')
|