b4n1-boost 0.4.5 → 0.4.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: 70d15ac335db6a17e1291dd5a3185e9f62388091e4e9a3d199e6b1a5c45b995b
4
- data.tar.gz: 4562e813f50641bf9ecca62c5179634793ffdf2de20a0a51a0997c30d98cf326
3
+ metadata.gz: 805bc30bcf38450b344a83cc506b7b69759c3f7d93ef633b488e344f0c2de87e
4
+ data.tar.gz: 1df7d048510b6d3b428a228ea4b44b5980f500086902eb0b1bca5a8630928219
5
5
  SHA512:
6
- metadata.gz: 749ad3b3c5653b8e3df7f8a2db26d16dfc3fcd3ecfa459979bc5865bcd880e4bed957b12840874828f95bda0a08cf0ca01a13cafb6f72f13bc38b4754d8ae081
7
- data.tar.gz: be6c321544276a9a74a23e6f18253db00e731f7fe81c408045b8f64246ac5854c208e8c15489bac4686db8da995ceb0178ecffddae8a547204e550f49b8aa233
6
+ metadata.gz: 1e7e28cc386ddb00dbc6d8a5ab9fa8a24c026bf43980429afe5d810903403c94f2d032659bd3928202d111d630b0734c4c2651dad6378ed286cd6f09381bbcbe
7
+ data.tar.gz: c0c032755374796defd46716d71306056c011591cc0899154bfa825554e243c6b5b2ce5b2446cfa89540ae707f22dafdb0bd6b0f82fd2f4fbb0aba5ddd526f3c
data/boost.rb CHANGED
@@ -89,6 +89,25 @@ module B4N1
89
89
  result
90
90
  end
91
91
 
92
+ # Inverse of compress_zstd. The symbol was already declared above and
93
+ # never wrapped, so a Ruby service could compress but not decompress
94
+ # what it produced.
95
+ def decompress_zstd(data)
96
+ return '' if data.empty?
97
+
98
+ out_ptr = Fiddle::Pointer.malloc(Fiddle::SIZEOF_VOIDP)
99
+ out_len = Fiddle::Pointer.malloc(Fiddle::SIZEOF_SIZE_T)
100
+
101
+ res = b4n1_boost_decompress_zstd(data, data.bytesize, out_ptr, out_len)
102
+ raise 'Zstd decompression failed' unless res.zero?
103
+
104
+ ptr_val = Fiddle::Pointer.new(out_ptr[0, Fiddle::SIZEOF_VOIDP].unpack1('J'))
105
+ len_val = out_len[0, Fiddle::SIZEOF_SIZE_T].unpack1('J')
106
+
107
+ result = ptr_val.to_str(len_val)
108
+ b4n1_boost_free_buffer(ptr_val, len_val)
109
+ result
110
+ end
92
111
 
93
112
  def minify_html(html)
94
113
  ptr = b4n1_boost_minify_html(html)
@@ -0,0 +1,6 @@
1
+ # B4N1-Boost Ruby SDK — Rack middleware entry point.
2
+ # `require 'b4n1_boost/rack'` (documented) loads the middleware without ever
3
+ # putting a bare `rack` on the gem's load path, so the real Rack gem is never
4
+ # shadowed.
5
+ require_relative "../b4n1_boost"
6
+ require_relative "../../rack"
data/lib/b4n1_boost.rb ADDED
@@ -0,0 +1,12 @@
1
+ # B4N1-Boost Ruby SDK — Business Source License 1.1 (BUSL-1.1).
2
+ # Entry point for the documented form `require 'b4n1_boost'`.
3
+ #
4
+ # WHY THIS SHIM EXISTS: the gem used to ship only root-level boost.rb /
5
+ # core.rb / rack.rb with require_paths = ["."]. The docs and the README of the
6
+ # published gem said `require 'b4n1_boost'`, which raised LoadError — and the
7
+ # only working form, `require 'rack'`, shadowed (or was shadowed by) the real
8
+ # Rack gem depending on load-path order. Both problems are layout problems,
9
+ # so the layout is what changed: this lib/ entry point carries the documented
10
+ # name and the root files stay for backward compatibility.
11
+ require_relative "../boost"
12
+ require_relative "../core"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: b4n1-boost
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - B4N1 Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-11-05 00:00:00.000000000 Z
11
+ date: 2026-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -37,6 +37,8 @@ files:
37
37
  - README.md
38
38
  - boost.rb
39
39
  - core.rb
40
+ - lib/b4n1_boost.rb
41
+ - lib/b4n1_boost/rack.rb
40
42
  - lib/native/linux-arm64/libb4n1_boost.so
41
43
  - lib/native/linux-x64/libb4n1_boost.so
42
44
  - lib/native/macos-arm64/libb4n1_boost.dylib
@@ -50,6 +52,7 @@ metadata: {}
50
52
  post_install_message:
51
53
  rdoc_options: []
52
54
  require_paths:
55
+ - lib
53
56
  - "."
54
57
  required_ruby_version: !ruby/object:Gem::Requirement
55
58
  requirements: