judges 0.50.5 → 0.50.6
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/.github/workflows/typos.yml +1 -1
- data/bin/judges +9 -2
- data/features/inspect.feature +7 -1
- data/judges.gemspec +1 -1
- data/lib/judges/commands/inspect.rb +1 -1
- data/lib/judges.rb +1 -1
- data/test/commands/test_inspect.rb +15 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7d38a936eb623852f05ef4710fab7237cba034af4b50ec90fe65deb644d5870
|
4
|
+
data.tar.gz: 254bc70deb49a3d39aa8b26c58af3f26c665e68e632f19305e794fbc10158d58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68b98c1db32b72439c0c7e96de84597fcf22dc1ed717c82b63e31899686bc972280826f744ced102af90604f139c1c3ff2d71fdbbd3ccf5d46f95eeb7987f0eb
|
7
|
+
data.tar.gz: c5cee354f45ebdfc63a85b61e1f3823fea44ff89e2c73091cba63f10d8bd9d575d43636e247c1ac59e9a33e0328e1fbf3f829047eaf2061093547ef6375d1940
|
data/.github/workflows/typos.yml
CHANGED
data/bin/judges
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
|
6
6
|
$stdout.sync = true
|
7
7
|
|
8
|
+
require 'backtrace'
|
8
9
|
require 'baza-rb/version'
|
9
10
|
require 'gli'
|
10
11
|
require 'loog'
|
@@ -25,8 +26,14 @@ class JudgesGLI extend GLI::App
|
|
25
26
|
require_relative "../lib/judges/commands/#{ruby}"
|
26
27
|
start = Time.now
|
27
28
|
@@loog.debug("Running '#{ruby}' command...")
|
28
|
-
|
29
|
-
|
29
|
+
begin
|
30
|
+
Object.const_get("Judges::#{ruby.capitalize}").new(@@loog).run(options, args)
|
31
|
+
@@loog.debug("Command '#{ruby}' completed in #{start.ago}")
|
32
|
+
rescue StandardError => e
|
33
|
+
@@loog.error("Command '#{ruby}' failed in #{start.ago}")
|
34
|
+
@@loog.error(Backtrace.new(e).to_s)
|
35
|
+
raise e
|
36
|
+
end
|
30
37
|
end
|
31
38
|
end
|
32
39
|
|
data/features/inspect.feature
CHANGED
@@ -7,7 +7,13 @@ Feature: Inspect
|
|
7
7
|
Scenario: Simple inspect of a small factbase
|
8
8
|
Given I make a temp directory
|
9
9
|
Then I run bin/judges with "--verbose eval simple.fb '$fb.insert.foo = 42'"
|
10
|
-
Then I run bin/judges with "
|
10
|
+
Then I run bin/judges with "inspect simple.fb"
|
11
|
+
Then Stdout contains "Facts: 1"
|
12
|
+
And Exit code is zero
|
13
|
+
|
14
|
+
Scenario: Inspect with a summary
|
15
|
+
Given I make a temp directory
|
16
|
+
Then I run bin/judges with "--verbose eval simple.fb '$fb.insert.what = "judges-summary"'"
|
11
17
|
Then I run bin/judges with "inspect simple.fb"
|
12
18
|
Then Stdout contains "Facts: 1"
|
13
19
|
And Exit code is zero
|
data/judges.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
|
10
10
|
s.required_ruby_version = '>=3.2'
|
11
11
|
s.name = 'judges'
|
12
|
-
s.version = '0.50.
|
12
|
+
s.version = '0.50.6'
|
13
13
|
s.license = 'MIT'
|
14
14
|
s.summary = 'Command-Line Tool for a Factbase'
|
15
15
|
s.description =
|
@@ -34,7 +34,7 @@ class Judges::Inspect
|
|
34
34
|
if sum.empty?
|
35
35
|
@loog.info('Summary fact not found')
|
36
36
|
else
|
37
|
-
@loog.info("Summary fact found:\n\t#{Factbase::FactAsYaml.new(sum.first).gsub("\n", "\n\t")}")
|
37
|
+
@loog.info("Summary fact found:\n\t#{Factbase::FactAsYaml.new(sum.first).to_s.gsub("\n", "\n\t")}")
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|
data/lib/judges.rb
CHANGED
@@ -26,4 +26,19 @@ class TestInspect < Minitest::Test
|
|
26
26
|
assert_includes(loog.to_s, 'Facts: 2')
|
27
27
|
end
|
28
28
|
end
|
29
|
+
|
30
|
+
def test_simple_inspect_with_summary
|
31
|
+
Dir.mktmpdir do |d|
|
32
|
+
f = File.join(d, 'base.fb')
|
33
|
+
fb = Factbase.new
|
34
|
+
fb.insert.then do |f|
|
35
|
+
f.what = 'judges-summary'
|
36
|
+
f.error = 'something'
|
37
|
+
end
|
38
|
+
File.binwrite(f, fb.export)
|
39
|
+
loog = Loog::Buffer.new
|
40
|
+
Judges::Inspect.new(loog).run({}, [f])
|
41
|
+
assert_includes(loog.to_s, 'Facts: 1')
|
42
|
+
end
|
43
|
+
end
|
29
44
|
end
|