isomorfeus-hamster 0.6.5 → 0.6.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isomorfeus/hamster/marshal.rb +7 -4
- data/lib/isomorfeus/hamster/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e186ba78fcf4810b5663570e71e59670c84cc5ac69cc7f763a6bf69fbf69ea6c
|
4
|
+
data.tar.gz: 4b782b907c2912b0dd0bf41465a3d892e8df58a70fe1a54efa9deb0cd9720e95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d15d65f4fe1bb5a5676c5e87d6037ea331f4652d7b83fdc968a2e9e9567fa3f1d4cf3d98bc5ff51b4c61448e7655fede3b8c19b596d1ffdef35db4265f018aea
|
7
|
+
data.tar.gz: 59f4df54ec87985d09a988057112279ee573a5628540f2d30d25261913f1f046cbd0d63ef76a0488dc624425c7f77af24dc9828d83452102b005401d5d17ab8f
|
@@ -17,12 +17,15 @@ module Isomorfeus
|
|
17
17
|
::Oj.load(v, mode: :object, circular: true, class_cache: class_cache)
|
18
18
|
end
|
19
19
|
|
20
|
-
def serialize(obj, class_cache: true)
|
21
|
-
::Oj.dump(obj, mode: :object, circular: true, class_cache: class_cache)
|
20
|
+
def serialize(obj, class_cache: true, compress: false)
|
21
|
+
v = ::Oj.dump(obj, mode: :object, circular: true, class_cache: class_cache)
|
22
|
+
v = 'b:' << ::Brotli.deflate(v, quality: compress) if compress
|
23
|
+
v
|
22
24
|
end
|
23
25
|
|
24
|
-
def unserialize(
|
25
|
-
::
|
26
|
+
def unserialize(v, class_cache: true)
|
27
|
+
v = ::Brotli.inflate(v[2..]) if v.start_with?(BROTLI)
|
28
|
+
::Oj.load(v, mode: :object, circular: true, class_cache: class_cache)
|
26
29
|
end
|
27
30
|
end
|
28
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isomorfeus-hamster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Biedermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02-
|
11
|
+
date: 2022-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: brotli
|