b4n1-boost 0.4.4 → 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 +4 -4
- data/boost.rb +19 -0
- data/lib/b4n1_boost/rack.rb +6 -0
- data/lib/b4n1_boost.rb +12 -0
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 805bc30bcf38450b344a83cc506b7b69759c3f7d93ef633b488e344f0c2de87e
|
|
4
|
+
data.tar.gz: 1df7d048510b6d3b428a228ea4b44b5980f500086902eb0b1bca5a8630928219
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
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-
|
|
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:
|