judges 0.50.4 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b16e216f16363000cc2b83d5098ddeb511e1deb364fe25772afe97862939af4
4
- data.tar.gz: 931370f4f6301296a8d39d8d21f84c7be5f2c15a1a714e4b4a222e5d55602ea2
3
+ metadata.gz: f7d38a936eb623852f05ef4710fab7237cba034af4b50ec90fe65deb644d5870
4
+ data.tar.gz: 254bc70deb49a3d39aa8b26c58af3f26c665e68e632f19305e794fbc10158d58
5
5
  SHA512:
6
- metadata.gz: 4989f7f7fc1e3e126c0215cac984eb402a01ae08ac41e4257136055ed30bf061a424f5b0bec193e20410a5ed269991da2377af3f4cf6c468d2381b82c828ee81
7
- data.tar.gz: 9a96ce56f0f466ed5ce4749cf640872d8c14b2eee46f622cb3d89968565204abbfdc1577223a05d400137ab0570e27e80900b3db48e07834cbe1725a3d86a8a4
6
+ metadata.gz: 68b98c1db32b72439c0c7e96de84597fcf22dc1ed717c82b63e31899686bc972280826f744ced102af90604f139c1c3ff2d71fdbbd3ccf5d46f95eeb7987f0eb
7
+ data.tar.gz: c5cee354f45ebdfc63a85b61e1f3823fea44ff89e2c73091cba63f10d8bd9d575d43636e247c1ac59e9a33e0328e1fbf3f829047eaf2061093547ef6375d1940
@@ -16,4 +16,4 @@ jobs:
16
16
  runs-on: ubuntu-24.04
17
17
  steps:
18
18
  - uses: actions/checkout@v4
19
- - uses: crate-ci/typos@v1.33.1
19
+ - uses: crate-ci/typos@v1.34.0
data/Gemfile.lock CHANGED
@@ -77,11 +77,13 @@ GEM
77
77
  elapsed (0.0.1)
78
78
  loog (> 0)
79
79
  tago (> 0)
80
+ ellipsized (0.3.0)
80
81
  ethon (0.16.0)
81
82
  ffi (>= 1.15.0)
82
- factbase (0.11.0)
83
+ factbase (0.11.1)
83
84
  backtrace (~> 0.4)
84
85
  decoor (~> 0.0)
86
+ ellipsized (~> 0.3)
85
87
  json (~> 2.7)
86
88
  logger (~> 1.0)
87
89
  loog (~> 0.6)
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
- Object.const_get("Judges::#{ruby.capitalize}").new(@@loog).run(options, args)
29
- @@loog.debug("Command '#{ruby}' completed in #{start.ago}")
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
 
@@ -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 "update . simple.fb"
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
@@ -16,9 +16,9 @@ Feature: Test
16
16
  And Exit code is zero
17
17
 
18
18
  Scenario: Factbase version can be set
19
- When I run bin/judges with "--factbase 0.11.0 --verbose test --judge guess ./fixtures"
19
+ When I run bin/judges with "--factbase 0.11.1 --verbose test --judge guess ./fixtures"
20
20
  Then Exit code is zero
21
- And Stdout contains "Factbase version to be used: '0.11.0'"
21
+ And Stdout contains "Factbase version to be used: '0.11.1'"
22
22
 
23
23
  Scenario: Simple test of no judges
24
24
  Given I run bin/judges with "test --judge absent_for_sure ./fixtures"
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.4'
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
@@ -8,5 +8,5 @@
8
8
  # Copyright:: Copyright (c) 2024-2025 Yegor Bugayenko
9
9
  # License:: MIT
10
10
  module Judges
11
- VERSION = '0.50.4' unless const_defined?(:VERSION)
11
+ VERSION = '0.50.6' unless const_defined?(:VERSION)
12
12
  end
@@ -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
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.50.4
4
+ version: 0.50.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko