judges 0.31.1 → 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 +6 -20
- data/.github/workflows/copyrights.yml +4 -19
- data/.github/workflows/markdown-lint.yml +4 -19
- data/.github/workflows/pdd.yml +4 -19
- data/.github/workflows/rake.yml +5 -21
- data/.github/workflows/reuse.yml +19 -0
- data/.github/workflows/xcop.yml +4 -19
- data/.github/workflows/yamllint.yml +4 -19
- data/.gitignore +1 -0
- data/.rubocop.yml +5 -21
- data/.rultor.yml +3 -19
- data/.simplecov +2 -19
- data/Gemfile +9 -25
- data/Gemfile.lock +52 -42
- 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 -0
- data/features/join.feature +3 -0
- data/features/misc.feature +3 -0
- data/features/print.feature +3 -0
- data/features/pull.feature +3 -0
- 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 +2 -19
- data/lib/judges/commands/eval.rb +2 -19
- data/lib/judges/commands/import.rb +2 -19
- 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 +2 -19
- 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 +2 -19
- data/test/commands/test_import.rb +2 -19
- data/test/commands/test_inspect.rb +2 -19
- data/test/commands/test_join.rb +2 -19
- data/test/commands/test_print.rb +2 -19
- data/test/commands/test_pull.rb +2 -19
- data/test/commands/test_push.rb +2 -19
- data/test/commands/test_test.rb +8 -19
- data/test/commands/test_trim.rb +2 -19
- data/test/commands/test_update.rb +3 -20
- data/test/test__helper.rb +2 -19
- data/test/test_bin.rb +2 -19
- data/test/test_categories.rb +2 -19
- data/test/test_impex.rb +2 -19
- data/test/test_judge.rb +2 -19
- data/test/test_judges.rb +2 -19
- data/test/test_options.rb +2 -19
- data/test/test_to_rel.rb +2 -19
- metadata +7 -6
- data/lib/judges/churn.rb +0 -66
- data/test/test_churn.rb +0 -46
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
|