judges 0.19.0 → 0.20.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/Rakefile +2 -0
- data/bin/judges +6 -3
- data/features/update.feature +14 -0
- data/judges.gemspec +1 -1
- data/lib/judges.rb +1 -1
- data/test/test_bin.rb +43 -0
- data/test/test_judge.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1661542d2bb953029d98b55aee247ee5067488e67e7fa4debd8a35d7278bce55
|
4
|
+
data.tar.gz: 79803f9f17983970b404abd8c8619e08ad3d5587156f4cedd477f295c98ab2bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60bc48ba4d2532ce4d7960d132a5bc59674794c6b8495ada4852ea83745cdd6cdf1064ff9f76440573c34564c73057a19306f55b23fdddd783bd240517f23099
|
7
|
+
data.tar.gz: 528812bef0c9f6ba6225210a1130cfd03aea5816eb7c75da99adf323aaf09932cb18d6c0e9e057096212e353b85bf551a65b3144ba86504ff2d1930cdc1dcdaa
|
data/Rakefile
CHANGED
data/bin/judges
CHANGED
@@ -24,13 +24,13 @@ $stdout.sync = true
|
|
24
24
|
|
25
25
|
require 'gli'
|
26
26
|
require 'loog'
|
27
|
+
require 'time'
|
27
28
|
require 'factbase'
|
28
29
|
|
29
30
|
Encoding.default_external = Encoding::UTF_8
|
30
31
|
Encoding.default_internal = Encoding::UTF_8
|
31
32
|
|
32
|
-
class App
|
33
|
-
extend GLI::App
|
33
|
+
class JudgesGLI extend GLI::App
|
34
34
|
|
35
35
|
loog = Loog::REGULAR
|
36
36
|
|
@@ -52,6 +52,9 @@ class App
|
|
52
52
|
end
|
53
53
|
loog.debug("Judges #{Judges::VERSION}")
|
54
54
|
loog.debug("Factbase #{Factbase::VERSION}")
|
55
|
+
loog.debug("Ruby: #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}")
|
56
|
+
loog.debug("Current directory: #{Dir.getwd}")
|
57
|
+
loog.debug("Time: #{Time.now.utc.iso8601}")
|
55
58
|
true
|
56
59
|
end
|
57
60
|
|
@@ -212,4 +215,4 @@ class App
|
|
212
215
|
end
|
213
216
|
end
|
214
217
|
|
215
|
-
exit
|
218
|
+
exit JudgesGLI.run(ARGV) if ENV['GLI_TESTING'].nil?
|
data/features/update.feature
CHANGED
@@ -52,3 +52,17 @@ Feature: Update
|
|
52
52
|
Then I run bin/judges with "update mine simple.fb"
|
53
53
|
Then Stdout contains "Failed to update correctly"
|
54
54
|
And Exit code is not zero
|
55
|
+
|
56
|
+
Scenario: Avoid duplicate insert on error in the middle
|
57
|
+
Given I make a temp directory
|
58
|
+
Then I have a "mine/foo/foo.rb" file with content:
|
59
|
+
"""
|
60
|
+
return unless $fb.query('(eq foo 42)').each.to_a.empty?
|
61
|
+
f = $fb.insert
|
62
|
+
f.foo = 42
|
63
|
+
raise 'intentional'
|
64
|
+
"""
|
65
|
+
Then I run bin/judges with "update --quiet --max-cycles=3 mine simple.fb"
|
66
|
+
And Exit code is zero
|
67
|
+
Then I run bin/judges with "inspect simple.fb"
|
68
|
+
Then Stdout contains "Facts: 1"
|
data/judges.gemspec
CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
|
|
26
26
|
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
|
27
27
|
s.required_ruby_version = '>=3.2'
|
28
28
|
s.name = 'judges'
|
29
|
-
s.version = '0.
|
29
|
+
s.version = '0.20.0'
|
30
30
|
s.license = 'MIT'
|
31
31
|
s.summary = 'Command-Line Tool for a Factbase'
|
32
32
|
s.description =
|
data/lib/judges.rb
CHANGED
data/test/test_bin.rb
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright (c) 2024 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
|
+
|
25
|
+
# Test.
|
26
|
+
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
27
|
+
# Copyright:: Copyright (c) 2024 Yegor Bugayenko
|
28
|
+
# License:: MIT
|
29
|
+
class TestBin < Minitest::Test
|
30
|
+
def test_simple_run
|
31
|
+
ENV.store('GLI_TESTING', 'yes')
|
32
|
+
load File.join(__dir__, '../bin/judges')
|
33
|
+
before = $stdout
|
34
|
+
begin
|
35
|
+
$stdout = StringIO.new
|
36
|
+
JudgesGLI.run(['--version'])
|
37
|
+
s = $stdout.string
|
38
|
+
ensure
|
39
|
+
$stdout = before
|
40
|
+
end
|
41
|
+
assert(s.include?(Judges::VERSION), s)
|
42
|
+
end
|
43
|
+
end
|
data/test/test_judge.rb
CHANGED
@@ -31,7 +31,7 @@ require_relative '../lib/judges/judge'
|
|
31
31
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
32
32
|
# Copyright:: Copyright (c) 2024 Yegor Bugayenko
|
33
33
|
# License:: MIT
|
34
|
-
class
|
34
|
+
class TestJudge < Minitest::Test
|
35
35
|
def test_basic_run
|
36
36
|
Dir.mktmpdir do |d|
|
37
37
|
File.write(File.join(d, 'foo.rb'), '$fb.insert')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: judges
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
@@ -263,6 +263,7 @@ files:
|
|
263
263
|
- test/commands/test_update.rb
|
264
264
|
- test/test__helper.rb
|
265
265
|
- test/test_baza.rb
|
266
|
+
- test/test_bin.rb
|
266
267
|
- test/test_categories.rb
|
267
268
|
- test/test_churn.rb
|
268
269
|
- test/test_impex.rb
|