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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '069b7acef208251d415f08fcbbcc970fbaad97cb2e1733a78429ef646f218cd9'
4
- data.tar.gz: 30127407e14ff804e8c9e660d94baec68b2ce7ba2eec0b9a7159c5935ddcee29
3
+ metadata.gz: f7d38a936eb623852f05ef4710fab7237cba034af4b50ec90fe65deb644d5870
4
+ data.tar.gz: 254bc70deb49a3d39aa8b26c58af3f26c665e68e632f19305e794fbc10158d58
5
5
  SHA512:
6
- metadata.gz: 36e0d637ba3916d819b78096ddccf07b645ba8e455950f65c192c3e0aa34ea7345f869fa04266a88b30afacf9cec05a1c411f2610e8b415a753e2225afc44d5f
7
- data.tar.gz: c02b8c03bb38d441ee2be2933d5387ef104d03e96885a508f3024919d76000d572cc984c93bcdf65b416743750384028e305f453a8dce4a46be2d3710a380555
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/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
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.5'
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.5' 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.5
4
+ version: 0.50.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko