leopard 0.2.10 → 0.3.0

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: 61ef512c45c7a77049bcb82926d8f77f30986d3e63cad9f500f6bfc729968448
4
- data.tar.gz: b27aeba2b9a28e286420dfe5a32be1cfc22792cd7d68c317178b7b463adbf9d9
3
+ metadata.gz: 4d1aeb9c3c7a7e402bb3f9fa824c49e56d0138f7dbad76d9c2f26b31280a9dfd
4
+ data.tar.gz: 2362a8775ed22e26944e2d9569a234613eac744345e4820c733abeacfe9d452e
5
5
  SHA512:
6
- metadata.gz: b49256564d284e559c04e52bc689eeb5113d9ddc7d3fa4279c5d6bcca19501bc297595ab2f7481eb12a47b3cf7dffbe5a98fa7e7fc57f32357023ebc1296bc8c
7
- data.tar.gz: dd3a974237972a781b51aa24ba3295e4be1ac49a56d2a9e5f3dc678db716cb7ec3f7813ce5a41e3eb224129ea7b795c7c01efa863ca991a050e69c026dd920c4
6
+ metadata.gz: db4f46324cde1b6a507adf5690d2a4adb04520e792174c727c99c727fcc6164af25298913ecbbd0c848fd1268218b740f32a8cfb07b3360da2589c6353d41eff
7
+ data.tar.gz: 0f6701f12059b90c932feae64cdee90746a0fdbe330456159d366933973314af68e800c0c0b617274670dc2a1c9e6ec163af7eb5c2e36fd59e7b87035f20976a
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.2.10"
2
+ ".": "0.3.0"
3
3
  }
data/.version.txt CHANGED
@@ -1 +1 @@
1
- 0.2.10
1
+ 0.3.0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,50 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.0](https://github.com/rubyists/leopard/compare/v0.2.11...v0.3.0) (2026-09-18)
4
+
5
+
6
+ ### ⚠ BREAKING CHANGES
7
+
8
+ * Big move to use kwargs as the initializer for classes which include us ([#28](https://github.com/rubyists/leopard/issues/28))
9
+
10
+ ### Features
11
+
12
+ * add NATS service discovery tools ([#58](https://github.com/rubyists/leopard/issues/58)) ([#59](https://github.com/rubyists/leopard/issues/59)) ([382d5e7](https://github.com/rubyists/leopard/commit/382d5e7e19367796145bec07e4bda686268905ae))
13
+ * add nats_jetstream_consumer to provide the feature requested in issue [#44](https://github.com/rubyists/leopard/issues/44) ([#45](https://github.com/rubyists/leopard/issues/45)) ([9372aa4](https://github.com/rubyists/leopard/commit/9372aa4ce59b130e7143905ce5e8065519778861))
14
+ * add optional prometheus metrics endpoint with saturation metrics ([#42](https://github.com/rubyists/leopard/issues/42)) ([fcd767a](https://github.com/rubyists/leopard/commit/fcd767ab5438c92bf50800d50027b43b7d0f9f0e))
15
+ * Adds gemspec and gemfile ([#1](https://github.com/rubyists/leopard/issues/1)) ([972dc72](https://github.com/rubyists/leopard/commit/972dc72de804ca10db5cf869d0ea996a94ac9722))
16
+ * Adds graceful shutdown when INT/TERM/QUIT signal is received ([#18](https://github.com/rubyists/leopard/issues/18)) ([ce03fb0](https://github.com/rubyists/leopard/commit/ce03fb00afcbbadadc413766b62df9451f7b73b8))
17
+ * Adds rakefile back ([#3](https://github.com/rubyists/leopard/issues/3)) ([271592c](https://github.com/rubyists/leopard/commit/271592c357e07d58de085297850533eaae60a285))
18
+ * Adds settings to module ([9ff0942](https://github.com/rubyists/leopard/commit/9ff0942dddd86bf4f97bc82626cc7bb35e4115ac))
19
+ * Basic functionality for serving apis ([#4](https://github.com/rubyists/leopard/issues/4)) ([9ff0942](https://github.com/rubyists/leopard/commit/9ff0942dddd86bf4f97bc82626cc7bb35e4115ac))
20
+ * improved leopard saturation metrics ([2303ef2](https://github.com/rubyists/leopard/commit/2303ef223b6b8150d728d827592744bbc75fc1a3))
21
+ * improved leopard saturation metrics ([c143056](https://github.com/rubyists/leopard/commit/c143056683f694eba1704acb84139095887515f4))
22
+ * Initial readme ([4ea9f34](https://github.com/rubyists/leopard/commit/4ea9f341c9df6096b8df3595ff6a075eb9b5c4f6))
23
+ * serialize error payloads ([e87f709](https://github.com/rubyists/leopard/commit/e87f709949baef3fdb001605e2ecce10b1fa3b02))
24
+ * serialize error payloads ([7fdc19f](https://github.com/rubyists/leopard/commit/7fdc19f0419756f21765a9ccb280701a1b9700df))
25
+ * surface handler results to middleware chain ([#47](https://github.com/rubyists/leopard/issues/47)) ([eb046f2](https://github.com/rubyists/leopard/commit/eb046f245cfd3c773167e24b5690308ebb67ff87))
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * [#35](https://github.com/rubyists/leopard/issues/35) - Limits the backtrace to 4 lines in our exceptions ([#36](https://github.com/rubyists/leopard/issues/36)) ([df0fee8](https://github.com/rubyists/leopard/commit/df0fee8373fc0088cd61abcc3e6d963e957730b6))
31
+ * Allow non blocking all the way down to the instance level ([#27](https://github.com/rubyists/leopard/issues/27)) ([01748a5](https://github.com/rubyists/leopard/commit/01748a56bc927ee1dbc70d2351fd12037e5b4bef))
32
+ * Big move to use kwargs as the initializer for classes which include us ([#28](https://github.com/rubyists/leopard/issues/28)) ([72293b4](https://github.com/rubyists/leopard/commit/72293b434998679fe3ff2d467a6a39c11a325b5a))
33
+ * content type calculation ([0af4b0b](https://github.com/rubyists/leopard/commit/0af4b0ba3c322ad734730f45eac925a73a760c73))
34
+ * Corrects gemname in publish-gem.sh ([9ff0942](https://github.com/rubyists/leopard/commit/9ff0942dddd86bf4f97bc82626cc7bb35e4115ac))
35
+ * Corrects the version ([#7](https://github.com/rubyists/leopard/issues/7)) ([a3de532](https://github.com/rubyists/leopard/commit/a3de5320a8c54e9ca6724b6e90812bb5b1b7d150))
36
+ * **deps:** remove upper bound from semantic_logger dependency ([#54](https://github.com/rubyists/leopard/issues/54)) ([0b9f154](https://github.com/rubyists/leopard/commit/0b9f154f1b2ec1961dbb176954551b6f9caf16f0))
37
+ * Do not leak SemanticLogger settings outside of isolation ([#30](https://github.com/rubyists/leopard/issues/30)) ([524595c](https://github.com/rubyists/leopard/commit/524595c37f114ec28f40abc841ecb3c7b6579f5a))
38
+ * Ensure we exit after saying Bye Bye ([#33](https://github.com/rubyists/leopard/issues/33)) ([11a7584](https://github.com/rubyists/leopard/commit/11a7584dd88e7c7fb4dbfde613b8186dc4253892))
39
+ * Fixes the gem publisher, and adds missing .version.txt ([#11](https://github.com/rubyists/leopard/issues/11)) ([3dcbd3c](https://github.com/rubyists/leopard/commit/3dcbd3c1d687e04ce5fde85fef5c2d1c10a8a4cc))
40
+ * Have to build the gem before we can find it, doh ([#13](https://github.com/rubyists/leopard/issues/13)) ([62053e9](https://github.com/rubyists/leopard/commit/62053e9d2332d37d4d5697035a35adc71833eccd))
41
+ * only serialize for metrics ([b7c81a6](https://github.com/rubyists/leopard/commit/b7c81a6dd44c326aec57c4e32971e87b4ca75eab))
42
+ * preserve respond_with_error payloads ([#40](https://github.com/rubyists/leopard/issues/40)) ([f5c0d46](https://github.com/rubyists/leopard/commit/f5c0d463ec85556c731da1251897f27f2816310b))
43
+ * Remove sequel cruft in ci config ([#9](https://github.com/rubyists/leopard/issues/9)) ([09a43e2](https://github.com/rubyists/leopard/commit/09a43e23c309167c56095dd608af9d79ff4f9b19))
44
+ * Run in blocking mode, not just non-blocking ([#15](https://github.com/rubyists/leopard/issues/15)) ([a659145](https://github.com/rubyists/leopard/commit/a659145d8a04efe3b3932b99ab4c11ef0ba2025e))
45
+ * set metrics JSON content type ([24196d1](https://github.com/rubyists/leopard/commit/24196d1307dab4153beb1c4142c7cf5ca786d336))
46
+ * Stop sending code argument to respond_with_error, it does not accept it ([#23](https://github.com/rubyists/leopard/issues/23)) ([9d87b8c](https://github.com/rubyists/leopard/commit/9d87b8c308a1fdff72769863711bb6bb942b3677))
47
+
3
48
  ## [0.2.10](https://github.com/rubyists/leopard/compare/v0.2.9...v0.2.10) (2026-09-16)
4
49
 
5
50
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'socket'
4
4
  require 'erb'
5
+ require 'json'
5
6
 
6
7
  module Rubyists
7
8
  module Leopard
@@ -62,8 +63,11 @@ module Rubyists
62
63
  def write_metrics_response(client, request_line, workers)
63
64
  if request_line&.start_with?('GET /metrics')
64
65
  body = prometheus_metrics(workers)
66
+ content_type = body.is_a?(String) ? 'text/plain; version=0.0.4' : 'application/json'
67
+ body = JSON.generate(body) unless body.is_a?(String)
68
+
65
69
  client.write "HTTP/1.1 200 OK\r\n" \
66
- "Content-Type: text/plain; version=0.0.4\r\n" \
70
+ "Content-Type: #{content_type}\r\n" \
67
71
  "Content-Length: #{body.bytesize}\r\n\r\n#{body}"
68
72
  else
69
73
  client.write "HTTP/1.1 404 Not Found\r\nContent-Length: 0\r\n\r\n"
@@ -3,7 +3,7 @@
3
3
  module Rubyists
4
4
  module Leopard
5
5
  # x-release-please-start-version
6
- VERSION = '0.2.10'
6
+ VERSION = '0.3.0'
7
7
  # x-release-please-end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leopard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.10
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - bougyman