judges 0.30.0 → 0.31.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.0pdd.yml +1 -1
- data/.github/workflows/actionlint.yml +1 -1
- data/.github/workflows/codecov.yml +4 -2
- data/.github/workflows/copyrights.yml +1 -1
- data/.github/workflows/markdown-lint.yml +1 -1
- data/.github/workflows/pdd.yml +2 -2
- data/.github/workflows/rake.yml +2 -2
- data/.github/workflows/xcop.yml +1 -1
- data/.github/workflows/yamllint.yml +1 -1
- data/.gitignore +1 -1
- data/.rubocop.yml +6 -1
- data/.rultor.yml +1 -1
- data/.simplecov +1 -1
- data/Gemfile +6 -5
- data/Gemfile.lock +56 -42
- data/LICENSE.txt +1 -1
- data/Rakefile +1 -1
- data/assets/index.xsl +1 -1
- data/bin/judges +3 -3
- data/features/inspect.feature +0 -1
- data/features/pull.feature +0 -1
- data/features/step_definitions/steps.rb +1 -1
- data/features/support/env.rb +1 -1
- data/fixtures/guess/guess.rb +1 -1
- data/fixtures/guess/guess_made.yml +1 -1
- data/fixtures/guess/skipped.yml +1 -1
- data/fixtures/try/tried.yml +1 -1
- data/fixtures/try/try.rb +1 -1
- data/judges.gemspec +3 -3
- data/lib/judges/categories.rb +4 -4
- data/lib/judges/churn.rb +2 -2
- data/lib/judges/commands/eval.rb +2 -2
- data/lib/judges/commands/import.rb +3 -3
- data/lib/judges/commands/inspect.rb +2 -2
- data/lib/judges/commands/join.rb +2 -2
- data/lib/judges/commands/print.rb +2 -2
- data/lib/judges/commands/pull.rb +2 -2
- data/lib/judges/commands/push.rb +2 -2
- data/lib/judges/commands/test.rb +4 -4
- data/lib/judges/commands/trim.rb +2 -2
- data/lib/judges/commands/update.rb +11 -7
- data/lib/judges/impex.rb +2 -2
- data/lib/judges/judge.rb +2 -2
- data/lib/judges/judges.rb +2 -2
- data/lib/judges/options.rb +2 -2
- data/lib/judges/to_rel.rb +2 -2
- data/lib/judges.rb +3 -3
- data/test/commands/test_eval.rb +3 -3
- data/test/commands/test_import.rb +3 -3
- data/test/commands/test_inspect.rb +3 -3
- data/test/commands/test_join.rb +5 -5
- data/test/commands/test_print.rb +8 -8
- data/test/commands/test_pull.rb +4 -4
- data/test/commands/test_push.rb +3 -3
- data/test/commands/test_test.rb +4 -4
- data/test/commands/test_trim.rb +2 -2
- data/test/commands/test_update.rb +10 -10
- data/test/test__helper.rb +1 -1
- data/test/test_bin.rb +3 -3
- data/test/test_categories.rb +7 -7
- data/test/test_churn.rb +2 -2
- data/test/test_impex.rb +2 -2
- data/test/test_judge.rb +7 -7
- data/test/test_judges.rb +3 -3
- data/test/test_options.rb +11 -11
- data/test/test_to_rel.rb +2 -2
- metadata +6 -6
data/test/test_categories.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2024 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2024-2025 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -26,17 +26,17 @@ require_relative '../lib/judges/categories'
|
|
26
26
|
|
27
27
|
# Test.
|
28
28
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
29
|
-
# Copyright:: Copyright (c) 2024 Yegor Bugayenko
|
29
|
+
# Copyright:: Copyright (c) 2024-2025 Yegor Bugayenko
|
30
30
|
# License:: MIT
|
31
31
|
class TestCategories < Minitest::Test
|
32
32
|
def test_basic
|
33
33
|
cats = Judges::Categories.new(%w[foo bar], ['bad'])
|
34
34
|
assert(cats.ok?(%w[foo other]))
|
35
35
|
assert(cats.ok?(%w[other more bar]))
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
36
|
+
refute(cats.ok?(%w[bad other]))
|
37
|
+
refute(cats.ok?(['other']))
|
38
|
+
refute(cats.ok?('hey'))
|
39
|
+
refute(cats.ok?(nil))
|
40
40
|
end
|
41
41
|
|
42
42
|
def test_all_enabled
|
@@ -45,6 +45,6 @@ class TestCategories < Minitest::Test
|
|
45
45
|
assert(cats.ok?('hey'))
|
46
46
|
assert(cats.ok?(%w[foo other]))
|
47
47
|
assert(cats.ok?(%w[other more bar]))
|
48
|
-
|
48
|
+
refute(cats.ok?(%w[bad other]))
|
49
49
|
end
|
50
50
|
end
|
data/test/test_churn.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2024 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2024-2025 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -26,7 +26,7 @@ require_relative '../lib/judges/churn'
|
|
26
26
|
|
27
27
|
# Test.
|
28
28
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
29
|
-
# Copyright:: Copyright (c) 2024 Yegor Bugayenko
|
29
|
+
# Copyright:: Copyright (c) 2024-2025 Yegor Bugayenko
|
30
30
|
# License:: MIT
|
31
31
|
class TestChurn < Minitest::Test
|
32
32
|
def test_basic
|
data/test/test_impex.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2024 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2024-2025 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -28,7 +28,7 @@ require_relative '../lib/judges/impex'
|
|
28
28
|
|
29
29
|
# Test.
|
30
30
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
31
|
-
# Copyright:: Copyright (c) 2024 Yegor Bugayenko
|
31
|
+
# Copyright:: Copyright (c) 2024-2025 Yegor Bugayenko
|
32
32
|
# License:: MIT
|
33
33
|
class TestImpex < Minitest::Test
|
34
34
|
def test_basic
|
data/test/test_judge.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2024 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2024-2025 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -30,7 +30,7 @@ require_relative '../lib/judges/judge'
|
|
30
30
|
|
31
31
|
# Test.
|
32
32
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
33
|
-
# Copyright:: Copyright (c) 2024 Yegor Bugayenko
|
33
|
+
# Copyright:: Copyright (c) 2024-2025 Yegor Bugayenko
|
34
34
|
# License:: MIT
|
35
35
|
class TestJudge < Minitest::Test
|
36
36
|
def test_basic_run
|
@@ -81,7 +81,7 @@ class TestJudge < Minitest::Test
|
|
81
81
|
save_it(File.join(dir, "#{j}.rb"), '$loog.info("judge=" + $judge)')
|
82
82
|
log = Loog::Buffer.new
|
83
83
|
Judges::Judge.new(dir, nil, log).run(Factbase.new, {}, {}, {})
|
84
|
-
|
84
|
+
assert_includes(log.to_s, "judge=#{j}")
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
@@ -93,12 +93,12 @@ class TestJudge < Minitest::Test
|
|
93
93
|
log = Loog::Buffer.new
|
94
94
|
time = Time.now
|
95
95
|
Judges::Judge.new(dir, nil, log, start: time).run(Factbase.new, {}, {}, {})
|
96
|
-
|
96
|
+
assert_includes(log.to_s, "start=#{time}")
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
100
100
|
def test_with_broken_ruby_syntax
|
101
|
-
assert_raises do
|
101
|
+
assert_raises(StandardError) do
|
102
102
|
Dir.mktmpdir do |d|
|
103
103
|
dir = File.join(d, 'judges')
|
104
104
|
save_it(File.join(dir, "#{File.basename(d)}.rb"), 'this$is$broken$syntax')
|
@@ -109,7 +109,7 @@ class TestJudge < Minitest::Test
|
|
109
109
|
end
|
110
110
|
|
111
111
|
def test_with_runtime_ruby_error
|
112
|
-
assert_raises do
|
112
|
+
assert_raises(StandardError) do
|
113
113
|
Dir.mktmpdir do |d|
|
114
114
|
dir = File.join(d, 'judges')
|
115
115
|
save_it(File.join(dir, "#{File.basename(d)}.rb"), 'a < 1')
|
@@ -120,7 +120,7 @@ class TestJudge < Minitest::Test
|
|
120
120
|
end
|
121
121
|
|
122
122
|
def test_with_standard_error
|
123
|
-
assert_raises do
|
123
|
+
assert_raises(StandardError) do
|
124
124
|
Dir.mktmpdir do |d|
|
125
125
|
dir = File.join(d, 'judges')
|
126
126
|
save_it(File.join(dir, "#{File.basename(d)}.rb"), 'raise "intentional"')
|
data/test/test_judges.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2024 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2024-2025 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -28,7 +28,7 @@ require_relative '../lib/judges/judges'
|
|
28
28
|
|
29
29
|
# Test.
|
30
30
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
31
|
-
# Copyright:: Copyright (c) 2024 Yegor Bugayenko
|
31
|
+
# Copyright:: Copyright (c) 2024-2025 Yegor Bugayenko
|
32
32
|
# License:: MIT
|
33
33
|
class TestJudges < Minitest::Test
|
34
34
|
def test_basic
|
@@ -73,7 +73,7 @@ class TestJudges < Minitest::Test
|
|
73
73
|
save_it(File.join(d, 'another/wrong/wrong.rb'), '')
|
74
74
|
save_it(File.join(d, 'bad/hello.rb'), '')
|
75
75
|
list = Judges::Judges.new(d, nil, Loog::NULL).each.to_a
|
76
|
-
|
76
|
+
assert_empty(list)
|
77
77
|
end
|
78
78
|
end
|
79
79
|
end
|
data/test/test_options.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2024 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2024-2025 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -26,7 +26,7 @@ require_relative '../lib/judges/options'
|
|
26
26
|
|
27
27
|
# Test.
|
28
28
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
29
|
-
# Copyright:: Copyright (c) 2024 Yegor Bugayenko
|
29
|
+
# Copyright:: Copyright (c) 2024-2025 Yegor Bugayenko
|
30
30
|
# License:: MIT
|
31
31
|
class TestOptions < Minitest::Test
|
32
32
|
def test_basic
|
@@ -48,20 +48,20 @@ class TestOptions < Minitest::Test
|
|
48
48
|
|
49
49
|
def test_with_nil
|
50
50
|
opts = Judges::Options.new(nil)
|
51
|
-
|
52
|
-
|
51
|
+
assert_nil(opts.foo)
|
52
|
+
assert_empty(opts)
|
53
53
|
end
|
54
54
|
|
55
55
|
def test_with_empty_string
|
56
56
|
opts = Judges::Options.new(' ')
|
57
|
-
|
58
|
-
|
57
|
+
assert_nil(opts.foo)
|
58
|
+
assert_empty(opts, opts)
|
59
59
|
end
|
60
60
|
|
61
61
|
def test_with_empty_strings
|
62
62
|
opts = Judges::Options.new(['', nil])
|
63
|
-
|
64
|
-
|
63
|
+
assert_nil(opts.foo)
|
64
|
+
assert_empty(opts)
|
65
65
|
end
|
66
66
|
|
67
67
|
def test_with_string
|
@@ -74,14 +74,14 @@ class TestOptions < Minitest::Test
|
|
74
74
|
opts = Judges::Options.new('foo' => 42, 'bar' => 'hello')
|
75
75
|
assert_equal(42, opts.foo)
|
76
76
|
assert_equal('hello', opts.Bar)
|
77
|
-
|
77
|
+
assert_nil(opts.xxx)
|
78
78
|
end
|
79
79
|
|
80
80
|
def test_converts_to_string
|
81
81
|
opts = Judges::Options.new('foo' => 44, 'bar' => 'long-string-maybe-secret')
|
82
82
|
s = opts.to_s
|
83
|
-
|
84
|
-
|
83
|
+
assert_includes(s, 'FOO → "44"', s)
|
84
|
+
assert_includes(s, '"long****************cret"', s)
|
85
85
|
end
|
86
86
|
|
87
87
|
def test_merge
|
data/test/test_to_rel.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2024 Yegor Bugayenko
|
3
|
+
# Copyright (c) 2024-2025 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -26,7 +26,7 @@ require_relative '../lib/judges/to_rel'
|
|
26
26
|
|
27
27
|
# Test.
|
28
28
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
29
|
-
# Copyright:: Copyright (c) 2024 Yegor Bugayenko
|
29
|
+
# Copyright:: Copyright (c) 2024-2025 Yegor Bugayenko
|
30
30
|
# License:: MIT
|
31
31
|
class TestToRel < Minitest::Test
|
32
32
|
def test_simple_mapping
|
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.31.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-27 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.5.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.5.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: gli
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|