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/lib/judges/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 'time'
|
24
7
|
require_relative '../judges'
|
data/lib/judges/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 'others'
|
24
7
|
require_relative '../judges'
|
data/lib/judges/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 'pathname'
|
24
7
|
|
data/lib/judges.rb
CHANGED
@@ -1,29 +1,12 @@
|
|
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
|
# Judges.
|
24
7
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
25
8
|
# Copyright:: Copyright (c) 2024-2025 Yegor Bugayenko
|
26
9
|
# License:: MIT
|
27
10
|
module Judges
|
28
|
-
VERSION = '0.
|
11
|
+
VERSION = '0.32.0'
|
29
12
|
end
|
data/test/commands/test_eval.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 'loog'
|
@@ -40,7 +23,7 @@ class TestEval < Minitest::Test
|
|
40
23
|
fb = Factbase.new
|
41
24
|
fb.import(File.binread(file))
|
42
25
|
xml = Nokogiri::XML.parse(Factbase::ToXML.new(fb).xml)
|
43
|
-
|
26
|
+
refute_empty(xml.xpath('/fb/f[foo="42"]'), xml)
|
44
27
|
end
|
45
28
|
end
|
46
29
|
end
|
@@ -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 'loog'
|
@@ -52,7 +35,7 @@ class TestImport < Minitest::Test
|
|
52
35
|
fb = Factbase.new
|
53
36
|
fb.import(File.binread(file))
|
54
37
|
xml = Nokogiri::XML.parse(Factbase::ToXML.new(fb).xml)
|
55
|
-
|
38
|
+
refute_empty(xml.xpath('/fb[count(f)=2]'), xml)
|
56
39
|
end
|
57
40
|
end
|
58
41
|
end
|
@@ -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 'loog'
|
@@ -40,7 +23,7 @@ class TestInspect < Minitest::Test
|
|
40
23
|
File.binwrite(f, fb.export)
|
41
24
|
loog = Loog::Buffer.new
|
42
25
|
Judges::Inspect.new(loog).run({}, [f])
|
43
|
-
|
26
|
+
assert_includes(loog.to_s, 'Facts: 2')
|
44
27
|
end
|
45
28
|
end
|
46
29
|
end
|
data/test/commands/test_join.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 'loog'
|
@@ -47,9 +30,9 @@ class TestJoin < Minitest::Test
|
|
47
30
|
fb = Factbase.new
|
48
31
|
fb.import(File.binread(master))
|
49
32
|
xml = Nokogiri::XML.parse(Factbase::ToXML.new(fb).xml)
|
50
|
-
|
51
|
-
|
52
|
-
|
33
|
+
refute_empty(xml.xpath('/fb/f[zz="5"]'), xml)
|
34
|
+
refute_empty(xml.xpath('/fb/f[foo_bar="42"]'), xml)
|
35
|
+
assert_includes(loog.to_s, 'Two factbases joined', loog.to_s)
|
53
36
|
end
|
54
37
|
end
|
55
38
|
end
|
data/test/commands/test_print.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 'loog'
|
@@ -45,7 +28,7 @@ class TestPrint < Minitest::Test
|
|
45
28
|
File.binwrite(f, fb.export)
|
46
29
|
Judges::Print.new(Loog::NULL).run({ 'format' => 'yaml', 'auto' => true }, [f])
|
47
30
|
y = File.join(d, 'base.yaml')
|
48
|
-
|
31
|
+
assert_path_exists(y)
|
49
32
|
assert_equal(1, YAML.load_file(y).size)
|
50
33
|
end
|
51
34
|
end
|
@@ -83,11 +66,11 @@ class TestPrint < Minitest::Test
|
|
83
66
|
rescue StandardError => e
|
84
67
|
raise "#{doc}\n\n#{e}"
|
85
68
|
end
|
86
|
-
|
87
|
-
|
69
|
+
assert_empty(xml.errors, xml)
|
70
|
+
refute_empty(xml.xpath('/html'), xml)
|
88
71
|
WebMock.enable_net_connect!
|
89
72
|
v = W3CValidators::NuValidator.new.validate_file(html)
|
90
|
-
|
73
|
+
assert_empty(v.errors, "#{doc}\n\n#{v.errors.join('; ')}")
|
91
74
|
end
|
92
75
|
|
93
76
|
def test_print_all_formats
|
@@ -99,7 +82,7 @@ class TestPrint < Minitest::Test
|
|
99
82
|
File.binwrite(f, fb.export)
|
100
83
|
Judges::Print.new(Loog::NULL).run({ 'format' => fmt, 'auto' => true }, [f])
|
101
84
|
y = File.join(d, "base.#{fmt}")
|
102
|
-
|
85
|
+
assert_path_exists(y)
|
103
86
|
end
|
104
87
|
end
|
105
88
|
end
|
@@ -112,7 +95,7 @@ class TestPrint < Minitest::Test
|
|
112
95
|
File.binwrite(f, fb.export)
|
113
96
|
Judges::Print.new(Loog::NULL).run({ 'format' => 'yaml', 'auto' => true }, [f])
|
114
97
|
y = File.join(d, 'base.yaml')
|
115
|
-
|
98
|
+
assert_path_exists(y)
|
116
99
|
mtime = File.mtime(y)
|
117
100
|
Judges::Print.new(Loog::NULL).run({ 'format' => 'yaml', 'auto' => true }, [f])
|
118
101
|
assert_equal(mtime, File.mtime(y))
|
data/test/commands/test_pull.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 'webmock/minitest'
|
@@ -73,7 +56,7 @@ class TestPull < Minitest::Test
|
|
73
56
|
Dir.mktmpdir do |d|
|
74
57
|
file = File.join(d, 'base.fb')
|
75
58
|
e =
|
76
|
-
assert_raises do
|
59
|
+
assert_raises(StandardError) do
|
77
60
|
Judges::Pull.new(Loog::NULL).run(
|
78
61
|
{
|
79
62
|
'token' => '000',
|
@@ -86,7 +69,7 @@ class TestPull < Minitest::Test
|
|
86
69
|
['foo', file]
|
87
70
|
)
|
88
71
|
end
|
89
|
-
|
72
|
+
assert_includes(e.message, 'expire it', e)
|
90
73
|
end
|
91
74
|
end
|
92
75
|
end
|
data/test/commands/test_push.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 'webmock/minitest'
|
@@ -77,7 +60,7 @@ class TestPush < Minitest::Test
|
|
77
60
|
fb = Factbase.new
|
78
61
|
fb.insert.foo_bar = 42
|
79
62
|
File.binwrite(file, fb.export)
|
80
|
-
assert_raises do
|
63
|
+
assert_raises(StandardError) do
|
81
64
|
Judges::Push.new(Loog::NULL).run(
|
82
65
|
{
|
83
66
|
'token' => '000',
|
data/test/commands/test_test.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 'loog'
|
@@ -47,6 +30,7 @@ class TestTest < Minitest::Test
|
|
47
30
|
YAML
|
48
31
|
)
|
49
32
|
Judges::Test.new(Loog::NULL).run({}, [d])
|
33
|
+
assert_path_exists(d)
|
50
34
|
end
|
51
35
|
end
|
52
36
|
|
@@ -65,7 +49,7 @@ class TestTest < Minitest::Test
|
|
65
49
|
- /fb/f[bar/v='5']
|
66
50
|
YAML
|
67
51
|
)
|
68
|
-
assert_raises do
|
52
|
+
assert_raises(StandardError) do
|
69
53
|
Judges::Test.new(Loog::NULL).run({}, [d])
|
70
54
|
end
|
71
55
|
end
|
@@ -86,6 +70,7 @@ class TestTest < Minitest::Test
|
|
86
70
|
YAML
|
87
71
|
)
|
88
72
|
Judges::Test.new(Loog::NULL).run({}, [d])
|
73
|
+
assert_path_exists(d)
|
89
74
|
end
|
90
75
|
end
|
91
76
|
|
@@ -109,6 +94,7 @@ class TestTest < Minitest::Test
|
|
109
94
|
YAML
|
110
95
|
)
|
111
96
|
Judges::Test.new(Loog::NULL).run({}, [d])
|
97
|
+
assert_path_exists(d)
|
112
98
|
end
|
113
99
|
end
|
114
100
|
|
@@ -123,7 +109,7 @@ class TestTest < Minitest::Test
|
|
123
109
|
- /fb[count(f)=1]
|
124
110
|
YAML
|
125
111
|
)
|
126
|
-
assert_raises do
|
112
|
+
assert_raises(StandardError) do
|
127
113
|
Judges::Test.new(Loog::NULL).run({ 'judge' => [File.basename(dir)] }, [d])
|
128
114
|
end
|
129
115
|
end
|
@@ -142,6 +128,7 @@ class TestTest < Minitest::Test
|
|
142
128
|
YAML
|
143
129
|
)
|
144
130
|
Judges::Test.new(Loog::NULL).run({}, [d])
|
131
|
+
assert_path_exists(d)
|
145
132
|
end
|
146
133
|
end
|
147
134
|
|
@@ -157,6 +144,7 @@ class TestTest < Minitest::Test
|
|
157
144
|
YAML
|
158
145
|
)
|
159
146
|
Judges::Test.new(Loog::NULL).run({}, [d])
|
147
|
+
assert_path_exists(d)
|
160
148
|
end
|
161
149
|
end
|
162
150
|
|
@@ -171,6 +159,7 @@ class TestTest < Minitest::Test
|
|
171
159
|
YAML
|
172
160
|
)
|
173
161
|
Judges::Test.new(Loog::NULL).run({}, [d])
|
162
|
+
assert_path_exists(d)
|
174
163
|
end
|
175
164
|
end
|
176
165
|
end
|
data/test/commands/test_trim.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 'loog'
|
@@ -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 'loog'
|
@@ -41,7 +24,7 @@ class TestUpdate < Minitest::Test
|
|
41
24
|
fb = Factbase.new
|
42
25
|
fb.import(File.binread(file))
|
43
26
|
xml = Nokogiri::XML.parse(Factbase::ToXML.new(fb).xml)
|
44
|
-
|
27
|
+
refute_empty(xml.xpath('/fb/f[zzz="43"]'), xml)
|
45
28
|
end
|
46
29
|
end
|
47
30
|
|
@@ -49,11 +32,11 @@ class TestUpdate < Minitest::Test
|
|
49
32
|
Dir.mktmpdir do |d|
|
50
33
|
save_it(File.join(d, 'foo/foo.rb'), 'sleep 10; $fb.insert.foo = 1')
|
51
34
|
file = File.join(d, 'base.fb')
|
52
|
-
Judges::Update.new(Loog::NULL).run({ 'timeout' => 0.1 }, [d, file])
|
35
|
+
Judges::Update.new(Loog::NULL).run({ 'timeout' => 0.1, 'quiet' => true }, [d, file])
|
53
36
|
fb = Factbase.new
|
54
37
|
fb.import(File.binread(file))
|
55
38
|
xml = Nokogiri::XML.parse(Factbase::ToXML.new(fb).xml)
|
56
|
-
|
39
|
+
assert_empty(xml.xpath('/fb/f'), xml)
|
57
40
|
end
|
58
41
|
end
|
59
42
|
|
@@ -68,8 +51,8 @@ class TestUpdate < Minitest::Test
|
|
68
51
|
fb = Factbase.new
|
69
52
|
fb.import(File.binread(file))
|
70
53
|
xml = Nokogiri::XML.parse(Factbase::ToXML.new(fb).xml)
|
71
|
-
|
72
|
-
|
54
|
+
refute_empty(xml.xpath('/fb/f[tt="4"]'), xml)
|
55
|
+
refute_empty(xml.xpath('/fb/f[foo_bar="42"]'), xml)
|
73
56
|
end
|
74
57
|
end
|
75
58
|
|
@@ -91,12 +74,12 @@ class TestUpdate < Minitest::Test
|
|
91
74
|
fb = Factbase.new
|
92
75
|
fb.import(File.binread(file))
|
93
76
|
xml = Nokogiri::XML.parse(Factbase::ToXML.new(fb).xml)
|
94
|
-
|
77
|
+
refute_empty(xml.xpath('/fb/f[foo="444"]'), xml)
|
95
78
|
end
|
96
79
|
end
|
97
80
|
|
98
81
|
def test_update_with_error_no_quiet
|
99
|
-
assert_raises do
|
82
|
+
assert_raises(StandardError) do
|
100
83
|
Dir.mktmpdir do |d|
|
101
84
|
save_it(File.join(d, 'foo/foo.rb'), 'a < 1')
|
102
85
|
file = File.join(d, 'base.fb')
|
@@ -120,8 +103,8 @@ class TestUpdate < Minitest::Test
|
|
120
103
|
sums = fb.query('(eq what "judges-summary")').each.to_a
|
121
104
|
assert_equal(1, sums.size)
|
122
105
|
sum = sums.first
|
123
|
-
|
124
|
-
|
106
|
+
assert_includes(sum.error, 'unexpected global variable', sum.error)
|
107
|
+
refute_nil(sum.seconds)
|
125
108
|
end
|
126
109
|
end
|
127
110
|
end
|
data/test/test__helper.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
|
$stdout.sync = true
|
24
7
|
|