leopard 0.2.3 → 0.2.4

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: b11c29c5faebe2abbe4a266477d181a87e8d357d558766be381d64505727465a
4
- data.tar.gz: 151af09da3ca8570f5e7f40c522548b244c563ff4b6120eecd99e2ca992a91d5
3
+ metadata.gz: 91aa4b92bca51e6d8b73238440961b9f3f43a0cbad93e7faa8a905ed25cf0ae0
4
+ data.tar.gz: '060265234152419f9ccffae0177c83cf3a6e9d175d453fb4657163a419ce7ed9'
5
5
  SHA512:
6
- metadata.gz: 9b4a5ac5c82e1db6b45f5a41045dbb529ffd32bb718a7f8c55c52fc0f6219c079dbf811576aa8ed8ef61919f30de72be25a5cd1fc61607173e2ebe7ce590910b
7
- data.tar.gz: 87365e6f0865c71d581a4756ffae5cae1d3dda78038287699ca31de201663c7b4b2e0b0c85e0fc1537e6f1c2833a1e69dfdb05959f28811cb5a45414dfdb729a
6
+ metadata.gz: e7f3a1b44ac12f62f1bd0fd06aa9a5e48d0007f022f6664929b569e0016587d24adce6c2e3e5fb7ed769a38509d3e83e79c80e891c7470c61c6848fede6380a2
7
+ data.tar.gz: 33416a919d4e8f073ea9b89a46ede9aae3979284f2614b868a997fd3e6f21dae98802755203139a55facb58c4aad16a0a5fdc42499cf7cfc04521d5eff8c3126
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.2.3"
2
+ ".": "0.2.4"
3
3
  }
data/.version.txt CHANGED
@@ -1 +1 @@
1
- 0.2.3
1
+ 0.2.4
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.4](https://github.com/rubyists/leopard/compare/v0.2.3...v0.2.4) (2026-03-31)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * preserve respond_with_error payloads ([#40](https://github.com/rubyists/leopard/issues/40)) ([f5c0d46](https://github.com/rubyists/leopard/commit/f5c0d463ec85556c731da1251897f27f2816310b))
9
+
3
10
  ## [0.2.3](https://github.com/rubyists/leopard/compare/v0.2.2...v0.2.3) (2025-08-16)
4
11
 
5
12
 
@@ -7,16 +7,26 @@ require_relative '../lib/leopard/nats_api_server'
7
7
  class EchoService
8
8
  include Rubyists::Leopard::NatsApiServer
9
9
 
10
+ config.logger = SemanticLogger[:EchoService]
10
11
  def initialize(a_var: 1)
11
12
  logger.info "EchoService initialized with a_var: #{a_var}"
12
13
  end
13
14
 
14
- endpoint(:echo) { |msg| Success(msg.data) }
15
- endpoint(:echo_fail) { |msg| Failure({ failure: '*boom*', data: msg.data }) }
15
+ endpoint(:echo) do |msg|
16
+ data = msg.data
17
+ logger.trace('Received message', data:)
18
+ Success(data)
19
+ end
20
+ endpoint(:echo_fail) do |msg|
21
+ data = msg.data
22
+ logger.trace('Received message', data:)
23
+ Failure({ failure: '*boom*', data: msg.data })
24
+ end
16
25
  end
17
26
 
18
27
  if __FILE__ == $PROGRAM_NAME
19
28
  SemanticLogger.default_level = :info
29
+ SemanticLogger.add_signal_handler
20
30
  SemanticLogger.add_appender(io: $stdout, formatter: :color)
21
31
  EchoService.run(
22
32
  nats_url: 'nats://localhost:4222',
@@ -25,6 +35,6 @@ if __FILE__ == $PROGRAM_NAME
25
35
  version: '1.0.0',
26
36
  instance_args: { a_var: 2 },
27
37
  },
28
- instances: 1,
38
+ instances: ENV.fetch('ECHO_INSTANCES', '1').to_i,
29
39
  )
30
40
  end
@@ -31,11 +31,11 @@ module Rubyists
31
31
  raw.respond(serialize(payload))
32
32
  end
33
33
 
34
- # @param err [String, Exception] The error message or exception to respond with.
34
+ # @param err [Object] The error payload to respond with.
35
35
  #
36
36
  # @return [void]
37
- def respond_with_error(err)
38
- raw.respond_with_error(err.to_s)
37
+ def respond_with_error(err, &)
38
+ raw.respond_with_error(err, &)
39
39
  end
40
40
 
41
41
  private
@@ -313,7 +313,7 @@ module Rubyists
313
313
  process_result(wrapper, result)
314
314
  rescue StandardError => e
315
315
  logger.error 'Error processing message: ', e
316
- wrapper.respond_with_error(e.message)
316
+ wrapper.respond_with_error(e)
317
317
  end
318
318
 
319
319
  # Processes the result of the handler execution.
@@ -3,7 +3,7 @@
3
3
  module Rubyists
4
4
  module Leopard
5
5
  # x-release-please-start-version
6
- VERSION = '0.2.3'
6
+ VERSION = '0.2.4'
7
7
  # x-release-please-end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leopard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - bougyman
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-08-16 00:00:00.000000000 Z
10
+ date: 2026-03-31 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: concurrent-ruby