judges 0.50.5 → 0.50.7

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: 48308bd607feff68ebe21b0f156fc5d9abbd8adbe5438f5b9ff6cddab66fe082
4
+ data.tar.gz: a0ffae5781508ef43b955296007c2ea4dcf9cc7b979777550a8a6cc5aefca65f
5
5
  SHA512:
6
- metadata.gz: 36e0d637ba3916d819b78096ddccf07b645ba8e455950f65c192c3e0aa34ea7345f869fa04266a88b30afacf9cec05a1c411f2610e8b415a753e2225afc44d5f
7
- data.tar.gz: c02b8c03bb38d441ee2be2933d5387ef104d03e96885a508f3024919d76000d572cc984c93bcdf65b416743750384028e305f453a8dce4a46be2d3710a380555
6
+ metadata.gz: dfbbbd50d67fec075f15507b7859c322ad9ae3b72a7b4a19c4582794d40b531d070cffdd4d035e5df3da29393a4208c12d8e4265c804b84fe9fa39f19d906528
7
+ data.tar.gz: 82b6fae475dbfb3dea1d3c8b5fc656dcd104857dfef18e0230ee29d9340849aa950f061d1324bd909537c55959938c2a0bb71ec370e5f9f59de20aa20c6ee44e
@@ -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
@@ -71,16 +71,16 @@ GEM
71
71
  cucumber-messages (> 19, < 28)
72
72
  cucumber-messages (27.2.0)
73
73
  cucumber-tag-expressions (6.1.2)
74
- decoor (0.0.1)
74
+ decoor (0.1.0)
75
75
  diff-lcs (1.6.2)
76
76
  docile (1.4.1)
77
- elapsed (0.0.1)
77
+ elapsed (0.1.0)
78
78
  loog (> 0)
79
79
  tago (> 0)
80
80
  ellipsized (0.3.0)
81
81
  ethon (0.16.0)
82
82
  ffi (>= 1.15.0)
83
- factbase (0.11.1)
83
+ factbase (0.12.1)
84
84
  backtrace (~> 0.4)
85
85
  decoor (~> 0.0)
86
86
  ellipsized (~> 0.3)
@@ -108,6 +108,7 @@ GEM
108
108
  ffi (1.17.2-arm-linux-gnu)
109
109
  ffi (1.17.2-arm-linux-musl)
110
110
  ffi (1.17.2-arm64-darwin)
111
+ ffi (1.17.2-x64-mingw-ucrt)
111
112
  ffi (1.17.2-x86_64-darwin)
112
113
  ffi (1.17.2-x86_64-linux-gnu)
113
114
  ffi (1.17.2-x86_64-linux-musl)
@@ -146,6 +147,8 @@ GEM
146
147
  racc (~> 1.4)
147
148
  nokogiri (1.18.8-arm64-darwin)
148
149
  racc (~> 1.4)
150
+ nokogiri (1.18.8-x64-mingw-ucrt)
151
+ racc (~> 1.4)
149
152
  nokogiri (1.18.8-x86_64-darwin)
150
153
  racc (~> 1.4)
151
154
  nokogiri (1.18.8-x86_64-linux-gnu)
@@ -239,6 +242,7 @@ PLATFORMS
239
242
  arm-linux-gnu
240
243
  arm-linux-musl
241
244
  arm64-darwin
245
+ x64-mingw-ucrt
242
246
  x86_64-darwin
243
247
  x86_64-linux-gnu
244
248
  x86_64-linux-musl
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.1 --verbose test --judge guess ./fixtures"
19
+ When I run bin/judges with "--factbase 0.12.1 --verbose test --judge guess ./fixtures"
20
20
  Then Exit code is zero
21
- And Stdout contains "Factbase version to be used: '0.11.1'"
21
+ And Stdout contains "Factbase version to be used: '0.12.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.5'
12
+ s.version = '0.50.7'
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/judge.rb CHANGED
@@ -74,7 +74,7 @@ class Judges::Judge
74
74
  end
75
75
  s = File.join(@dir, script)
76
76
  raise "Can't load '#{s}'" unless File.exist?(s)
77
- elapsed(@loog, intro: "#{$judge} completed", level: Logger::INFO) do
77
+ elapsed(@loog, good: "#{$judge} completed", level: Logger::INFO) do
78
78
  load(s, true)
79
79
  $fb.churn
80
80
  # rubocop:disable Lint/RescueException
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.7' 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.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko