judges 0.31.0 → 0.32.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 +4 -4
- data/.0pdd.yml +2 -19
- data/.github/workflows/actionlint.yml +4 -20
- data/.github/workflows/codecov.yml +9 -21
- data/.github/workflows/copyrights.yml +4 -19
- data/.github/workflows/markdown-lint.yml +4 -19
- data/.github/workflows/pdd.yml +5 -20
- data/.github/workflows/rake.yml +6 -22
- data/.github/workflows/reuse.yml +19 -0
- data/.github/workflows/xcop.yml +4 -19
- data/.github/workflows/yamllint.yml +4 -19
- data/.gitignore +2 -1
- data/.rubocop.yml +9 -20
- data/.rultor.yml +3 -19
- data/.simplecov +2 -19
- data/Gemfile +10 -25
- data/Gemfile.lock +84 -61
- data/LICENSES/MIT.txt +21 -0
- data/REUSE.toml +25 -0
- data/Rakefile +3 -29
- data/assets/index.xsl +2 -21
- data/bin/judges +2 -19
- data/features/gem_package.feature +3 -0
- data/features/import.feature +3 -0
- data/features/inspect.feature +3 -1
- data/features/join.feature +3 -0
- data/features/misc.feature +3 -0
- data/features/print.feature +3 -0
- data/features/pull.feature +3 -1
- data/features/push.feature +3 -0
- data/features/step_definitions/steps.rb +2 -19
- data/features/support/env.rb +2 -19
- data/features/test.feature +3 -0
- data/features/trim.feature +3 -0
- data/features/update.feature +5 -2
- data/fixtures/guess/guess.rb +2 -19
- data/fixtures/guess/guess_made.yml +2 -19
- data/fixtures/guess/skipped.yml +2 -19
- data/fixtures/try/tried.yml +2 -19
- data/fixtures/try/try.rb +2 -19
- data/judges.gemspec +4 -21
- data/lib/judges/categories.rb +4 -21
- data/lib/judges/commands/eval.rb +2 -19
- data/lib/judges/commands/import.rb +3 -20
- data/lib/judges/commands/inspect.rb +2 -19
- data/lib/judges/commands/join.rb +2 -19
- data/lib/judges/commands/print.rb +2 -19
- data/lib/judges/commands/pull.rb +2 -19
- data/lib/judges/commands/push.rb +2 -19
- data/lib/judges/commands/test.rb +4 -21
- data/lib/judges/commands/trim.rb +2 -19
- data/lib/judges/commands/update.rb +25 -49
- data/lib/judges/impex.rb +2 -19
- data/lib/judges/judge.rb +6 -20
- data/lib/judges/judges.rb +2 -19
- data/lib/judges/options.rb +2 -19
- data/lib/judges/to_rel.rb +2 -19
- data/lib/judges.rb +3 -20
- data/test/commands/test_eval.rb +3 -20
- data/test/commands/test_import.rb +3 -20
- data/test/commands/test_inspect.rb +3 -20
- data/test/commands/test_join.rb +5 -22
- data/test/commands/test_print.rb +8 -25
- data/test/commands/test_pull.rb +4 -21
- data/test/commands/test_push.rb +3 -20
- data/test/commands/test_test.rb +10 -21
- data/test/commands/test_trim.rb +2 -19
- data/test/commands/test_update.rb +11 -28
- data/test/test__helper.rb +2 -19
- data/test/test_bin.rb +3 -20
- data/test/test_categories.rb +7 -24
- data/test/test_impex.rb +2 -19
- data/test/test_judge.rb +7 -24
- data/test/test_judges.rb +3 -20
- data/test/test_options.rb +11 -28
- data/test/test_to_rel.rb +2 -19
- metadata +9 -8
- data/lib/judges/churn.rb +0 -66
- data/test/test_churn.rb +0 -46
data/test/test_bin.rb
CHANGED
@@ -1,24 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2024-2025 Yegor Bugayenko
|
4
|
-
#
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in all
|
13
|
-
# copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
# SOFTWARE.
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
4
|
+
# SPDX-License-Identifier: MIT
|
22
5
|
|
23
6
|
require 'minitest/autorun'
|
24
7
|
|
@@ -38,6 +21,6 @@ class TestBin < Minitest::Test
|
|
38
21
|
ensure
|
39
22
|
$stdout = before
|
40
23
|
end
|
41
|
-
|
24
|
+
assert_includes(s, Judges::VERSION, s)
|
42
25
|
end
|
43
26
|
end
|
data/test/test_categories.rb
CHANGED
@@ -1,24 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2024-2025 Yegor Bugayenko
|
4
|
-
#
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in all
|
13
|
-
# copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
# SOFTWARE.
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
4
|
+
# SPDX-License-Identifier: MIT
|
22
5
|
|
23
6
|
require 'minitest/autorun'
|
24
7
|
require_relative '../lib/judges'
|
@@ -33,10 +16,10 @@ class TestCategories < Minitest::Test
|
|
33
16
|
cats = Judges::Categories.new(%w[foo bar], ['bad'])
|
34
17
|
assert(cats.ok?(%w[foo other]))
|
35
18
|
assert(cats.ok?(%w[other more bar]))
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
19
|
+
refute(cats.ok?(%w[bad other]))
|
20
|
+
refute(cats.ok?(['other']))
|
21
|
+
refute(cats.ok?('hey'))
|
22
|
+
refute(cats.ok?(nil))
|
40
23
|
end
|
41
24
|
|
42
25
|
def test_all_enabled
|
@@ -45,6 +28,6 @@ class TestCategories < Minitest::Test
|
|
45
28
|
assert(cats.ok?('hey'))
|
46
29
|
assert(cats.ok?(%w[foo other]))
|
47
30
|
assert(cats.ok?(%w[other more bar]))
|
48
|
-
|
31
|
+
refute(cats.ok?(%w[bad other]))
|
49
32
|
end
|
50
33
|
end
|
data/test/test_impex.rb
CHANGED
@@ -1,24 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2024-2025 Yegor Bugayenko
|
4
|
-
#
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in all
|
13
|
-
# copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
# SOFTWARE.
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
4
|
+
# SPDX-License-Identifier: MIT
|
22
5
|
|
23
6
|
require 'minitest/autorun'
|
24
7
|
require 'tmpdir'
|
data/test/test_judge.rb
CHANGED
@@ -1,24 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2024-2025 Yegor Bugayenko
|
4
|
-
#
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in all
|
13
|
-
# copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
# SOFTWARE.
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
4
|
+
# SPDX-License-Identifier: MIT
|
22
5
|
|
23
6
|
require 'minitest/autorun'
|
24
7
|
require 'tmpdir'
|
@@ -81,7 +64,7 @@ class TestJudge < Minitest::Test
|
|
81
64
|
save_it(File.join(dir, "#{j}.rb"), '$loog.info("judge=" + $judge)')
|
82
65
|
log = Loog::Buffer.new
|
83
66
|
Judges::Judge.new(dir, nil, log).run(Factbase.new, {}, {}, {})
|
84
|
-
|
67
|
+
assert_includes(log.to_s, "judge=#{j}")
|
85
68
|
end
|
86
69
|
end
|
87
70
|
|
@@ -93,12 +76,12 @@ class TestJudge < Minitest::Test
|
|
93
76
|
log = Loog::Buffer.new
|
94
77
|
time = Time.now
|
95
78
|
Judges::Judge.new(dir, nil, log, start: time).run(Factbase.new, {}, {}, {})
|
96
|
-
|
79
|
+
assert_includes(log.to_s, "start=#{time}")
|
97
80
|
end
|
98
81
|
end
|
99
82
|
|
100
83
|
def test_with_broken_ruby_syntax
|
101
|
-
assert_raises do
|
84
|
+
assert_raises(StandardError) do
|
102
85
|
Dir.mktmpdir do |d|
|
103
86
|
dir = File.join(d, 'judges')
|
104
87
|
save_it(File.join(dir, "#{File.basename(d)}.rb"), 'this$is$broken$syntax')
|
@@ -109,7 +92,7 @@ class TestJudge < Minitest::Test
|
|
109
92
|
end
|
110
93
|
|
111
94
|
def test_with_runtime_ruby_error
|
112
|
-
assert_raises do
|
95
|
+
assert_raises(StandardError) do
|
113
96
|
Dir.mktmpdir do |d|
|
114
97
|
dir = File.join(d, 'judges')
|
115
98
|
save_it(File.join(dir, "#{File.basename(d)}.rb"), 'a < 1')
|
@@ -120,7 +103,7 @@ class TestJudge < Minitest::Test
|
|
120
103
|
end
|
121
104
|
|
122
105
|
def test_with_standard_error
|
123
|
-
assert_raises do
|
106
|
+
assert_raises(StandardError) do
|
124
107
|
Dir.mktmpdir do |d|
|
125
108
|
dir = File.join(d, 'judges')
|
126
109
|
save_it(File.join(dir, "#{File.basename(d)}.rb"), 'raise "intentional"')
|
data/test/test_judges.rb
CHANGED
@@ -1,24 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2024-2025 Yegor Bugayenko
|
4
|
-
#
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in all
|
13
|
-
# copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
# SOFTWARE.
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
4
|
+
# SPDX-License-Identifier: MIT
|
22
5
|
|
23
6
|
require 'minitest/autorun'
|
24
7
|
require 'tmpdir'
|
@@ -73,7 +56,7 @@ class TestJudges < Minitest::Test
|
|
73
56
|
save_it(File.join(d, 'another/wrong/wrong.rb'), '')
|
74
57
|
save_it(File.join(d, 'bad/hello.rb'), '')
|
75
58
|
list = Judges::Judges.new(d, nil, Loog::NULL).each.to_a
|
76
|
-
|
59
|
+
assert_empty(list)
|
77
60
|
end
|
78
61
|
end
|
79
62
|
end
|
data/test/test_options.rb
CHANGED
@@ -1,24 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2024-2025 Yegor Bugayenko
|
4
|
-
#
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in all
|
13
|
-
# copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
# SOFTWARE.
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
4
|
+
# SPDX-License-Identifier: MIT
|
22
5
|
|
23
6
|
require 'minitest/autorun'
|
24
7
|
require_relative '../lib/judges'
|
@@ -48,20 +31,20 @@ class TestOptions < Minitest::Test
|
|
48
31
|
|
49
32
|
def test_with_nil
|
50
33
|
opts = Judges::Options.new(nil)
|
51
|
-
|
52
|
-
|
34
|
+
assert_nil(opts.foo)
|
35
|
+
assert_empty(opts)
|
53
36
|
end
|
54
37
|
|
55
38
|
def test_with_empty_string
|
56
39
|
opts = Judges::Options.new(' ')
|
57
|
-
|
58
|
-
|
40
|
+
assert_nil(opts.foo)
|
41
|
+
assert_empty(opts, opts)
|
59
42
|
end
|
60
43
|
|
61
44
|
def test_with_empty_strings
|
62
45
|
opts = Judges::Options.new(['', nil])
|
63
|
-
|
64
|
-
|
46
|
+
assert_nil(opts.foo)
|
47
|
+
assert_empty(opts)
|
65
48
|
end
|
66
49
|
|
67
50
|
def test_with_string
|
@@ -74,14 +57,14 @@ class TestOptions < Minitest::Test
|
|
74
57
|
opts = Judges::Options.new('foo' => 42, 'bar' => 'hello')
|
75
58
|
assert_equal(42, opts.foo)
|
76
59
|
assert_equal('hello', opts.Bar)
|
77
|
-
|
60
|
+
assert_nil(opts.xxx)
|
78
61
|
end
|
79
62
|
|
80
63
|
def test_converts_to_string
|
81
64
|
opts = Judges::Options.new('foo' => 44, 'bar' => 'long-string-maybe-secret')
|
82
65
|
s = opts.to_s
|
83
|
-
|
84
|
-
|
66
|
+
assert_includes(s, 'FOO → "44"', s)
|
67
|
+
assert_includes(s, '"long****************cret"', s)
|
85
68
|
end
|
86
69
|
|
87
70
|
def test_merge
|
data/test/test_to_rel.rb
CHANGED
@@ -1,24 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2024-2025 Yegor Bugayenko
|
4
|
-
#
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in all
|
13
|
-
# copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
# SOFTWARE.
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
|
4
|
+
# SPDX-License-Identifier: MIT
|
22
5
|
|
23
6
|
require 'minitest/autorun'
|
24
7
|
require_relative '../lib/judges'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: judges
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.32.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: backtrace
|
@@ -70,16 +70,16 @@ dependencies:
|
|
70
70
|
name: factbase
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 0.7.0
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 0.7.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: gli
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -239,6 +239,7 @@ files:
|
|
239
239
|
- ".github/workflows/markdown-lint.yml"
|
240
240
|
- ".github/workflows/pdd.yml"
|
241
241
|
- ".github/workflows/rake.yml"
|
242
|
+
- ".github/workflows/reuse.yml"
|
242
243
|
- ".github/workflows/xcop.yml"
|
243
244
|
- ".github/workflows/yamllint.yml"
|
244
245
|
- ".gitignore"
|
@@ -249,7 +250,9 @@ files:
|
|
249
250
|
- Gemfile
|
250
251
|
- Gemfile.lock
|
251
252
|
- LICENSE.txt
|
253
|
+
- LICENSES/MIT.txt
|
252
254
|
- README.md
|
255
|
+
- REUSE.toml
|
253
256
|
- Rakefile
|
254
257
|
- assets/index.xsl
|
255
258
|
- bin/judges
|
@@ -274,7 +277,6 @@ files:
|
|
274
277
|
- judges.gemspec
|
275
278
|
- lib/judges.rb
|
276
279
|
- lib/judges/categories.rb
|
277
|
-
- lib/judges/churn.rb
|
278
280
|
- lib/judges/commands/eval.rb
|
279
281
|
- lib/judges/commands/import.rb
|
280
282
|
- lib/judges/commands/inspect.rb
|
@@ -304,7 +306,6 @@ files:
|
|
304
306
|
- test/test__helper.rb
|
305
307
|
- test/test_bin.rb
|
306
308
|
- test/test_categories.rb
|
307
|
-
- test/test_churn.rb
|
308
309
|
- test/test_impex.rb
|
309
310
|
- test/test_judge.rb
|
310
311
|
- test/test_judges.rb
|
data/lib/judges/churn.rb
DELETED
@@ -1,66 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2024-2025 Yegor Bugayenko
|
4
|
-
#
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in all
|
13
|
-
# copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
# SOFTWARE.
|
22
|
-
|
23
|
-
require_relative '../judges'
|
24
|
-
|
25
|
-
# How many facts were modified.
|
26
|
-
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
27
|
-
# Copyright:: Copyright (c) 2024-2025 Yegor Bugayenko
|
28
|
-
# License:: MIT
|
29
|
-
class Judges::Churn
|
30
|
-
attr_reader :added, :removed, :errors
|
31
|
-
|
32
|
-
def initialize(added, removed, errors = [])
|
33
|
-
@added = added
|
34
|
-
@removed = removed
|
35
|
-
@errors = errors
|
36
|
-
end
|
37
|
-
|
38
|
-
def to_s
|
39
|
-
"#{@added}/#{@removed}#{@errors.empty? ? '' : "/#{@errors.size}"}"
|
40
|
-
end
|
41
|
-
|
42
|
-
def zero?
|
43
|
-
@added.zero? && @removed.zero? && @errors.empty?
|
44
|
-
end
|
45
|
-
|
46
|
-
def <<(error)
|
47
|
-
@errors << error
|
48
|
-
nil
|
49
|
-
end
|
50
|
-
|
51
|
-
def +(other)
|
52
|
-
if other.is_a?(Judges::Churn)
|
53
|
-
Judges::Churn.new(@added + other.added, @removed + other.removed, @errors + other.errors)
|
54
|
-
else
|
55
|
-
Judges::Churn.new(@added + other, @removed, @errors)
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
def -(other)
|
60
|
-
if other.is_a?(Judges::Churn)
|
61
|
-
Judges::Churn.new(@added - other.added, @removed - other.removed, @errors + other.errors)
|
62
|
-
else
|
63
|
-
Judges::Churn.new(@added, @removed + other, @errors)
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
data/test/test_churn.rb
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright (c) 2024-2025 Yegor Bugayenko
|
4
|
-
#
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in all
|
13
|
-
# copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
# SOFTWARE.
|
22
|
-
|
23
|
-
require 'minitest/autorun'
|
24
|
-
require_relative '../lib/judges'
|
25
|
-
require_relative '../lib/judges/churn'
|
26
|
-
|
27
|
-
# Test.
|
28
|
-
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
29
|
-
# Copyright:: Copyright (c) 2024-2025 Yegor Bugayenko
|
30
|
-
# License:: MIT
|
31
|
-
class TestChurn < Minitest::Test
|
32
|
-
def test_basic
|
33
|
-
churn = Judges::Churn.new(0, 0)
|
34
|
-
assert_equal('0/0', churn.to_s)
|
35
|
-
assert_equal('42/0', (churn + 42).to_s)
|
36
|
-
assert_equal('0/17', (churn - 17).to_s)
|
37
|
-
end
|
38
|
-
|
39
|
-
def test_with_errors
|
40
|
-
churn = Judges::Churn.new(0, 0)
|
41
|
-
churn << 'oops'
|
42
|
-
assert_equal('0/0/1', churn.to_s)
|
43
|
-
assert_equal('42/0/1', (churn + 42).to_s)
|
44
|
-
assert_equal('0/0/1', (Judges::Churn.new(0, 0) + churn).to_s)
|
45
|
-
end
|
46
|
-
end
|